.responsive-normalize {
    /* helper marker class - not applied by default; CSS normalization rules follow */
}

/* Final Safari/WebKit override placed at file end to beat earlier rules */
@supports (-webkit-touch-callout: none) {
    body.smart-climat #search-button.search-button {
        width: 24px !important;
        height: 24px !important;
        padding: 3px !important;
        border-radius: 6px !important;
    }
    body.smart-climat #search-button.search-button .nav-icon,
    body.smart-climat #search-button.search-button svg {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    @media (max-width: 768px) {
        body.smart-climat #search-button.search-button { width: 22px !important; height: 22px !important; padding: 2px !important; }
    }
    @media (max-width: 480px) {
        body.smart-climat #search-button.search-button { width: 20px !important; height: 20px !important; padding: 2px !important; }
    }
}

/* Global normalization to improve consistent rendering across mobile devices */
html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px; /* consistent root font-size */
    height: 100%;
}
*, *::before, *::after { box-sizing: inherit; }
body {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    text-rendering: optimizeLegibility;
    -webkit-touch-callout: none;
    height: 100%;
    background-color: #111 !important;
}
img, picture, video, svg { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; }

/* Ensure consistent viewport fit for devices with notch/safe-area insets */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* Minor touch optimizations */
button, a { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* End normalization */

/* Safe-area variables and defaults */
:root {
    --header-h: 56px;
    --footer-h: 56px;
}

/* Reserve space for fixed header/footer using safe-area insets */
main {
    padding-top: calc(var(--header-h) + env(safe-area-inset-top));
    padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));
}

/* Use --vh for mobile full-height elements */
.page-full { min-height: calc(var(--vh, 1vh) * 100); }


/* Анимация ухода влево при открытии нового контента (slide-out-left) */
.slide-out-left {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 2s cubic-bezier(0.22,0.9,0.27,1), opacity 1.7s cubic-bezier(0.22,0.9,0.27,1);
}

/* Strong override: force deals icon 48×48 (placed at file end to win over other !important rules) */
.deals-badge .deals-icon,
.deals-link .deals-icon,
.brands .deals-icon,
.header .deals-icon,
.site-logo .deals-icon {
    width: 48px !important;
    height: 48px !important;
}
.deals-badge .deals-icon svg,
.deals-link .deals-icon svg,
.brands .deals-icon svg,
.header .deals-icon svg,
.site-logo .deals-icon svg {
    width: 100% !important;
    height: 100% !important;
}

/* Home-specific: match brand-badge sizes so 'Знижки' frame equals nearby frames */
#home .deals-badge {
    display: inline-flex !important;
    flex-direction: column !important; /* icon on top, text below */
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 192px !important;  /* doubled from 96 */
    height: 192px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    font-size: 28px !important;
    line-height: 1 !important;
    text-align: center !important;
    border-radius: 8px !important;
}
# Remove underline/line under the 'Знижки' label and ensure no border-bottom
.deals-badge, .deals-badge .deals-label {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Stronger specificity to avoid any underline on Home grid deals badge (including hover/active) */
#home .home-grid .deals-badge,
#home .home-grid .deals-badge:hover,
#home .home-grid .deals-badge:active,
#home .home-grid .deals-badge .deals-label {
    text-decoration: none !important;
    border-bottom: none !important;
}
#home .deals-badge .deals-icon {
    width: 96px !important;
    height: 96px !important;
    display: block !important;
}
#home .deals-badge .deals-icon svg {
    width: 100% !important;
    height: 100% !important;
}

@media (min-width: 992px) {
    /* match .brand-badge at medium/desktop (doubled) */
    #home .deals-badge { width: 240px !important; height: 240px !important; font-size: 32px !important; }
    #home .deals-badge .deals-icon { width: 120px !important; height: 120px !important; }
}

@media (min-width: 1400px) {
    /* match .brand-badge at large desktop (doubled) */
    #home .deals-badge { width: 280px !important; height: 280px !important; font-size: 36px !important; }
    #home .deals-badge .deals-icon { width: 144px !important; height: 144px !important; }
}

/* Final override: if brand badges are enlarged in final rule, keep deals badge in parity */
@media (min-width: 992px) {
    .brand-badge { /* ensure parity if brand-badge override exists */ }
    .showcases .deals-badge, #home .deals-badge { width: 280px !important; height: 280px !important; }
    .showcases .deals-badge .deals-icon, #home .deals-badge .deals-icon { width: 144px !important; height: 144px !important; }
}

/* Grid for Home badges: 2x2 */
#home .home-grid {
    display: grid !important;
    grid-template-columns: repeat(2, auto) !important;
    gap: 18px !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Center wrapper for the Home grid: vertically center the grid
   so top and bottom spacing around the grid are equal. */
#home .home-grid-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    box-sizing: border-box;
    /* Reserve space for header + bottom nav; center remaining area */
    min-height: calc(100vh - 160px) !important;
}

/* When Smart Climat is active, nudge the home grid (deals + brand badges)
   slightly lower so the header and fixed search don't overlap visually. */
body.smart-climat #home .home-grid-container,
body.smart-climat .home-grid-container {
    margin-top: 28px !important;
    padding-top: 6px !important;
}

@media (max-width: 768px) {
    /* on smaller screens reserve slightly more space for fixed bars */
    #home .home-grid-container { min-height: calc(100vh - 200px) !important; }
}

@media (max-width: 480px) {
    #home .home-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    #home .deals-badge, #home .brand-badge { width: 144px !important; height: 144px !important; }
}

/* Also ensure mobile/tablet breakpoint (<=768px) uses doubled sizes */
@media (max-width: 768px) {
    #home .deals-badge, #home .brand-badge { width: 144px !important; height: 144px !important; }
    #home .deals-badge .deals-icon, #home .brand-badge .brand-mini-logo { width: 96px !important; height: 96px !important; }
}

/* Make the 'Знижки' label smaller on mobile for better fit */
@media (max-width: 480px) {
    #home .deals-badge .deals-label { font-size: 11px !important; }
}

@media (max-width: 768px) and (min-width: 481px) {
    #home .deals-badge .deals-label { font-size: 14px !important; }
}

/* Force deals icon to 48x48 everywhere (user request) */
.deals-icon {
    width: 48px !important;
    height: 48px !important;
}
.deals-icon img,
.deals-icon svg {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}
.slide-out-left-active {
    transform: translateX(-60vw);
    opacity: 0;
    pointer-events: none;
    transition: transform 2s cubic-bezier(0.22,0.9,0.27,1), opacity 1.7s cubic-bezier(0.22,0.9,0.27,1);
}
/* Анимация ухода вправо при закрытии (slide-out) */
.slide-out-right {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 1s cubic-bezier(0.22,0.9,0.27,1), opacity 1s cubic-bezier(0.22,0.9,0.27,1);
}
.slide-out-right-active {
    transform: translateX(60vw);
    opacity: 0;
    pointer-events: none;
    transition: transform 1s cubic-bezier(0.22,0.9,0.27,1), opacity 1s cubic-bezier(0.22,0.9,0.27,1);
}
/* Анимация появления раздела/элемента справа (выход из правой стороны) */
.slide-in-right {
    transform: translateX(-60vw);
    opacity: 0;
    pointer-events: none;
    transition: transform 1s cubic-bezier(0.22,0.9,0.27,1), opacity 1s cubic-bezier(0.22,0.9,0.27,1);
}
.slide-in-right-active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 1s cubic-bezier(0.22,0.9,0.27,1), opacity 1s cubic-bezier(0.22,0.9,0.27,1);
}
/* Page transition snapshot and enter/exit classes */
.pages { position: relative; }
.page { position: relative; width: 100%; box-sizing: border-box; }

/* Snapshot element that sits above new content during animation */
.page-snapshot {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1500;
    background: inherit;
    transition: transform 360ms cubic-bezier(0.22,0.9,0.27,1);
    will-change: transform;
    overflow: auto;
}
.page-snapshot.exit-left { transform: translateX(-100%); }
.page-snapshot.exit-right { transform: translateX(100%); }

/* New content enters from right */
.enter-from-right { animation: slideInFromRight 360ms cubic-bezier(0.22,0.9,0.27,1) both; }
@keyframes slideInFromRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Optional: new content enters from left for back-navigations */
.enter-from-left { animation: slideInFromLeft 360ms cubic-bezier(0.22,0.9,0.27,1) both; }
@keyframes slideInFromLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Utility: disable all transitions/animations while navigating back */
.disable-page-transitions *,
.disable-page-transitions *::before,
.disable-page-transitions *::after {
    transition: none !important;
    animation: none !important;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: rgba(51, 51, 51, 0.55); /* semi-transparent */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 0;
    position: fixed;
    top: env(safe-area-inset-top);
    width: 100%;
    z-index: 1000;
}

header .container {
    display: flex;
.search-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: absolute;
    left: 58%;
    transform: translate(-50%, -40%);
    margin-left: 0;
    margin-right: 0;
    background: none;
    z-index: 2;
}
    align-items: center;
    position: relative;
}

/* Make the search group fixed and always visible only on Smart Climat section */
body.smart-climat .search-group {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1100 !important;
    width: min(760px, calc(100% - 60px)) !important;
    padding: 6px 12px !important;
    display: flex !important;
    align-items: center !important;
    background: rgba(255,255,255,0.03) !important;
    border: 1.5px solid rgba(255,255,255,0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.02) !important;
    /* Prevent any animation/transform during navigation so it stays fixed */
    transition: none !important;
    will-change: auto !important;
    transform: translateX(-50%) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    backdrop-filter: blur(6px) !important;
}

body.smart-climat .search-group #search {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
}

@media (max-width: 480px) {
    body.smart-climat .search-group {
        top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
        width: calc(100% - 32px) !important;
        padding: 6px 10px !important;
        border-radius: 10px !important;
        background: rgba(255,255,255,0.03) !important;
        border: 1.25px solid rgba(255,255,255,0.12) !important;
        box-shadow: 0 6px 16px rgba(0,0,0,0.14) !important;
    }
    body.smart-climat .search-group #search {
        height: 36px !important;
        padding: 0 12px 0 44px !important;
        border-radius: 14px !important;
        border: 0 !important;
        background-color: transparent !important;
        font-size: 16px !important; /* ensure iOS doesn't auto-zoom on focus */
    }
}

/* Prevent mobile browsers from zooming input: keep font >=16px and disable text-size-adjust */
body.smart-climat .search-group #search,
input[type="search"] {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
}
body.smart-climat .search-group #search:focus,
input[type="search"]:focus {
    font-size: 16px !important;
}

/* Hide the 'Знижки' label when in Dashboard or Profile (body.no-icons), keep it on Home */
body.no-icons .deals-label {
    display: none !important;
}

.header-section-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    z-index: 2;
    max-width: calc(100% - 160px); /* leave space for back/logo/controls */
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-align: center;
}

/* Entry gate styles */
.gate-box {
    max-width: 420px;
    margin: 80px auto;
    background: rgba(0,0,0,0.28);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
}
/* Emphasize gate prompt */
.gate-box .gate-prompt {
    font-size: 20px;
    font-weight: 700;
    color: #bfefff; /* light blue accent */
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
    margin: 0 0 12px 0;
    display: block;
    border-radius: 2px;
}
/* Make the highlighted password-like token look distinct */
.gate-box .gate-password {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff; /* white text */
    background: rgba(12,24,36,0.28); /* even more transparent dark token */
    border: 1px solid rgba(255,255,255,0.02);
    padding: 6px 10px;
    border-radius: 8px;
    margin: 0 6px;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.12);
    letter-spacing: 0.6px;
}
.gate-box .gate-password .lock-icon { color: #9adff0; width: 16px; height: 16px; flex: 0 0 16px; }
.gate-box .gate-password .gate-password-text { color: #cdeef6; font-size: 20px; }
.gate-box .gate-password .copy-icon { color: #9adff0; width: 16px; height: 16px; flex: 0 0 16px; cursor: pointer; transition: transform 120ms ease, color 120ms ease; }
.gate-box .gate-password .copy-icon:hover { transform: translateY(-1px); color: #e6fbff; }
.gate-box .gate-password .gate-password-text { white-space: nowrap; }
@media (max-width: 480px) {
    .gate-box .gate-password { font-size: 15px; padding: 4px 8px; }
    .gate-box .gate-password .gate-password-text { font-size: 18px; }
    .gate-box .gate-password .lock-icon { width: 14px; height: 14px; }
}
@media (max-width: 480px) {
    .gate-box .gate-prompt { font-size: 18px; }
}
.gate-box h2 { margin: 0 0 8px 0; font-size: 20px; }
.gate-box input { width: 100%; padding: 10px 12px; border-radius:6px; border:1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); color:#fff; }
.gate-box button { margin-top:8px; padding:10px 14px; border-radius:6px; background:rgba(255,255,255,0.06); color:#fff; border:1px solid rgba(255,255,255,0.08); cursor:pointer; }
.gate-error { margin-top:8px; color:#ffb3b3; font-size:13px; }
/* success state for gate messages (green) */
.gate-error.success { color: #6bd36b !important; }

/* Make gate responsive on small screens */
@media (max-width: 480px) {
    .gate-box { margin: 40px 12px; padding:16px; }
}

/* Ensure header link inherits site color and has no underline */
.header-section-title a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
.header-section-title a:hover {
    text-decoration: none;
}

@media (max-width: 480px) {
    /* Make header section title smaller on small screens (showcase/viewer titles) */
    .header-section-title {
        /* allow wrapping and smaller font on narrow viewports */
        white-space: normal !important;
        font-size: 14px !important;
        line-height: 1.2;
        max-width: calc(100% - 80px) !important;
        padding: 0 6px;
        word-break: break-word;
    }
}

/* Ensure header link inherits site color and doesn't overflow */
.header-section-title a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
}

/* Final strong override: use a single background image for `main` in all sections
   and prevent any scripts or other rules from changing size/position. */
body { background-image: none !important; }
main {
    background-image: url('images/photo_2026-01-28_13-31-34.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Ensure snapshot overlay still sees same background when cloned */
.page-snapshot { background-size: cover !important; background-position: center !important; }
/* Order confirmation styles */
.order-confirmation {
    position: fixed;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    z-index: 2200;
    display: none;
    pointer-events: none;
}
.order-confirmation[aria-hidden="false"] { display: block; pointer-events: auto; }
.order-confirmation__inner {
    min-width: 280px;
    max-width: 92vw;
    background: rgba(17,17,17,0.95);
    color: #fff;
    border-radius: 12px;
    padding: 18px 18px 14px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    text-align: center;
}
.order-confirmation__title {
    font-size: 12px;
    opacity: 0.75;
    margin-bottom: 8px;
}
.order-confirmation__message {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}
.order-confirmation__close {
    background: transparent;
    color: #bcdcff;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}
.order-confirmation__close:active { transform: translateY(1px); }
/* Hide homepage icons when entering profile (override) */
.no-icons .brand-badges,
.no-icons .brands,
.no-icons .showcases,
.no-icons .brand-badge {
    display: none !important;
}
/* Also hide deals elements when in profile */
.no-icons .deals-badge,
.no-icons .deals-link,
.no-icons .deals-icon {
    display: none !important;
}
/* Responsive adjustments */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .nav-icon { width: 24px; height: 24px; }
    .brands { gap: 16px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 28px; }
    .showcases { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 28px; }
    .product { padding: 6px; }
    .product img { height: 90px; }
    .showcase-item img,
    .showcase-item.showcase-full img { height: 80px; }
    .brand-badges { gap: 12px; }
    .brand-badge { font-size: 15px; padding: 5px 10px; max-width: 240px; }
    .brand-icon { width: 24px; height: 24px; }
    .deals-icon { width: 24px; height: 24px; }
    #bottom-nav { height: 56px; }
    #bottom-nav ul li a, #bottom-nav ul li button { height: 56px; font-size: 26px; }
    .nav-icon { width: 28px; height: 28px; }

    /* Mobile: увеличиваем высоту поля поиска и кнопки */
    #search {
        height: 36px;
        padding: 0 12px 0 44px;
        border-radius: 14px;
        border: 4px solid rgba(255,255,255,0.60);
        background-color: rgba(255,255,255,0.14);
        font-size: 16px;
    }
    #search-button.search-button {
        left: 14px;
        height: 36px;
        width: 36px;
        border-radius: 12px;
    }
    #search-button .nav-icon { width: 22px; height: 22px; }

    /* Prevent mobile zoom when focusing order form inputs (keep font-size >=16px) */
    #order-form input,
    #order-form textarea,
    #order-form select,
    #order-form button {
        font-size: 16px;
        line-height: 1.2;
    }

    /* Mobile: remove faint white tile behind showcases so image defines size (like desktop) */
    .showcase-item,
    .showcase-item.showcase-full {
        background: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }
    .showcase-item img,
    .showcase-item.showcase-full img {
        height: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        display: block !important;
        border-radius: 0 !important;
    }
}

/* Ensure header size in Profile/Dashboard matches global header size */
body.no-icons header {
    padding: 10px 0 !important;
    height: calc(var(--header-h) + env(safe-area-inset-top)) !important;
}
body.no-icons .header-section-title {
    font-size: 26px !important;
    line-height: 1 !important;
}
/* Center header title when in Profile/Dashboard (use fixed positioning to ensure exact centering) */
body.no-icons .header-section-title {
    position: fixed !important;
    left: 50% !important;
    top: calc(env(safe-area-inset-top, 0px) + (var(--header-h, 56px) / 2)) !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1101 !important;
    max-width: calc(100% - 160px) !important;
}

@media (min-width: 992px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
    .showcases { grid-template-columns: repeat(auto-fill, 350px); justify-content: center; gap: 48px; }
    .product { padding: 14px; }
    .product img { height: 180px; }
    .showcase-item,
    .showcase-item.showcase-full {
        width: 350px;
        height: 500px;
        box-sizing: border-box;
    }
    .showcase-item img,
    .showcase-item.showcase-full img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }
    .brand-badges { gap: 20px; }
    .brand-badge { font-size: 18px; padding: 8px 14px; width: 120px; height: 120px; }
    .brand-icon { width: 60px; height: 60px; }
    .deals-icon { width: 60px; height: 60px; border-radius: 6px; }
}

@media (min-width: 1400px) {
    .container { max-width: 1400px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; }
    .product img { height: 220px; }
    .showcase-item img,
    .showcase-item.showcase-full img { height: 240px; }
    .brand-badge { width: 140px; height: 140px; font-size: 20px; }
    .brand-icon { width: 72px; height: 72px; }
    .deals-icon { width: 72px; height: 72px; border-radius: 6px; }
}
    position: relative; /* allow absolute centering of header-right */
}

/* Right side of header: stack brands above search */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

@media (max-width: 768px) {
    .header-right { gap: 8px; }
    .site-logo img { height: 34px; }
}

/* Site logo in header */
.site-logo {
    display: flex;
    align-items: center;
    margin-right: 10px;
}
.site-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* Back button icon in header */
.back-button {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    margin-right: 12px;
    margin-left: 12px;
    position: relative;
    z-index: 1101;
    opacity: 0.95;
}
.back-button:hover { opacity: 1; }

/* Brands list in header */
.brands {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    margin-left: 0;
}
.brand-link,
.deals-link,
#logo-link {
    color: white;
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    opacity: 0.95;
}
.brand-link:hover,
.deals-link:hover,
#logo-link:hover {
    text-decoration: underline;
}
#bottom-nav a.active,
.brands .brand-link.active,
.brands .deals-link.active {
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.35) inset;
    padding: 2px 8px;
}

/* cursor for clickable logo */
#logo-link {
    cursor: pointer;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

/* ensure nav items (links/buttons) are full-height flex centers */
nav ul li a,
nav ul li button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    color: white;
    background: none;
    border: none;
}

main {
    /* Add extra bottom padding so bottom nav doesn't overlap last tiles */
    padding: 80px 0 80px 0;
    background-image: url('images/photo_2026-01-28_13-31-34.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    color: #f5f5f5;
    min-height: 100vh; /* ensure background covers full viewport */
    box-sizing: border-box;
}

/* Dark overlay for better text readability over background image */
main::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
}

main .container {
    position: relative;
    z-index: 1;
}

/* Showcases grid for brand pages */
.showcases {
    display: grid;
    /* Match product card min width (same as .products-grid min-width 250px) */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 20px 0 28px 0;
    align-items: start;
}
.showcase-item {
    display: block;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    overflow: hidden;
    padding: 0; /* remove padding so image can fill tile */
    box-sizing: border-box;
}
.showcase-item img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    display: block;
    border-radius: 0; /* let image reach tile edges */
}

/* For showcases that should be fully filled (no label/padding) */
.showcase-item.showcase-full {
    background: rgba(255,255,255,0.02);
}
.showcase-item.showcase-full img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    display: block;
}

/* Ensure specific image fits same as product cards in showcases */
.showcase-item img[src$="photo_2026-01-28_16-13-34.jpg"] {
    /* ensure this specific photo shows fully */
    object-fit: contain;
}
.showcase-item span {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    font-size: 14px;
}

/* Search/return highlight styling removed to prevent flash during navigation */
.showcase-item.search-highlight,
.product-image-only.search-highlight,
.product.search-highlight,
.showcase-item.return-highlight,
.product-image-only.return-highlight,
.product.return-highlight {
    outline: none !important;
    box-shadow: none !important;
    border-radius: inherit !important;
    animation: none !important;
}

@keyframes returnPulse {
    0% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 22px rgba(255, 255, 255, 0.75); }
    100% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.4); }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.product {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    text-align: center;
}

.product img {
    width: 100%;
    height: 100px;
    object-fit: contain;
}

/* Image-only product (no white frame) */
.product-image-only {
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
}
.product-image-only img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 130px;
    border-radius: 4px;
    display: block;
}

/* Deals badge shown in Home section title */
.deals-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
}
.deals-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    border-radius: 6px;
}
.deals-icon img,
.deals-icon svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
}

/* Brand badges row on Home */
.brand-badges {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px 0;
}
.brand-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    width: 96px;
    height: 96px;
    box-sizing: border-box;
    text-align: center;
}
.brand-icon {
    width: 48px;
    height: 48px;
    display: inline-block;
    color: #fff;
}
.brand-mini-logo {
    width: 48px;
    height: 48px;
    display: inline-block;
    object-fit: contain;
    border-radius: 6px;
}
.brand-badge:hover { background: rgba(255, 255, 255, 0.14); }

/* Featured CH product: inherit image auto sizing (no fixed height) */
.product-image-only.ch-featured-350 img { height: auto; object-fit: contain; }

.product h3 {
    margin: 10px 0;
}

.product p {
    margin: 5px 0;
}

.product button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.product button:hover {
    background-color: #218838;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
}

#bottom-nav {
    position: fixed;
    left: 0;
    bottom: env(safe-area-inset-bottom);
    width: 100%;
    background-color: rgba(51, 51, 51, 0.55); /* semi-transparent */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: white;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    height: 28px;
    display: flex;
    align-items: center;
}

#bottom-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    height: 100%;
    align-items: center;
}

#bottom-nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    display: inline-block;
    height: 28px;
}

#bottom-nav ul li button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 22px;
    display: inline-block;
    height: 28px;
}

/* Уменьшенный размер для счётчика корзины */
#cart-button {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -4px;
    right: -3px;
    font-size: 10px;
    line-height: 1;
    background: #ff4d4f;
    color: #fff;
    border-radius: 9px;
    padding: 1px 4px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* (removed .three-lines - replaced by SVG nav-icon) */

/* Instagram-like SVG icon sizing and color */
.nav-icon {
    width: 28px;
    height: 28px;
    display: block;
    color: white; /* stroke uses currentColor */
}

/* Make back button icon slightly larger than other nav icons */
.back-button .nav-icon {
    width: 34px !important;
    height: 34px !important;
}
.back-button.hide-back-icon .nav-icon { display: none !important; }
.nav-icon rect,
.nav-icon circle {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Search input: add a slightly darker search icon */
#search {
    height: 32px;
    padding: 0 32px 0 44px;
    border-radius: 14px;
    border: 3px solid rgba(255,255,255,0.55);
    background-color: rgba(255,255,255,0.14);
    color: #ffffff;
    font-size: 16px;
    min-width: 220px;
    width: 260px;
    max-width: 340px;
    transition: width 0.2s, height 0.2s;
}

/* Hide built-in WebKit search decorations (prevents duplicate icons in Safari) */
input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none !important;
    -webkit-appearance: none !important;
}

/* Safari / WebKit specific tweaks: enlarge custom search icon and button on iOS/Safari */
@supports (-webkit-touch-callout: none) {
    /* larger sizes for Safari/iOS where icons render small */
    /* halved sizes per user request (Safari only) */
    /* force svg to fill button area in WebKit/Safari */
    #search-button.search-button { width: 24px !important; height: 24px !important; padding: 3px !important; }
    #search-button.search-button .nav-icon { width: 100% !important; height: 100% !important; }
    #search-button.search-button svg { width: 100% !important; height: 100% !important; }
    @media (max-width: 768px) {
        #search-button.search-button { width: 22px !important; height: 22px !important; padding: 2px !important; }
        #search-button.search-button .nav-icon { width: 100% !important; height: 100% !important; }
    }
    @media (max-width: 480px) {
        #search-button.search-button { width: 20px !important; height: 20px !important; padding: 2px !important; }
        #search-button.search-button .nav-icon { width: 100% !important; height: 100% !important; }
    }
}

/* Strong universal override to ensure SVG fills button area */
#search-button.search-button svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

#search-button.search-button {
    height: 36px;
    width: 36px;
    border-radius: 14px;
}
.search-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#search-button.search-button {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    height: 26px;
    width: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    z-index: 2;
}

/* Slightly larger search icon */
#search-button .nav-icon {
    width: 22px;
    height: 22px;
}

#search-button.search-button:hover {
    background: rgba(255,255,255,0.16);
}

#search-button.search-button {
    /* no visible frame: transparent background, no border or shadow */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
#search-button.search-button:active { transform: translateY(1px) scale(0.995); }
#search-button.search-button:focus { outline: 2px solid rgba(255,255,255,0.12); outline-offset: 2px; }
#search-button.search-button .nav-icon { display:block; }

#search::placeholder {
    color: rgba(255,255,255,0.78);
}

/* Ensure Home search sits higher and respects requested left offset */
#home .search-group {
    position: relative;
    top: -10px; /* keep same vertical offset */
    left: 50%;
    transform: translateX(-50%); /* center horizontally */
    margin-left: 0 !important;
    z-index: 3; /* above main::before overlay */
}

/* Increase search input length by ~50px on Home */
#home #search {
    width: 380px !important; /* increased by additional 70px (310 -> 380) */
    min-width: 320px !important;
    max-width: 460px !important;
}

#search:focus {
    outline: none;
    border-color: rgba(255,255,255,0.70);
    background-color: rgba(255,255,255,0.14);
}

/* distribute items evenly: left, center, right */
#bottom-nav ul li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bottom-nav ul li:first-child { justify-content: flex-start; padding-left: 12px; }
#bottom-nav ul li:nth-child(2) { justify-content: center; }
#bottom-nav ul li:last-child { justify-content: flex-end; padding-right: 27px; }

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#cart-items {
    margin: 20px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#checkout-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

#checkout-button:hover {
    background-color: #0056b3;
}

/* duplicate bottom-nav rule removed */

/* Close button styling for order modal */
.order-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.order-close:hover,
.order-close:focus {
    color: black;
    text-decoration: none;
}

/* Simple form styling inside modal */
#order-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}
#order-form input[type="text"],
#order-form input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    background-color: rgba(255,255,255,0.14); /* напівпрозорий світлий фон */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
}
#order-modal input::placeholder {
    color: rgba(255,255,255,0.75);
}
#order-modal input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.55);
    background-color: rgba(255,255,255,0.18);
}
#/\* Prevent mobile zoom on order inputs \*/
#order-modal input,
#order-modal textarea,
#order-modal select {
    font-size: 16px; /* iOS Safari zooms inputs with font-size < 16px */
    -webkit-text-size-adjust: 100%;
}
#order-submit {
    background: rgba(51, 51, 51, 0.55); /* мутно прозора */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
}
#order-submit:hover {
    background: rgba(51, 51, 51, 0.70);
}

/* Mutno transparent (blurred) order modal content */
#order-modal .modal-content {
    background-color: rgba(51, 51, 51, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
}

#order-modal label { color: #fff; }
#order-modal .order-close { color: #fff; }
#order-modal .order-close:hover, 
#order-modal .order-close:focus { color: #fff; opacity: 0.85; }

/* Floating order button shown on image viewer */
#order-fab {
    position: fixed;
    left: 50%;
    bottom: 44px; /* sit above bottom nav */
    transform: translateX(-50%);
    z-index: 1500;
    display: none; /* toggled by JS */
}

/* Title overlay above image in viewer */
.image-title-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    color: #fff;
    background: rgba(51, 51, 51, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    max-width: 90%;
    text-align: center;
    white-space: normal;
    z-index: 2;
}
.image-title-overlay span {
    display: inline-block;
    font-size: 14px;
    line-height: 1.3;
}

/* Profile action icon (like the floating order button but inline in profile) */
.profile-action { text-align: center; margin-bottom: 12px; }
.profile-action-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(51,51,51,0.65);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.profile-action-icon:hover { background: rgba(51,51,51,0.8); }
.profile-action-icon svg { width: 18px; height: 18px; }

/* Unified icon/button style used across sections (make profile icons match) */
.unified-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(51,51,51,0.65);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.unified-icon:hover { background: rgba(51,51,51,0.8); }
.unified-icon svg { width: 18px; height: 18px; }

/* Profile inputs: semi-transparent blurred background to match site style */
.profile-input {
    width: 76%;
    max-width: 360px;
    display: block;
    margin: 0 auto 8px;
    padding: 8px;
    font-size: 16px; /* prevent mobile zoom on focus */
    -webkit-text-size-adjust: 100%;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    box-sizing: border-box;
}
.profile-input::placeholder { color: rgba(255,255,255,0.84); }
.profile-input:focus { outline: none; border-color: rgba(255,255,255,0.36); background: rgba(255,255,255,0.14); }

#order-fab a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(51, 51, 51, 0.55); /* мутно прозора */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

#order-fab a:hover {
    background: rgba(51, 51, 51, 0.70);
}

#order-fab svg {
    width: 20px;
    height: 20px;
}

/* Suggestions dropdown below header search */
.search-suggestions {
    position: fixed; /* positioned via JS under the input */
    z-index: 2000;
    min-width: 240px;
    max-width: 420px;
    background: rgba(51, 51, 51, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    /* Allow vertical scrolling when many suggestions; increase visible height */
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive adjustments for phones */
@media (max-width: 768px) {
    header .container { padding: 0 12px; }
    .container { padding: 0 12px; }

    .back-button { margin-left: 0; }

    .brands {
        gap: 18px;
        margin-left: 0;
        justify-content: center;
    }
    .brand-link, .deals-link, #logo-link { font-size: 20px; font-weight: 700; }

    #search { height: 22px; padding-left: 40px; font-size: 16px; }
    #search-button.search-button { height: 28px; width: 28px; }
    #search-button .nav-icon { width: 22px; height: 22px; }

    /* Show full images without cropping on phones */
    .showcase-item img,
    .showcase-item.showcase-full img,
    .product-image-only img,
    .product-image-only.ch-featured-350 img {
        height: auto;
        max-height: 65vh;
        object-fit: contain;

    /* Ensure images show a white background behind contained images (prevents dark strips showing through) */
    .product img,
    .showcase-item img,
    .product-image-only img {
        background-color: #fff;
        display: block;
    }
        width: 100%;
    }
    /* Use stable viewport height on supported mobile browsers to prevent resize on scroll */
    @supports (height: 100svh) {
        .showcase-item img,
        .showcase-item.showcase-full img,
        .product-image-only img,
        .product-image-only.ch-featured-350 img {
            max-height: 65svh;
        }
    }

    /* One column layout to avoid horizontal scroll and clipping */
    .showcases { grid-template-columns: 1fr; gap: 12px; margin: 12px 0 20px 0; }
    .products-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Avoid solid black tiles for full showcases on mobile */
    .showcase-item.showcase-full { background: rgba(255,255,255,0.02); }

    /* Bottom nav slightly smaller for touch */
    #bottom-nav { height: 48px; }
    #bottom-nav ul li a, #bottom-nav ul li button { height: 48px; font-size: 24px; }
    .nav-icon { width: 24px; height: 24px; }

    /* Ensure content isn't hidden behind fixed bars */
    main { padding: 76px 0 96px 0; }
    #order-fab { bottom: 72px; }

    /* Search suggestions fit viewport */
    .search-suggestions { max-width: 92vw; min-width: 220px; }
}

/* Desktop: when Smart Climat is active, add top padding so fixed search doesn't cover content */
@media (min-width: 769px) {
    body.smart-climat main {
        /* header (56px) + search-group vertical space (~56px) + small gap */
        padding-top: calc(env(safe-area-inset-top, 0px) + 56px + 56px + 12px) !important;
    }
}

@media (max-width: 420px) {
    .brand-link, .deals-link, #logo-link { font-size: 15px; }
    .brands { gap: 14px; }
    .showcase-item img,
    .showcase-item.showcase-full img,
    .product-image-only img,
    .product-image-only.ch-featured-350 img {
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }
    @supports (height: 100svh) {
        .showcase-item img,
        .showcase-item.showcase-full img,
        .product-image-only img,
        .product-image-only.ch-featured-350 img {
            max-height: 60svh;
        }
    }
    .image-title-overlay { top: 8px; padding: 6px 10px; }
}

/* Mobile-specific: slightly reduce showcase size to fit better on small screens */
@media (max-width: 768px) {
    .showcase-item img,
    .showcase-item.showcase-full img {
        max-height: 48vh !important;
        height: auto !important;
        object-fit: contain !important;
    }
    .showcase-item,
    .showcase-item.showcase-full {
        height: auto !important;
        padding: 6px !important;
    }
    .showcases { gap: 10px !important; }
}

@media (max-width: 420px) {
    .showcase-item img,
    .showcase-item.showcase-full img {
        max-height: 40vh !important;
    }
    .showcases { gap: 8px !important; }
}

.search-suggestions .item {
    display: block;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.search-suggestions .item:hover,
.search-suggestions .item.active {
    background: rgba(255,255,255,0.12);
}

.search-suggestions .label {
    font-weight: 600;
}
.search-suggestions .meta {
    opacity: 0.75;
    margin-left: 6px;
}

/* Additional mobile density tweaks: slightly reduce sizes for small viewports */
@media (max-width: 480px) {
    .product { padding: 2px !important; }
    .product img { height: 60px !important; }
    .product h3 { font-size: 13px !important; }
    .product p { font-size: 12px !important; }

    .brand-badge { width: 72px !important; height: 72px !important; font-size: 12px !important; }
    .brand-icon, .brand-mini-logo { width: 36px !important; height: 36px !important; }

    #search { height: 28px !important; width: 200px !important; min-width: 160px !important; }
    #search-button.search-button { height: 36px !important; width: 36px !important; }
    #search-button .nav-icon { width: 24px !important; height: 24px !important; }

    .nav-icon { width: 20px !important; height: 20px !important; }
    .header-section-title { font-size: 18px !important; }

    #bottom-nav { height: 48px !important; }
    #bottom-nav ul li a, #bottom-nav ul li button { height: 48px !important; font-size: 22px !important; }
}

/* Increase spacing between major tile groups for clearer separation */
.products-grid {
    gap: 80px !important;
}
.showcases {
    grid-template-columns: repeat(auto-fill, 350px) !important;
    justify-content: center !important;
    gap: 80px !important;
    margin: 8px 0 112px 0 !important;
}
.brand-badges {
    gap: 12px;
    margin: 24px 0 16px 0;
}

/* Final desktop override placed at end to ensure it wins over earlier base rules */
@media (min-width: 992px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; gap: 80px !important; }
    .product { padding: 32px !important; }
    .product img { height: 400px !important; }
    .showcases { gap: 80px !important; }
    .showcase-item,
    .showcase-item.showcase-full { width: 350px !important; height: 500px !important; }
    .showcase-item img, .showcase-item.showcase-full img { width: 100% !important; height: 100% !important; object-fit: contain !important; }
    .brand-badge { width: 280px !important; height: 280px !important; font-size: 40px !important; }
    .brand-icon, .brand-mini-logo { width: 144px !important; height: 144px !important; }
    /* Make deals icon square and match brand-icon scale on large desktop */
    .deals-icon { width: 144px !important; height: 144px !important; border-radius: 8px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; overflow: hidden !important; }
    .deals-icon img, .deals-icon svg { width: 100% !important; height: 100% !important; object-fit: contain !important; display: block !important; }
}

/* Desktop: reduce viewer image size so the opened image doesn't dominate the screen */
@media (min-width: 992px) {
    .image-viewer {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 24px;
    }
    .image-viewer img {
        max-width: 80% !important;
        max-height: 80vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
        background-color: #fff !important;
    }
}

/* Viewer image sizing on smaller screens: reduce so it doesn't dominate viewport */
@media (max-width: 768px) {
    .image-viewer img {
        max-width: 98% !important;
        /* increased a bit more per request */
        max-height: 62vh !important;
        width: auto !important;
        height: auto !important;
    }
}

@media (max-width: 420px) {
    .image-viewer img {
        max-width: 99% !important;
        /* compact on small phones, increased slightly */
        max-height: 58vh !important;
    }
}

/* Strong override: remove visible border/lines around the search input */
#search,
#search:focus,
#home #search,
#search-button {
    border: none !important;
    box-shadow: none !important;
}
#search {
    background-color: rgba(255,255,255,0.12) !important; /* keep subtle background */
}
#search::placeholder { color: rgba(255,255,255,0.7) !important; }


/* Desktop: scale showcase images (zoom image only; container/background unchanged) */
@media (min-width: 992px) {
    /* Show full images in showcases on desktop: no cropping, scale to fit */
    .showcase-item,
    .showcase-item.showcase-full {
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        padding: 0;
        background: transparent !important;
    }
    .showcase-item img,
    .showcase-item.showcase-full img {
        width: 100% !important;
        height: 100% !important;
        max-width: 350px !important;
        max-height: 500px !important;
        object-fit: contain !important;
        display: block !important;
        transform: none !important;
    }
}

/* Slightly increase heading sizes site-wide (a little larger, not much) */
h1 { font-size: 1.65rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: 0.98rem; }
h5, h6 { font-size: 0.92rem; }

/* Page and header titles: small increase, responsive adjustments */
#page-title, .page-title { font-size: 18px; font-weight: 600; }
.header-section-title { font-size: 26px; font-weight: 600; }

@media (max-width: 480px) {
    /* On small screens increase slightly but keep compact */
    h1 { font-size: 1.35rem !important; }
    h2 { font-size: 1.12rem !important; }
    h3 { font-size: 1.00rem !important; }
    #page-title, .page-title { font-size: 16px !important; }
    .header-section-title { font-size: 18px !important; }
}


/* Desktop: make showcase containers display only the image (no white background) */
@media (min-width: 992px) {
    .showcase-item,
    .showcase-item.showcase-full {
        background: transparent !important;
        padding: 0 !important;
    }
    .showcase-item img,
    .showcase-item.showcase-full img {
        width: 100% !important;
        height: 100% !important;
        max-width: 350px !important;
        max-height: 500px !important;
        object-fit: contain !important;
        background: transparent !important;
        display: block !important;
    }
}

/* Desktop: adjust bottom navigation size (reduced to half as requested) */
@media (min-width: 992px) {
    #bottom-nav {
        height: 48px !important;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12) !important;
    }
    #bottom-nav ul li a, #bottom-nav ul li button {
        height: 48px !important;
        font-size: 20px !important;
        padding: 0 12px !important;
        align-items: center !important;
    }
    #bottom-nav .nav-icon {
        width: 32px !important;
        height: 32px !important;
    }
    /* Move floating order button to avoid overlap */
    #order-fab { bottom: 72px !important; }
}

/* Mobile: slightly larger icons in the bottom navigation for better tap targets */
@media (max-width: 768px) {
    #bottom-nav .nav-icon {
        width: 36px !important;
        height: 36px !important;
    }
    #bottom-nav ul li a, #bottom-nav ul li button {
        font-size: 28px !important;
    }
    #bottom-nav { height: 64px !important; }
}

@media (max-width: 420px) {
    #bottom-nav .nav-icon {
        width: 34px !important;
        height: 34px !important;
    }
    #bottom-nav ul li a, #bottom-nav ul li button {
        font-size: 26px !important;
    }
    #bottom-nav { height: 60px !important; }
}

/* Override: make corners more square across the site (reduce border-radius) */
:root { --corner-radius: 4px; }
button, input, textarea, select,
.product, .product button, .product-image-only img,
.brand-badge, .deals-badge, .deals-icon, .brand-mini-logo, .brand-icon,
.modal-content, #order-submit, #checkout-button, #search, #search-button,
.unified-icon, .profile-input, .image-title-overlay, .search-suggestions,
#order-fab a, #cart-count, .header-section-title {
    border-radius: var(--corner-radius) !important;
}

/* Specific tweaks for elements previously very rounded (make them less pill-like) */
#order-fab a { border-radius: 8px !important; }
#search { border-radius: 6px !important; }
#search-button.search-button { border-radius: 6px !important; }
.deals-icon, .brand-mini-logo { border-radius: 6px !important; }
.product-image-only img { border-radius: 4px !important; }
.search-suggestions { border-radius: 6px !important; }

/* End of square-corners override */
