/* 
 * CSS Architecture inspired by Coderstar.ru 
 * Color Palette: Yellow, White, Grays, Dark text 
 */
:root {
    --primary-yellow: #FFC107;
    --primary-yellow-hover: #FFB300;
    --text-dark: #202427;
    /* Main text color */
    --text-muted: #6B7280;
    /* Secondary text */
    --bg-light: #F9FAFB;
    /* App background */
    --bg-white: #FFFFFF;
    /* Card background */
    --border-color: #E6E8EB;
    /* Light borders */
    --accent-blue: #3B82F6;
    /* Links and secondary buttons */

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-yellow);
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    padding: 8px 0;
}

.nav-link:hover {
    color: var(--text-dark);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-warning {
    background-color: var(--primary-yellow);
    color: var(--text-dark);
}

.btn-warning:hover {
    background-color: var(--primary-yellow-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.btn-outline:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Catalog View */
.catalog-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 48px;
    /* Extra space for the top card's badges */
}

.product-card {
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: background 0.2s;
}

.product-card:hover {
    background-color: #FAFAFA;
}

.product-card:last-child {
    border-bottom: none;
}

.badges-container {
    position: absolute;
    top: -14px;
    left: 24px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.badge {
    background: #FFFBEB;
    /* Light creamy yellow */
    color: #92400E;
    /* Dark amber text for better contrast */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    /* Pill shape */
    box-shadow: 0 4px 6px -1px rgba(251, 191, 36, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #FDE68A;
    white-space: nowrap;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    cursor: pointer;
    max-width: 80%;
}

.card-title:hover {
    color: var(--accent-blue);
}

.card-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-blue);
    white-space: nowrap;
}

.card-description {
    font-size: 15px;
    color: #4B5563;
    line-height: 1.6;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Detail View Layout */
.detail-view {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    margin-top: 32px;
    align-items: start;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    grid-column: 1 / -1;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.why-box {
    background-color: #FFF9C4;
    /* Light yellow from screenshot */
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid #FBE9A7;
}

.why-box h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.why-box p {
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
    color: #4A4A4A;
}

.detail-description p {
    margin-bottom: 12px;
}

.detail-description h3 {
    font-size: 18px;
    margin: 24px 0 12px 0;
}

.detail-description ul {
    margin-bottom: 16px;
    padding-left: 20px;
}

.detail-description li {
    margin-bottom: 6px;
}

/* Detail Sidebar */
.detail-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 104px;
    /* header height + padding */
}

.sidebar-price-area {
    background-color: var(--primary-yellow);
    margin: -24px -24px 24px -24px;
    padding: 24px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    text-align: center;
}

.sidebar-price {
    font-size: 28px;
    font-weight: 800;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pricing Table System */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.pricing-card {
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pricing-card.featured {
    background-color: #FFFBEB;
    border-color: #FDE68A;
    border-width: 2px;
}

.pricing-card.dark {
    background-color: var(--text-dark);
    color: var(--bg-white);
    border-color: var(--text-dark);
}

.pricing-card h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.pricing-card.dark h4 {
    color: var(--primary-yellow);
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-card li {
    font-size: 14px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-card li::before {
    content: "✓";
    color: var(--primary-yellow);
    font-weight: bold;
}

.pricing-card.dark li::before {
    color: var(--primary-yellow);
}

.pricing-footer {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Info Pages (News & KB) */
.info-page {
    margin-top: 40px;
    max-width: 900px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.news-item {
    display: flex;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    min-width: 100px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-yellow-hover);
}

.news-content h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.3;
}

.news-content h3.clickable {
    cursor: pointer;
}

.news-content h3.clickable:hover {
    color: var(--accent-blue);
}

.news-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

.article-view {
    margin-top: 32px;
    max-width: 800px;
}

.article-content h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}

/* Version Box */
.version-box {
    margin-top: 24px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: var(--radius-md);
}

.version-box h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.version-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E6E8EB;
}

.version-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.version-tag {
    display: inline-block;
    font-size: 11px;
    background: var(--text-dark);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 8px;
}

.version-date {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
}

.version-text {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-dark);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 900px) {
    .detail-view {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 650px) {
    .header-container {
        justify-content: center;
        text-align: center;
    }

    .main-nav {
        justify-content: center;
        width: 100%;
        order: 3;
        gap: 16px;
    }

    .header-actions {
        order: 2;
    }

    .product-card {
        padding: 24px 16px;
    }

    .card-title {
        max-width: 100%;
        font-size: 20px;
    }

    .card-price {
        font-size: 20px;
    }

    .card-footer>.btn {
        width: 100%;
    }

    .card-meta {
        width: 100%;
    }

    .news-item {
        flex-direction: column;
        gap: 12px;
    }

    .news-date {
        min-width: auto;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .detail-title {
        font-size: 24px;
    }
}

/* Order Form & TWA */
.form-page {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.form-container {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-sm);
}

.form-container h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.form-container p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.btn-block {
    width: 100%;
}

@media (max-width: 600px) {
    .form-container {
        padding: 24px 16px;
        border: none;
        box-shadow: none;
    }
}