/* Core palette & typography - Monochrome Premium Style */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Monochrome Premium Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-overlay: rgba(255, 255, 255, 0.98);

    /* Removed gradients for flat premium look */
    --card-gradient: #ffffff;
    --card-hover-gradient: #ffffff;

    /* High Contrast Colors */
    --accent: #000000;
    --accent-strong: #000000;
    --accent-soft: rgba(0, 0, 0, 0.04);

    /* Text Colors */
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-tertiary: #666666;

    /* Borders & Shadows */
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.08);
    /* Soft, minimal shadow */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
    --overlay-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);
    /* White fade instead of dark */

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Shapes */
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    --transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);

    /* Telegram Theme Overrides */
    --tg-bg-color: #ffffff;
    --tg-text-color: #000000;
    --tg-hint-color: #666666;
    --tg-link-color: #000000;
    --tg-button-color: #000000;
    --tg-button-text-color: #ffffff;
    --tg-secondary-bg-color: #f9f9f9;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 96px;
    isolation: isolate;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide scrollbar utility */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

* {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    /* Tighter, more modern serif look */
}

/* Minimalist Card Styles - No Gradients */
.shop-card .card-image,
.partner-card .card-image,
.reviews-card .card-image,
.about-card .card-image,
.support-card .card-image {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

/* Remove decorative emojis/watermarks from cards if desired, or keep them for character? 
   Let's keep emojis but make them grayscale? Or remove for pure minimalism.
   User asked for "Forma" style which has NO emojis. I will hide them. */
.shop-card::after,
.partner-card::after,
.reviews-card::after,
.about-card::after,
.support-card::after {
    display: none;
}

.shop-card .card-image::before,
.partner-card .card-image::before,
.reviews-card .card-image::before,
.about-card .card-image::before,
.support-card .card-image::before {
    display: none;
}

/* Clean minimal background - no effects for FORMA style */

/* Top bar & brand - Enhanced minimal style */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #0d1b2a;
    /* Dark blue matching hero */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar .control-btn {
    color: #ffffff;
}

.top-bar .brand-label {
    color: #ffffff;
}

.brand-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

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

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    background: #ff0000;
    padding: 0 4px;
    border: 2px solid #ffffff;
    transition: transform 0.3s ease;
}

/* Favorites heart button */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(6px);
}

.favorite-btn:hover {
    transform: scale(1.05);
}

.favorite-btn.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* Favorite button inside product details header */
.product-details-header .favorite-btn {
    position: static;
    width: 40px;
    height: 40px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.8;
}

.control-btn:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.control-btn.ghost {
    background: rgba(255, 255, 255, 0.02);
}

.brand-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
}

.brand-label {
    display: none;
    /* Hide text label in favor of logo */
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: serif;
    text-transform: uppercase;
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-description {
    display: none;
}

/* Search removed - FORMA style doesn't show search on main page */
.search-container {
    display: none;
}

/* Card grid - FORMA Store style with larger cards */
.content-grid {
    flex: 1;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    /* Increased gap for breathability */
    max-width: 100%;
    margin: 0 auto;
}

.content-card {
    position: relative;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    min-height: 180px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-4px) scale(1.01);
    /* Subtle lift */
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Card images - stylish minimal backgrounds with gradient overlays */
.content-card .card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 1;
    transition: var(--transition);
}

.content-card:hover .card-image {
    opacity: 1;
    transform: scale(1.03);
}

/* Shop card - premium shopping theme with vibrant green gradient */
.shop-card .card-image {
    background:
        linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(67, 160, 71, 0.3) 25%, rgba(56, 142, 60, 0.35) 50%, rgba(46, 125, 50, 0.3) 75%, rgba(76, 175, 80, 0.25) 100%),
        radial-gradient(ellipse at 20% 30%, rgba(129, 199, 132, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(102, 187, 106, 0.35) 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.2) 0%, transparent 70%);
    background-size: 100% 100%, 70% 70%, 65% 65%, 100% 100%;
    filter: blur(1px);
    position: relative;
}

.shop-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.05) 10px,
            rgba(255, 255, 255, 0.05) 20px);
    opacity: 0.3;
}

.shop-card::after {
    content: '🛍️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(76, 175, 80, 0.35)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.shop-card:hover::after {
    transform: translate(-50%, -50%) scale(1.15) translateY(-4px);
    opacity: 0.32;
    filter: drop-shadow(0 12px 24px rgba(76, 175, 80, 0.45)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Partner card - premium network theme with dynamic blue gradient */
.partner-card .card-image {
    background:
        linear-gradient(135deg, rgba(33, 150, 243, 0.28) 0%, rgba(25, 118, 210, 0.32) 25%, rgba(21, 101, 192, 0.36) 50%, rgba(13, 71, 161, 0.32) 75%, rgba(33, 150, 243, 0.28) 100%),
        radial-gradient(ellipse at 25% 40%, rgba(100, 181, 246, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 60%, rgba(66, 165, 245, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(33, 150, 243, 0.25) 0%, transparent 75%);
    background-size: 100% 100%, 75% 75%, 70% 70%, 100% 100%;
    filter: blur(1px);
    position: relative;
}

.partner-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(135deg,
            transparent,
            transparent 8px,
            rgba(255, 255, 255, 0.06) 8px,
            rgba(255, 255, 255, 0.06) 16px);
    opacity: 0.25;
}

.partner-card::after {
    content: '🤝';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    opacity: 0.26;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(33, 150, 243, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 20px rgba(33, 150, 243, 0.45);
}

.partner-card:hover::after {
    transform: translate(-50%, -50%) scale(1.15) translateY(-4px);
    opacity: 0.34;
    filter: drop-shadow(0 12px 24px rgba(33, 150, 243, 0.5)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Reviews card - premium stars theme with radiant gold gradient */
.reviews-card .card-image {
    background:
        linear-gradient(135deg, rgba(255, 193, 7, 0.28) 0%, rgba(255, 171, 0, 0.32) 25%, rgba(255, 152, 0, 0.36) 50%, rgba(245, 124, 0, 0.32) 75%, rgba(255, 193, 7, 0.28) 100%),
        radial-gradient(ellipse at 30% 35%, rgba(255, 224, 130, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 65%, rgba(255, 238, 88, 0.45) 0%, transparent 65%),
        radial-gradient(circle at 50% 50%, rgba(255, 193, 7, 0.3) 0%, transparent 80%);
    background-size: 100% 100%, 80% 80%, 75% 75%, 100% 100%;
    filter: blur(1px);
    position: relative;
}

.reviews-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-radial-gradient(circle at 50% 50%,
            transparent,
            transparent 8px,
            rgba(255, 255, 255, 0.08) 8px,
            rgba(255, 255, 255, 0.08) 16px);
    opacity: 0.3;
}

.reviews-card::after {
    content: '⭐';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    opacity: 0.28;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(255, 193, 7, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 24px rgba(255, 193, 7, 0.5);
}

.reviews-card:hover::after {
    transform: translate(-50%, -50%) scale(1.18) rotate(8deg) translateY(-4px);
    opacity: 0.36;
    filter: drop-shadow(0 12px 24px rgba(255, 193, 7, 0.5)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* About card - premium water theme with vibrant cyan gradient */
.about-card .card-image {
    background:
        linear-gradient(135deg, rgba(3, 169, 244, 0.28) 0%, rgba(0, 188, 212, 0.32) 25%, rgba(0, 150, 255, 0.36) 50%, rgba(0, 131, 220, 0.32) 75%, rgba(3, 169, 244, 0.28) 100%),
        radial-gradient(ellipse at 40% 30%, rgba(77, 208, 225, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 60% 70%, rgba(129, 212, 250, 0.45) 0%, transparent 65%),
        radial-gradient(circle at 50% 50%, rgba(3, 169, 244, 0.3) 0%, transparent 80%);
    background-size: 100% 100%, 85% 85%, 80% 80%, 100% 100%;
    filter: blur(1px);
    position: relative;
}

.about-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 12px,
            rgba(255, 255, 255, 0.07) 12px,
            rgba(255, 255, 255, 0.07) 24px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 12px,
            rgba(255, 255, 255, 0.05) 12px,
            rgba(255, 255, 255, 0.05) 24px);
    opacity: 0.25;
}

.about-card::after {
    content: '💧';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    opacity: 0.26;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(3, 169, 244, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 24px rgba(3, 169, 244, 0.45);
}

.about-card:hover::after {
    transform: translate(-50%, -50%) scale(1.15) translateY(-4px);
    opacity: 0.34;
    filter: drop-shadow(0 12px 24px rgba(3, 169, 244, 0.5)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Support card - premium chat theme with dynamic purple gradient */
.support-card .card-image {
    background:
        linear-gradient(135deg, rgba(156, 39, 176, 0.28) 0%, rgba(171, 71, 188, 0.32) 25%, rgba(123, 31, 162, 0.36) 50%, rgba(106, 27, 154, 0.32) 75%, rgba(156, 39, 176, 0.28) 100%),
        radial-gradient(ellipse at 30% 45%, rgba(186, 104, 200, 0.5) 0%, transparent 58%),
        radial-gradient(ellipse at 70% 55%, rgba(206, 147, 216, 0.45) 0%, transparent 62%),
        radial-gradient(circle at 50% 50%, rgba(156, 39, 176, 0.3) 0%, transparent 75%);
    background-size: 100% 100%, 70% 70%, 68% 68%, 100% 100%;
    filter: blur(1px);
    position: relative;
}

.support-card .card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-conic-gradient(from 0deg at 50% 50%,
            transparent,
            transparent 15deg,
            rgba(255, 255, 255, 0.06) 15deg,
            rgba(255, 255, 255, 0.06) 30deg);
    opacity: 0.28;
}

.support-card::after {
    content: '💬';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 88px;
    opacity: 0.27;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(156, 39, 176, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 24px rgba(156, 39, 176, 0.45);
}

.support-card:hover::after {
    transform: translate(-50%, -50%) scale(1.15) translateY(-4px);
    opacity: 0.35;
    filter: drop-shadow(0 12px 24px rgba(156, 39, 176, 0.5)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Gradient overlay for text readability - Enhanced FORMA style */
.content-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.content-card:hover::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.75) 70%, rgba(0, 0, 0, 0.9) 100%);
}

.content-card .card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 200px;
    height: 100%;
    justify-content: flex-end;
}

.card-top {
    display: none;
}

.card-icon {
    display: none;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 28px;
    height: 28px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: #ff0000;
    padding: 0 8px;
    z-index: 4;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Special styling for cart total badge */
#shop-badge {
    background: linear-gradient(140deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%) !important;
    color: white !important;
    font-weight: 700;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    min-width: auto;
    height: auto;
    text-transform: none;
    letter-spacing: 0.05em;
}

#shop-badge:not([style*="background"]) {
    background: linear-gradient(140deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%) !important;
}

#shop-badge[style*="background: #4CAF50"] {
    background: #4CAF50 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    line-height: 1.3;
    padding: 24px 18px;
    position: relative;
    z-index: 3;
    text-align: left;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.content-card:hover .card-title {
    transform: translateY(-2px);
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.9);
}

.card-action {
    display: none;
}

.content-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.content-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Bottom navigation - FORMA Store minimal style */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-between;
    gap: 4px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 60;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    opacity: 0.7;
}

.nav-item:active {
    transform: scale(0.95);
    opacity: 0.5;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.03);
    opacity: 0;
    transition: var(--transition);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    color: var(--text-primary);
    opacity: 1;
    background: transparent;
}

.nav-item:hover {
    opacity: 1;
    color: var(--text-primary);
}

.nav-item.active::before {
    opacity: 0;
}

/* Overlay for sections */
.section-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    background: var(--tg-bg-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-overlay.main-section {
    /* Keep bottom nav visible for main sections */
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
}

.section-overlay.main-section .section-header h2 {
    /* Center title for bottom-nav main pages */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex: 0;
    text-align: center;
    width: max-content;
    max-width: calc(100% - 120px);
    /* keep space for back/spacer */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-section-open .bottom-nav {
    z-index: 2000;
}

.section-overlay.open {
    transform: translateX(0);
}

.section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--tg-bg-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.section-overlay.no-back .back-btn {
    visibility: hidden;
    pointer-events: none;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--tg-secondary-bg-color);
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.back-btn:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.header-spacer {
    width: 44px;
}

.section-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.hidden {
    display: none !important;
}

/* Content & shared cards inside overlays */
.content-section {
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: none;
    padding: 24px 20px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-section h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #000000;
    margin-bottom: 16px;
    margin-top: 0;
}

.content-section p {
    color: #333333;
    line-height: 1.6;
    font-size: 15px;
    margin: 0 0 12px 0;
}

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

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 18px;
}

.product-card {
    border-radius: var(--radius-md);
    background: rgba(9, 18, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px;
    transition: var(--transition);
}

.product-card:hover {
    border-color: rgba(92, 139, 255, 0.35);
    box-shadow: var(--shadow-soft);
    transform: translateY(-3px);
}

.product-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.product-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent);
    color: var(--tg-button-text-color);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.3);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(51, 144, 236, 0.2);
}

.btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.4);
}

.btn-secondary {
    background: rgba(12, 20, 40, 0.9);
    border-color: rgba(92, 139, 255, 0.25);
}

.btn-secondary:hover {
    box-shadow: 0 15px 28px rgba(12, 28, 60, 0.4);
}

.btn-outline {
    background: transparent;
    color: #5c8bff;
    border: 2px solid #5c8bff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: #5c8bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 139, 255, 0.3);
}

.shop-categories,
/* Hero Banner - FORMA Store style */
.hero-banner {
    width: 100%;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(76, 175, 80, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(33, 150, 243, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-family: serif;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.hero-decoration {
    margin: 20px auto 0;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* PLAZMA branding — как на сайте: тёмно-синий фон, логотип с градиентом */
/* Logo Styles */
.logo-image {
    max-width: 80%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.hero-banner-plazma {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-bottom: none;
}

.hero-banner-plazma::before {
    background: radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 55%);
}

.hero-title-plazma {
    font-family: var(--font-heading), Georgia, serif;
    font-size: 38px;
    font-weight: 400;
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 35%, #7dd3fc 70%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.hero-subtitle-plazma {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

.hero-banner-plazma .hero-decoration {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.brand-badge-plazma .brand-label {
    color: #0f172a;
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* Products Main Container */
.products-main-container {
    flex: 1;
    padding: 24px 16px;
    max-width: 100%;
}

.section-header-inline {
    margin-bottom: 20px;
}

.section-title-inline {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Responsive columns: keep card size, add columns on wide screens */
@media (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1500px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Horizontal scrolling products container */
.products-scroll-container {
    margin-bottom: 32px;
}

.products-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    margin: 0 -16px;
    padding: 0 16px;
}

.products-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.products-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.products-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.products-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.products-horizontal {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
    width: max-content;
}

/* Category covers on home (FORMA-like) */
.category-covers {
    margin: 6px 0 18px;
}

.category-covers-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    padding: 0 2px;
}

.category-covers-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.category-cover-card {
    position: relative;
    flex: 0 0 auto;
    width: 260px;
    height: 150px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    scroll-snap-align: start;
}

.category-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 30%, rgba(0, 0, 0, 0.65) 100%);
}

.category-cover-title {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

/* Catalog tabs (chips) */
.shop-catalog {
    width: 100%;
}

.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    background: var(--tg-bg-color);
    z-index: 5;
}

.category-tab {
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, transform 0.12s ease, border-color 0.12s ease;
}

.category-tab:hover {
    background: rgba(0, 0, 0, 0.06);
}

.category-tab:active {
    transform: scale(0.98);
}

.category-tab.active {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.product-card-forma-horizontal {
    flex: 0 0 auto;
    width: 160px;
    min-width: 160px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    height: auto;
}

.product-card-forma-horizontal:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

.product-card-forma-horizontal .product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.product-card-forma-horizontal .product-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    min-height: 0;
}

.product-card-forma-horizontal .product-card-price {
    order: -1;
    margin: 8px 0 4px 0;
    flex-shrink: 0;
}

.product-card-forma-horizontal .product-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0;
    line-height: 1.4;
    overflow: visible;
    word-wrap: break-word;
    word-break: break-word;
}

.product-card-forma-horizontal .product-card-summary {
    font-size: 11px;
    color: #333333;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    word-wrap: break-word;
    word-break: break-word;
    font-weight: 400;
    min-height: 46px;
    /* 3 lines * 1.4 line-height * 11px ≈ 46px */
}

.product-card-forma-horizontal .product-card-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 0;
    overflow: visible;
    flex-shrink: 0;
}


.product-card-forma-horizontal .price-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.product-card-forma-horizontal .product-card-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
}

/* Кнопка "Все категории" - стильная карточка */
.product-card-more {
    flex: 0 0 auto;
    width: 160px;
    min-width: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(102, 126, 234, 0.3),
        0 2px 6px rgba(102, 126, 234, 0.2);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.product-card-more::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.product-card-more:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 12px 32px rgba(102, 126, 234, 0.4),
        0 6px 16px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.product-card-more:active {
    transform: translateY(-2px) scale(0.98);
}

.product-card-more .more-icon {
    font-size: 56px;
    opacity: 0.95;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.product-card-more:hover .more-icon {
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.product-card-more .more-text {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    z-index: 1;
}

.product-card-more:hover .more-text {
    transform: translateY(-2px);
}

/* Product Card - FORMA Store style */
.product-card-forma {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-forma:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card-forma:hover .product-card-image img {
    transform: scale(1.05);
}

/* FORMA-like product images: edge-to-edge, cover */
.product-card-forma .product-card-image img,
.product-card-forma-horizontal .product-card-image img {
    object-fit: cover;
    padding: 0;
}

.product-card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image-placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

.product-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    min-height: 0;
}

.product-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0;
    line-height: 1.4;
    /* Removed line clamping to show full title */
    overflow: visible;
    word-wrap: break-word;
    word-break: break-word;
}

.product-card-summary {
    display: none;
}



.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    min-width: 0;
    overflow: visible;
}

.product-card-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex-shrink: 0;
    margin: 8px 0 4px 0;
}

.price-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.price-pz {
    font-size: 11px;
    color: #666666;
}

.product-card-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
    /* Ensure full width on mobile or grid */
}

.product-card-btn:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Catalog add button: circle with plus (like screenshot) */
.product-card-add {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.06);
    color: #111827;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
}

.product-card-add:hover {
    background: rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
    box-shadow: none;
}

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

/* Quantity selector on product detail page */
.qty-control {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

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

.qty-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.qty-value {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Favorites: button under price, centered */
.favorites-products-grid .product-card-footer {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.favorites-products-grid .product-card-price {
    align-items: center;
    margin: 0;
}

.favorites-products-grid .product-card-btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

/* Loading and empty states */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .products-grid {
        gap: 12px;
    }

    .hero-title {
        font-size: 36px;
    }

    .section-title-inline {
        font-size: 24px;
    }
}

.shop-category,
.product-tile {
    background: var(--tg-secondary-bg-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 16px;
    transition: var(--transition);
}

.shop-category:active,
.product-tile:active {
    transform: scale(0.98);
}

.shop-category:hover,
.product-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.15);
}

.shop-category h4,
.product-tile h4 {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    margin-top: 0;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.shop-category p,
.product-tile .product-description {
    color: #333333;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    font-weight: 400;
}

.shop-category button,
.btn-add-to-cart,
.btn-buy,
.btn-back-to-catalog {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
    margin: 0;
}

.btn-back-to-catalog svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-back-to-catalog span {
    line-height: 1;
}

.shop-category button:hover,
.btn-add-to-cart:hover,
.btn-buy:hover {
    border-color: rgba(92, 139, 255, 0.55);
    box-shadow: 0 12px 24px rgba(60, 107, 255, 0.25);
}

.btn-back-to-catalog:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    transform: translateX(-2px);
    box-shadow: var(--shadow-strong);
}

.btn-back-to-catalog:active {
    transform: translateX(-2px) scale(0.98);
}

.btn-buy {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.product-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(92, 139, 255, 0.25);
    border-top: 3px solid var(--accent-strong);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message,
.success-message {
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--radius-md);
    background: rgba(12, 19, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-soft);
}

.error-message {
    color: #ff6b6b;
}

.error-message h3 {
    margin-bottom: 12px;
    font-size: 18px;
    letter-spacing: 0.12em;
}

.error-message p {
    color: var(--text-secondary);
}

.success-message {
    color: #5bd897;
}

.success-message h3 {
    margin-bottom: 12px;
    font-size: 18px;
    letter-spacing: 0.12em;
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    animation: fadeIn 0.3s ease-out;
}

.content-card:nth-child(1) {
    animation-delay: 0.05s;
}

.content-card:nth-child(2) {
    animation-delay: 0.1s;
}

.content-card:nth-child(3) {
    animation-delay: 0.15s;
}

.content-card:nth-child(4) {
    animation-delay: 0.2s;
}

.content-card:nth-child(5) {
    animation-delay: 0.25s;
}

.content-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Ripple effect for buttons */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn,
.control-btn,
.back-btn {
    position: relative;
    overflow: hidden;
}

.btn:active::after,
.control-btn:active::after,
.back-btn:active::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    top: 50%;
    left: 50%;
    animation: ripple 0.6s;
    pointer-events: none;
}

/* Responsive adjustments - Telegram Mini App style */
@media (max-width: 540px) {
    .top-bar {
        padding: 12px 16px;
    }

    .brand-label {
        font-size: 18px;
    }

    .brand-description {
        font-size: 12px;
    }

    .search-container {
        padding: 12px 16px 0;
    }

    .search-meta {
        gap: 8px;
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 10px;
    }

    .content-card .card-inner {
        padding: 16px 12px 12px;
        min-height: 140px;
        gap: 12px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    .section-body {
        padding: 12px;
    }
}

@media (max-width: 400px) {
    .content-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .content-card .card-inner {
        min-height: 120px;
        padding: 14px 12px 12px;
    }

    .bottom-nav {
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        gap: 2px;
    }

    .nav-item {
        padding: 8px 2px;
        font-size: 9px;
        gap: 4px;
    }

    .nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* Support for safe areas on mobile devices */
@supports (padding: max(0px)) {
    .app-container {
        padding-bottom: max(96px, calc(96px + env(safe-area-inset-bottom, 0px)));
    }

    .bottom-nav {
        padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom, 0px)));
    }
}

/* Instruction modal styles */
.instruction-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.instruction-content {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-strong);
}

.instruction-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.instruction-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.instruction-body {
    padding: 20px 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.instruction-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
}

.instruction-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Instruction button styles */
.btn-instruction {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-instruction:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-instruction:active {
    transform: translateY(0);
}

/* Mobile responsive for instruction modal */
@media (max-width: 480px) {
    .instruction-content {
        margin: 10px;
        max-height: 90vh;
    }

    .instruction-header,
    .instruction-body,
    .instruction-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Product Images */
.product-image {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.product-image-placeholder {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* Center content in mini-app - styles moved to main .section-body */

.content-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Fix scrolling for mobile devices */
@media (max-width: 768px) {
    .section-overlay {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    .section-body {
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Ensure products grid is scrollable */
.products-grid {
    min-height: auto;
    overflow: visible;
    width: 100%;
}

/* Product details styles */
.product-details {
    width: 100%;
    max-width: 100%;
}

.product-details-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.product-details-header h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    line-height: 1.3;
    padding-top: 2px;
}

.product-details-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.product-details-image {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.product-details-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.product-details-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-price,
.product-stock {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.product-summary,
.product-description-full,
.product-instruction {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.product-summary h4,
.product-description-full h4,
.product-instruction h4 {
    color: #000000;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-transform: none;
    /* Removed uppercase for elegance */
    letter-spacing: normal;
}

.product-summary p,
.product-description-full p,
.product-instruction p {
    color: #333333;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.product-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* Make product image and description clickable */
.product-image,
.product-image-placeholder,
.product-tile h4,
.product-description {
    cursor: pointer;
    transition: var(--transition);
}

.product-image:hover,
.product-image-placeholder:hover,
.product-tile h4:hover,
.product-description:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Menu Drawer Styles */
.menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 2000;
    pointer-events: none;
}

.menu-drawer.hidden {
    display: none;
}

.menu-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

.menu-drawer.open .menu-drawer-overlay {
    opacity: 1;
}

.menu-drawer-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-primary);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    pointer-events: all;
}

.menu-drawer.open .menu-drawer-content {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.menu-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.menu-item:active {
    background: var(--tg-secondary-bg-color);
}

.menu-item span {
    font-size: 16px;
}

.menu-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-icon:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--tg-bg-color);
    z-index: 1500;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-overlay.open {
    transform: translateY(0);
}

.search-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--tg-bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.search-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--tg-secondary-bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.category-item:active {
    transform: scale(0.98);
    background: var(--border-color);
}

/* Global Button Styles - Monochrome Pill */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 24px;
}

.category-name {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Profile Overlay Styles */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--tg-bg-color);
    z-index: 1500;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-overlay.open {
    transform: translateY(0);
}

.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--tg-bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.profile-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.profile-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--md-surface-container, #f5f6fb);
}
.profile-body .md-screen {
    padding: 0;
}
.profile-body .md-hero-card {
    margin: 0 16px 0;
    border-radius: 20px;
}

.profile-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-header-info {
    text-align: center;
    padding: 20px 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--tg-secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.profile-header-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.profile-username {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.profile-section {
    background: var(--tg-secondary-bg-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.profile-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text-primary);
}

.referral-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.referral-link-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.referral-link-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-copy {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--tg-button-text-color);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.btn-copy:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.referral-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-display {
    text-align: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.balance-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-item strong {
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-item a {
    font-size: 16px;
    color: var(--accent);
    text-decoration: none;
}

.contact-item a:active {
    opacity: 0.7;
}

/* Cart Grid Layout - Плиточное отображение товаров */
.cart-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
}

.cart-item-tile {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.cart-item-tile:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
}

.cart-item-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    overflow: hidden;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

.btn-cart-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    z-index: 10;
}

.btn-cart-remove:active {
    transform: scale(0.9);
    background: rgba(255, 0, 0, 0.8);
}

.cart-item-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.btn-quantity {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-quantity:hover:not(:disabled) {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-quantity:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-quantity:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cart-item-quantity {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 24px;
    text-align: center;
}

.cart-item-total {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0 0 0;
}

/* Cart Summary */
.cart-summary {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

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

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

.balance-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-balance-topup {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

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

.btn-balance-topup:hover {
    background: var(--accent-strong);
    transform: scale(1.05);
}

.cart-total {
    margin-bottom: 16px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 18px;
}

.cart-total-row span {
    color: var(--text-secondary);
}

.cart-total-row strong {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkout-btn {
    font-size: 16px;
    font-weight: 600;
}

/* Balance top-up modal */
.balance-topup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.balance-topup-modal.open {
    opacity: 1;
    pointer-events: all;
}

.balance-topup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.balance-topup-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-strong);
}

.balance-topup-modal.open .balance-topup-content {
    transform: scale(1);
}

/* Specialists */
.specialists-grid-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.specialists-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .specialists-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .specialists-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .specialists-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.specialist-card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.16);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    min-height: 104px;
}

.specialist-card:hover {
    transform: translateY(-2px);
    border-color: rgba(17, 24, 39, 0.22);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.specialist-card:active {
    transform: translateY(0px);
}

.specialist-photo {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid rgba(17, 24, 39, 0.12);
    flex: 0 0 auto;
}

.specialist-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.specialist-text {
    min-width: 0;
}

.specialist-name {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text-primary);
}

.specialist-meta {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.35;
    color: #374151;
}

/* Specialist detail layout */
.specialist-detail-layout {
    display: block;
}

.specialist-detail-photo {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: var(--bg-secondary);
}

.specialist-detail-title {
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-top: 14px;
}

.specialist-detail-subtitle {
    margin-top: 6px;
    font-size: 16px;
    line-height: 1.35;
    color: #374151;
}

@media (min-width: 960px) {
    .specialist-detail-layout {
        display: flex;
        gap: 24px;
        align-items: flex-start;
    }

    .specialist-detail-left {
        flex: 0 0 420px;
    }

    .specialist-detail-photo {
        max-height: 520px;
    }

    .specialist-detail-right {
        flex: 1 1 auto;
        min-width: 0;
    }

    .specialist-detail-title {
        margin-top: 0;
        font-size: 28px;
    }

    .specialist-detail-subtitle {
        font-size: 17px;
    }
}

.balance-topup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.balance-topup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-topup-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.balance-topup-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.balance-topup-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* Delivery form modal */
.delivery-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.delivery-form-modal.open {
    opacity: 1;
    pointer-events: all;
}

.delivery-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.delivery-form-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-strong);
}

.delivery-form-modal.open .delivery-form-content {
    transform: scale(1);
}

.delivery-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.delivery-form-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.delivery-form-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.delivery-form-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.delivery-form-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.delivery-input,
.delivery-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}

.delivery-input:focus,
.delivery-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.delivery-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkout certificate card picker */
.checkout-cert-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.checkout-cert-cards::-webkit-scrollbar {
    display: none;
}

.checkout-cert-card {
    position: relative;
    min-width: 135px;
    flex-shrink: 0;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
}

.checkout-cert-card:active {
    transform: scale(0.97);
}

.checkout-cert-card.selected {
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.checkout-cert-card-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s;
}

.checkout-cert-card.selected .checkout-cert-card-check {
    opacity: 1;
    transform: scale(1);
}

.checkout-cert-card-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.checkout-cert-card-code {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* City autocomplete dropdown (delivery form) */
.city-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    z-index: 20;
    overflow: hidden;
}

.city-suggest-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.city-suggest-item:hover {
    background: var(--bg-secondary);
}

/* Error message styles */
.error-message {
    padding: 24px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.error-message h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 18px;
}

.error-message p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Added styles for product weight badge and improved details */

.product-weight-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.product-weight-badge-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.product-details-header {
    margin-bottom: 16px;
}

/* Improve header visuals */
.product-details-header h2 {
    font-size: 20px;
    line-height: 1.3;
    color: var(--text-primary);
    font-weight: 700;
}

/* Rich Text Content */
.rich-text-content {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
}

.rich-text-content p {
    margin-bottom: 12px;
}

.rich-text-content p:last-child {
    margin-bottom: 0;
}

.rich-text-content b,
.rich-text-content strong {
    font-weight: 600;
}

.rich-text-content i,
.rich-text-content em {
    font-style: italic;
}

.rich-text-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 12px;
}

.rich-text-content ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin-bottom: 12px;
}

.rich-text-content li {
    margin-bottom: 4px;
}

.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}
/* ──────────────────────────────────────────────
   Material Design 3 — unified tokens + components
   Used across Balance, Reviews, About, Contacts sections
   ────────────────────────────────────────────── */
:root {
    --md-primary: #1a1a2e;
    --md-on-primary: #ffffff;
    --md-primary-container: #e8eaf6;
    --md-on-primary-container: #1a1a2e;
    --md-surface: #ffffff;
    --md-surface-container: #f5f6fb;
    --md-surface-container-high: #ececf3;
    --md-outline: rgba(26, 26, 46, 0.12);
    --md-outline-variant: rgba(26, 26, 46, 0.08);
    --md-on-surface: #1a1a2e;
    --md-on-surface-variant: #5b5d6b;
    --md-success: #15803d;
    --md-error: #b3261e;
}

.md-screen {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hero card (filled elevated) */
.md-hero-card {
    background: var(--md-primary);
    color: var(--md-on-primary);
    border-radius: 28px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.md-hero-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}
.md-hero-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}
.md-hero-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
    line-height: 1;
}
.md-hero-number {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.md-hero-unit {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.65;
}
.md-hero-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

/* Action row */
.md-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* MD3 Button base */
.md-btn {
    height: 48px;
    border-radius: 24px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    transition: box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.md-btn:active {
    transform: scale(0.98);
}
.md-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.md-btn-block {
    width: 100%;
}
.md-btn-filled {
    background: var(--md-primary);
    color: var(--md-on-primary);
}
.md-btn-filled:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.md-btn-tonal {
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
}
.md-btn-outline {
    background: transparent;
    color: var(--md-primary);
    border: 1px solid var(--md-outline);
}
.md-btn-ico {
    width: 18px;
    height: 18px;
}

/* MD3 Card */
.md-card {
    background: var(--md-surface);
    border: 1px solid var(--md-outline);
    border-radius: 20px;
    overflow: hidden;
}
.md-card-title {
    padding: 16px 20px 0 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--md-on-surface);
    letter-spacing: -0.01em;
}
.md-card-body {
    padding: 12px 20px 20px 20px;
    color: var(--md-on-surface-variant);
    font-size: 14px;
    line-height: 1.55;
}

/* MD3 Form fields */
.md-field {
    display: block;
    margin-bottom: 16px;
}
.md-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--md-on-surface-variant);
    margin-bottom: 6px;
}
.md-field-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 12px;
    border: 1px solid var(--md-outline);
    background: var(--md-surface);
    color: var(--md-on-surface);
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.md-field-input:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}
.md-field-file .md-field-input {
    height: auto;
    padding: 12px 16px;
}
.md-status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--md-on-surface-variant);
    text-align: center;
    min-height: 16px;
}

/* MD3 List */
.md-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.md-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--md-outline-variant);
    min-height: 56px;
}
.md-list-item:last-child {
    border-bottom: 0;
}
.md-list-leading {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--md-surface-container);
    color: var(--md-on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-list-content {
    flex: 1;
    min-width: 0;
}
.md-list-headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--md-on-surface);
    line-height: 1.3;
}
.md-list-supporting {
    font-size: 13px;
    color: var(--md-on-surface-variant);
    margin-top: 2px;
    line-height: 1.4;
}
.md-list-trailing {
    flex-shrink: 0;
    color: var(--md-on-surface-variant);
}
