﻿/* ===== CSS Variables - iOS Light Theme ===== */
:root {
    --primary: #007AFF;
    --primary-dark: #0056CC;
    --secondary: #5856D6;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    
    --bg-primary: #F2F2F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E5E5EA;
    
    --text-primary: #1C1C1E;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    
    --border: rgba(60, 60, 67, 0.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;
    
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-appearance: none;
}

input {
    font-family: inherit;
    -webkit-appearance: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ol, ul {
    list-style: none;
}

/* ===== Language Bar ===== */
.lang-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.lang-scroll {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lang-scroll::-webkit-scrollbar {
    display: none;
}

.lang-link {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.lang-link:active {
    transform: scale(0.95);
}

.lang-link.active {
    background: var(--primary);
    color: #fff;
}

/* ===== Header ===== */
.header {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 41px;
    z-index: 99;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.logo span {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Main ===== */
.main {
    padding: 12px;
    max-width: 100%;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    margin-bottom: 12px;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb a {
    color: var(--text-tertiary);
}

.breadcrumb a:active {
    color: var(--primary);
}

.breadcrumb .current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Product Card ===== */
.product-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    margin-bottom: 12px;
}

.sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    z-index: 5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.product-image {
    position: relative;
    padding: 20px;
    margin-bottom: 16px;
}

.product-image img {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.product-info {
    text-align: center;
}

.product-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.product-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* Rating */
.rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    color: #FFD60A;
    font-size: 14px;
    letter-spacing: 1px;
}

.rating-text {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Price */
.price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.price-old {
    font-size: 16px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.price-new {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.discount {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stock-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stock-left {
    color: var(--text-tertiary);
}

/* ===== Nutrition Section ===== */
.nutrition-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.nutrition-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}

.nut-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.nut-label {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.nut-unit {
    display: block;
    font-size: 10px;
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* ===== Action Section ===== */
.action-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qty-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quantity-control {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.qty-btn:active {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.qty-input {
    width: 50px;
    height: 40px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* CTA Button */
.cta-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cta-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-btn:active {
    transform: scale(0.98);
}

.cta-btn:active::after {
    left: 100%;
}

.cta-btn-large {
    padding: 18px 28px;
    font-size: 17px;
}

.cta-arrow {
    font-size: 18px;
}

/* ===== Trust Section ===== */
.trust-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

.trust-title {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pay-icon {
    width: 48px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pay-icon svg {
    width: 100%;
    height: 100%;
}

/* ===== Features Section ===== */
.features-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    margin-bottom: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

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

.feature-icon {
    width: 24px;
    text-align: center;
    font-size: 16px;
}

/* ===== Description Section ===== */
.description-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 20px 16px;
    margin-bottom: 12px;
}

.description-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.description-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.description-section p:last-of-type {
    margin-bottom: 0;
}

    /* ===== Tables Styling ===== */
    .description-section table {
        width: 100%;
        border-collapse: collapse;
        margin: 16px 0;
        background: var(--bg-primary);
        border-radius: var(--radius-md);
        overflow: hidden;
        font-size: 13px;
    }

        .description-section table thead {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
        }

            .description-section table thead th {
                padding: 12px 10px;
                text-align: left;
                font-weight: 600;
                font-size: 13px;
                color: #ffffff;
                border-right: 1px solid rgba(255, 255, 255, 0.2);
            }

                .description-section table thead th:last-child {
                    border-right: none;
                }

        .description-section table tbody tr {
            border-bottom: 1px solid var(--border);
        }

            .description-section table tbody tr:last-child {
                border-bottom: none;
            }

        .description-section table tbody td {
            padding: 12px 10px;
            color: var(--text-secondary);
            border-right: 1px solid var(--border);
        }

            .description-section table tbody td:last-child {
                border-right: none;
            }

            .description-section table tbody td:first-child {
                font-weight: 600;
                color: var(--text-primary);
            }

/* For mobile - make tables scrollable */
@media (max-width: 480px) {
    .description-section table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

        .description-section table thead th,
        .description-section table tbody td {
            padding: 10px 8px;
            font-size: 12px;
        }
}

/* ===== Lists Styling ===== */
.description-section ul {
    margin: 16px 0;
    padding-left: 0;
}

    .description-section ul li {
        position: relative;
        padding-left: 32px;
        margin-bottom: 10px;
        font-size: 14px;
        color: var(--text-secondary);
        line-height: 1.6;
    }

        .description-section ul li::before {
            content: "✓";
            position: absolute;
            left: 0;
            top: 0;
            width: 22px;
            height: 22px;
            background: linear-gradient(135deg, var(--success), #28A745);
            color: #ffffff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 12px;
        }

.description-section ol {
    margin: 16px 0;
    padding-left: 0;
    counter-reset: item;
}

    .description-section ol li {
        position: relative;
        padding-left: 40px;
        margin-bottom: 14px;
        font-size: 14px;
        color: var(--text-secondary);
        line-height: 1.6;
        counter-increment: item;
    }

        .description-section ol li::before {
            content: counter(item);
            position: absolute;
            left: 0;
            top: 0;
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: #ffffff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
        }

        .description-section ul li strong,
        .description-section ol li strong {
            color: var(--text-primary);
            font-weight: 600;
        }

/* ===== Responsive для списків ===== */
@media (max-width: 480px) {
    .description-section ul li,
    .description-section ol li {
        font-size: 13px;
    }

        .description-section ul li::before {
            width: 20px;
            height: 20px;
            font-size: 11px;
        }

        .description-section ol li::before {
            width: 26px;
            height: 26px;
            font-size: 13px;
        }
}

/* Specs Table */
.specs-table {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.specs-table h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.specs-list {
    margin: 0;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-tertiary);
}

.spec-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Reviews Section ===== */
.reviews-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 20px 16px;
    margin-bottom: 12px;
}

.reviews-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.no-reviews {
    text-align: center;
    padding: 24px 16px;
}

.no-reviews-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-reviews h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.no-reviews p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

/* Review Cards */
.review-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.review-card:last-child {
    margin-bottom: 0;
}

.review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.review-meta {
    flex: 1;
    min-width: 0;
}

.review-author {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.review-date {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.review-rating {
    flex-shrink: 0;
}

.review-stars {
    color: #FFD60A;
    font-size: 12px;
    letter-spacing: 1px;
}

.review-badge {
    margin-bottom: 10px;
}

.badge-verified {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
    background: rgba(52, 199, 89, 0.1);
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.review-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ===== Bottom CTA Section ===== */
.bottom-cta-section {
    margin-bottom: 12px;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    padding: 24px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-bottom: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.footer-logo {
    width: 24px;
    height: 24px;
}

.footer-brand span {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer-links a:active {
    color: var(--primary);
}

.copyright {
    font-size: 12px;
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* ===== Sticky CTA ===== */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 99;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-cta.visible {
    transform: translateY(0);
}

.sticky-price {
    display: flex;
    flex-direction: column;
    min-width: 70px;
}

.sticky-old {
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.sticky-new {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.sticky-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    text-align: center;
    display: block;
}

.sticky-btn:active {
    transform: scale(0.98);
}

/* ===== Media Queries ===== */
@media (min-width: 480px) {
    .main {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .product-title {
        font-size: 32px;
    }
    
    .price-new {
        font-size: 36px;
    }
}

@media (min-width: 768px) {
    .main {
        max-width: 600px;
    }
    
    .nutrition-item {
        padding: 16px 12px;
    }
    
    .nut-value {
        font-size: 28px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .lang-bar,
    .sticky-cta,
    .cta-btn {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
