:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --primary-color: #4a90e2;
    --secondary-color: #357abd;
    --accent-color: #5ba3f5;
    --dark-color: #1A1A2E;
    --light-bg: #f5f7fa;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --hover-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

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

html {
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

html, body {
    touch-action: pan-y;
    -ms-touch-action: pan-y;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Автомобильный серебристый градиент */
    background: linear-gradient(135deg, #2c3e50 0%, #3d5467 25%, #95a5a6 50%, #b0bec5 75%, #78909c 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--dark-color);
    padding-bottom: 70px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Декоративные круги на фоне */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(149, 165, 166, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(176, 190, 197, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 25s ease-in-out infinite reverse;
    z-index: 0;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Анимация градиента */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header - Liquid Glass */
.header {
    /* Ликвид гласс эффект */
    background: rgba(44, 62, 80, 0.35);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.1);

    color: white;
    padding: 20px;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;

    /* Анимация появления */
    animation: slideDown 0.5s ease-out;
}

/* Металлический блик на хедере */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShine 8s ease-in-out infinite;
}

@keyframes headerShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-icon {
    filter: drop-shadow(0 2px 8px rgba(74, 144, 226, 0.4));
    animation: rotate3d 20s linear infinite;
}

@keyframes rotate3d {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(360deg); }
}

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

.logo-line1, .logo-line2 {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #a8d8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
}

.product-count {
    font-size: 13px;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Filters - Liquid Glass */
.filters-section {
    padding: 15px;
    /* Ликвид гласс эффект */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(30px) saturate(180%) brightness(1.05);

    box-shadow:
        0 8px 24px 0 rgba(0, 0, 0, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin: 15px;
    border-radius: 20px;
    position: relative;
    z-index: 10;

    /* Анимация появления */
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-container {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.filter-chips {
    display: flex;
    gap: 8px;
    padding: 5px 0;
}

/* Filter Chip Buttons */
.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    min-height: 44px;
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--dark-color);
}

.filter-chip:active {
    transform: scale(0.97);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.filter-chip-icon {
    font-size: 16px;
}

.filter-chip-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-chip-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.filter-chip.open .filter-chip-arrow {
    transform: rotate(180deg);
}

/* Filter Modal */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.filter-modal.open {
    display: block;
}

.filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.filter-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.filter-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.filter-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-modal-close:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.2);
}

.filter-modal-body {
    padding: 10px;
    max-height: 50vh;
    overflow-y: auto;
}

/* Filter Options */
.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.filter-option:hover {
    background: rgba(74, 144, 226, 0.1);
}

.filter-option:active {
    transform: scale(0.98);
}

.filter-option.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.filter-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(74, 144, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.filter-option-icon svg {
    width: 28px;
    height: 28px;
}

.filter-option.selected .filter-option-icon {
    background: rgba(255, 255, 255, 0.2);
}

.filter-option.selected .filter-option-icon svg {
    filter: brightness(1.2);
}

.filter-option-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.filter-option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-option.selected .filter-option-check {
    background: white;
    border-color: white;
    color: var(--primary-color);
}

.filter-option.selected .filter-option-check::after {
    content: '✓';
    font-size: 14px;
    font-weight: 700;
}

/* Products Grid */
.products-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Load More Button */
.load-more-container {
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.load-more-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 16px rgba(74, 144, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
}

.load-more-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(74, 144, 226, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.load-more-btn:active {
    transform: translateY(0) scale(0.98);
}

.product-card {
    /* Стеклянный эффект */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);

    border-radius: 20px;
    overflow: hidden;

    /* Мягкие тени */
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;

    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;

    /* Анимация появления с задержкой */
    opacity: 0;
    animation: fadeInScale 0.5s ease-out forwards;
}

/* Хромированный блеск */
.product-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(74, 144, 226, 0.15) 60deg,
        rgba(91, 163, 245, 0.25) 120deg,
        transparent 180deg,
        transparent 360deg
    );
    animation: rotateShine 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes rotateShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Металлический ободок */
.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(145deg, rgba(74, 144, 226, 0.4), rgba(91, 163, 245, 0.2), rgba(74, 144, 226, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.product-card:hover::after {
    opacity: 1;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInScale {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.12);
    border-color: rgba(74, 144, 226, 0.3);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #2c3e50 0%, #3d5467 100%);
    position: relative;
}

/* Градиент overlay на фото */
.product-card .product-image {
    position: relative;
}

.product-card .product-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
}

.product-info {
    padding: 14px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    position: relative;
    z-index: 2;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-code {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
    font-family: monospace;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.product-car {
    font-size: 12px;
    color: #5a6b7d;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Product Image Container with Condition Badge */
.product-image-container {
    position: relative;
}

.product-condition {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.condition-excellent {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.condition-good {
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: white;
}

.condition-average {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
}

.condition-repair {
    background: linear-gradient(135deg, #e74c3c, #ec7063);
    color: white;
}

/* Modal Product Styles */
.modal-product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.product-code-badge {
    font-size: 12px;
    font-family: monospace;
    background: rgba(0,0,0,0.08);
    color: #666;
    padding: 4px 10px;
    border-radius: 6px;
}

.product-category-badge {
    font-size: 12px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
}

.product-car-info {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.product-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.spec-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
}

.spec-value.condition-excellent { color: #27ae60; }
.spec-value.condition-good { color: #3498db; }
.spec-value.condition-average { color: #f39c12; }
.spec-value.condition-repair { color: #e74c3c; }

/* Product Compatibility (Применимость) */
.product-compatibility {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.compatibility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(74, 144, 226, 0.1);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    transition: background 0.2s ease;
}

.compatibility-header:active {
    background: rgba(74, 144, 226, 0.2);
}

.compatibility-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.product-compatibility.open .compatibility-arrow {
    transform: rotate(180deg);
}

.compatibility-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.02);
}

.product-compatibility.open .compatibility-body {
    max-height: 300px;
    overflow-y: auto;
}

.compatibility-list {
    padding: 12px 16px;
}

.compatibility-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

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

.compatibility-model {
    font-weight: 600;
    color: var(--dark-color);
    display: block;
    margin-bottom: 2px;
}

.compatibility-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.product-price {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.2));
    position: relative;
}

.add-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 12px rgba(74, 144, 226, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-btn:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    transform: scale(1.03);
    box-shadow:
        0 6px 16px rgba(74, 144, 226, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.add-btn:active {
    transform: scale(0.97);
}

/* Bottom Buttons */
.help-btn {
    position: fixed;
    bottom: 20px;
    right: 180px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--primary-color);
    border: 1px solid rgba(74, 144, 226, 0.3);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.help-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.cart-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.cart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.45);
}

.cart-count {
    background: white;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 8px;
    font-weight: 700;
}

/* Modal - Liquid Glass */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.25);
    z-index: 2000;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.modal.active {
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    /* Ликвид гласс для корзины */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);

    width: 100%;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;

    box-shadow: 0 -4px 16px 0 rgba(0, 0, 0, 0.12);

    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}

.modal-header h2 {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f0f0f0;
}

/* Cart Items */
.cart-items {
    padding: 15px;
    max-height: 50vh;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}

.qty-btn:active {
    transform: scale(0.9);
}

.cart-item-qty {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.remove-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
}

/* Cart Footer */
.cart-footer {
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.total-price {
    color: var(--primary-color);
    font-size: 24px;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 16px rgba(74, 144, 226, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.checkout-btn:hover {
    transform: scale(1.02);
    box-shadow:
        0 6px 20px rgba(74, 144, 226, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Modal */
.product-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Image Gallery */
.image-gallery {
    margin-bottom: 15px;
}

.gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
}

.modal-product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: none;
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-main.has-multiple .gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
}

.gallery-main.has-multiple .gallery-counter {
    display: block;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 4px 0;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gallery-thumb:hover {
    border-color: rgba(74, 144, 226, 0.5);
}

.gallery-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-product-info {
    margin-top: 15px;
}

.product-description {
    margin: 15px 0;
    line-height: 1.6;
    color: #555;
}

.product-category {
    display: inline-block;
    background: var(--accent-color);
    color: var(--dark-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 10px 0;
}

.modal-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

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

.add-to-cart-btn {
    padding: 14px 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 20px;
    margin: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.empty-cart-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Responsive */
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .modal-content {
        max-width: 500px;
        margin: auto;
        border-radius: 20px;
    }

    .modal.active {
        align-items: center;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.4) 25%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(149, 165, 166, 0.2);
}

.skeleton-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-info {
    padding: 12px;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }

/* Ripple Effect для кнопок */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Bounce анимация для корзины */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-20px) scale(1.1); }
    60% { transform: translateY(-10px) scale(1.05); }
}

.cart-btn.bounce {
    animation: bounce 0.6s ease;
}

/* Pulse для счетчика корзины */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-count.pulse {
    animation: pulse 0.3s ease;
}

/* Product Modal - Liquid Glass */
#productModal .modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Улучшенные кнопки */
.add-btn, .checkout-btn, .add-to-cart-btn {
    position: relative;
    overflow: hidden;
    transform-origin: center;
}

.add-btn:active, .checkout-btn:active, .add-to-cart-btn:active {
    transform: scale(0.95);
}

/* Smooth transitions для всего */
* {
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

/* Убираем transition для анимированных элементов */
.product-card, .header, .filters-section {
    transition: none;
}

/* Loading state */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Main Content Area */
.main-content {
    position: relative;
    z-index: 10;
}

/* Page Transitions */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
    overflow-x: hidden;
}

.page.active {
    display: block;
    overflow-x: hidden;
}

/* Page Header */
.page-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(30px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(30px) saturate(180%) brightness(1.05);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    margin: 15px 15px 0 15px;
    border-radius: 20px 20px 0 0;
}

/* Убираем фон у хедера в корзине чтобы не перекрывал карточку */
#cartPage .page-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    margin: 0;
    border-radius: 0;
    padding: 20px 15px 10px 15px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
}

/* Help Page Styles */
.help-content {
    padding: 15px;
}

.help-section {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.help-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.help-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.help-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
}

.help-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.help-link:hover {
    text-decoration: underline;
}

.help-text {
    font-size: 15px;
    color: var(--dark-color);
}

.help-section p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 10px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

/* FAQ Items */
.faq-item {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(74, 144, 226, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(74, 144, 226, 0.2);
}

.faq-item summary {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark-color);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '▼';
    font-size: 12px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item p {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    line-height: 1.6;
    color: #555;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 1000;
    height: 70px;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--tg-theme-hint-color);
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-icon-wrapper {
    position: relative;
}

.nav-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.nav-btn.active .nav-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.3));
}

.nav-label {
    font-size: 12px;
    font-weight: 600;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

.nav-badge.hidden {
    display: none;
}

/* Cart Page Styles */
#cartPage .cart-items {
    padding: 15px;
    min-height: 50vh;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0 15px;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: none;
}

#cartPage .cart-footer {
    position: sticky;
    bottom: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 20px;
    margin: 0 15px 15px 15px;
    border-radius: 0 0 20px 20px;
}
