/* Comfortimo storefront theme */

:root {
    --primary: #1E3A5F;
    --primary-hover: #162d4a;
    --white: #FFFFFF;
    --bg: #F5F7FA;
    --text: #2B2F36;
    --muted: #757575;
    --sage: var(--muted);
    --sand: #E8DCC4;
    --highlight: #D96B4A;
    --highlight-hover: #C25A3A;
    --highlight-soft: #FCEEE8;
    --line: #e3e8ef;
    --card: #FFFFFF;
    --accent: var(--primary);
    --accent-hover: var(--primary-hover);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-main { flex: 1 0 auto; width: 100%; padding-bottom: 48px; }
.page-content { padding: 16px 16px 24px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 12px rgba(30, 58, 95, .12);
}

.header-main {
    background: var(--primary);
    color: var(--white);
}

.header-main-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    min-height: 64px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    line-height: 1;
}

.site-logo-mark-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.site-logo-mark {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.site-logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    white-space: nowrap;
}

.site-logo--on-light .site-logo-text {
    color: var(--primary);
}

.site-logo--square {
    display: none;
    gap: 0;
}

.site-logo--square .site-logo-mark-wrap {
    width: 40px;
    height: 40px;
}

.site-logo--square .site-logo-mark {
    width: 36px;
    height: 36px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-search {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 520px;
}

.header-search input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(30, 58, 95, .08);
}

.header-search input::placeholder { color: #9aa3ad; }

.header-search input:focus {
    outline: 2px solid var(--sand);
    outline-offset: 0;
}

.header-search::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23757575' stroke-width='2'%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-switch a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.header-main .lang-switch a {
    color: rgba(255, 255, 255, .82);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.header-main .lang-switch a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .15);
}

.header-main .lang-switch a.is-active {
    color: var(--white);
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .4);
    font-weight: 700;
}

.mobile-nav-foot.lang-switch a {
    color: var(--text);
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    background: var(--white);
}

.mobile-nav-foot.lang-switch a:hover {
    color: var(--primary);
    background: var(--bg);
    border-color: var(--sand);
}

.mobile-nav-foot.lang-switch a.is-active {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
}

.header-sub {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.sub-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar { display: none; }

.sub-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    padding: 7px 12px;
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 500;
}

.sub-nav a:hover {
    background: var(--white);
    color: var(--primary);
}

.store-admin-link {
    display: none;
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 25;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--primary);
    background: var(--white);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(30, 58, 95, .15);
}

.store-admin-link:hover {
    border-color: var(--sand);
    background: var(--bg);
}

.store-admin-link svg { display: block; width: 18px; height: 18px; }

.menu-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: var(--white);
    border-radius: 10px;
    padding: 8px 11px;
    line-height: 1;
    cursor: pointer;
}

.menu-toggle:hover { background: rgba(255, 255, 255, .16); }

.menu-toggle-icon {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}

/* Mobile nav */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(43, 47, 54, .5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.mobile-nav-overlay.is-open { opacity: 1; visibility: visible; }

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    height: 100dvh;
    max-height: 100dvh;
    background: var(--white);
    z-index: 41;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(30, 58, 95, .15);
}

.mobile-nav-drawer.is-open { transform: translateX(0); }

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--primary);
    color: var(--white);
}

.mobile-nav-head strong { font-size: 16px; }

.menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: var(--white);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.menu-close-icon {
    display: block;
    flex-shrink: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.mobile-nav-links a {
    display: block;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
}

.mobile-nav-links a:hover { background: var(--bg); }

.mobile-nav-foot {
    padding: 12px 16px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.menu-open,
body.filter-open { overflow: hidden; }

/* Cart */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    background: transparent;
    flex-shrink: 0;
}

.cart-link:hover { background: rgba(255, 255, 255, .12); }

.cart-link-icon {
    display: block;
    width: 28px;
    height: 28px;
    line-height: 0;
}

.cart-link-icon img {
    display: block;
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.cart-link-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--highlight);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(217, 107, 74, .45);
    pointer-events: none;
}

.cart-link-badge[hidden] { display: none !important; }

/* Content */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

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

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

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

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(30, 58, 95, .04);
    transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(30, 58, 95, .08);
}

.card img { width: 100%; height: 210px; object-fit: cover; background: var(--bg); }

.product-card > a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 210px;
    background: var(--bg);
}

.product-card > a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.card .p { padding: 14px; }
.card a { color: var(--text); text-decoration: none; }
.muted { color: var(--muted); }
.price { font-weight: 700; margin-top: 6px; color: var(--primary); }

.product-price {
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.product-price .price-old { text-decoration: line-through; color: var(--muted); font-weight: 500; font-size: 0.92em; }
.product-price .price-sale { color: var(--highlight); }

.badge-highlight,
.product-discount-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--highlight);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.badge-highlight--soft {
    background: var(--highlight-soft);
    color: var(--highlight);
}

.product-card .product-discount-badge,
.product-gallery-main .product-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    border-radius: 999px;
    font-size: 11px;
    padding: 3px 8px;
    box-shadow: 0 2px 8px rgba(217, 107, 74, .35);
    pointer-events: none;
}

.product-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.product-status-badge--preorder {
    background: #e0e7ff;
    color: #3730a3;
    box-shadow: 0 2px 8px rgba(55, 48, 163, .15);
}

.product-purchase-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.product-cart-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.product-gallery-main .product-discount-badge {
    top: 12px;
    left: 12px;
    font-size: 14px;
    padding: 5px 11px;
}
.product-price--lg { font-size: 26px; margin-top: 8px; }
.product-price--lg .price-old { font-size: 0.75em; }

.row { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }

@media (min-width: 901px) {
    .product-layout.row {
        grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
        gap: 28px;
    }
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.catalog-filter-form .catalog-filter-field { margin-bottom: 14px; }
.catalog-filter-form .catalog-filter-field:last-of-type { margin-bottom: 0; }
.catalog-filter-form .catalog-filter-field > label:first-child,
.catalog-filter-form .catalog-filter-field > strong:first-child {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}
.catalog-filter-form .catalog-filter-field strong { color: var(--text); }
.catalog-filter-form .catalog-filter-check { margin-top: 6px; }
.catalog-filter-form .catalog-filter-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}
.catalog-filter-form .catalog-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 4px;
}

.catalog-toolbar-mobile,
.catalog-filter-drawer-head,
.catalog-filter-overlay {
    display: none;
}

.breadcrumbs { margin: 12px 0; font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: var(--sage); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }

input, select, textarea, button { font: inherit; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--white);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(30, 58, 95, .2);
    border-color: var(--primary);
}

button,
.btn-primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--white);
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 500;
}

button:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; letter-spacing: -.01em; color: var(--text); }

.prose p { margin: 0 0 12px; }
.prose h2, .prose h3, .prose h4 { margin-top: 22px; margin-bottom: 10px; }
.prose ul, .prose ol { margin: 0 0 14px 20px; }
.prose blockquote {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--sand);
    color: var(--text);
    background: var(--bg);
    border-radius: 8px;
}
.prose img { max-width: 100%; height: auto; border-radius: 10px; }

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--primary);
    color: rgba(255, 255, 255, .88);
    flex-shrink: 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 24px 20px;
    padding-top: 32px;
    padding-bottom: 36px;
    align-items: start;
}

.footer-col-brand { min-width: 0; }

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.footer-brand .site-logo {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.footer-brand .site-logo:hover {
    text-decoration: none;
}

.footer-brand .site-logo-mark-wrap {
    width: 40px;
    height: 40px;
}

.footer-brand .site-logo-mark {
    width: 36px;
    height: 36px;
}

.footer-brand .site-logo-text {
    font-size: 22px;
    line-height: 1;
}

.footer-col h4 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sand);
    font-weight: 600;
}

.footer-col a:not(.site-logo) {
    display: inline-block;
    margin: 4px 0;
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
}

.footer-col a:not(.site-logo):hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-col .muted { color: rgba(255, 255, 255, .65); }

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 16px 0 22px;
    text-align: center;
}

.footer-copyright p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .55);
}

/* Search dropdown */
.live-search-wrap { position: relative; overflow: visible; }

.live-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(30, 58, 95, .14);
    z-index: 30;
    max-height: 360px;
    overflow: auto;
}

.live-search-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--bg);
}

.live-search-item:last-child { border-bottom: 0; }
.live-search-item:hover { background: var(--bg); }
.live-search-item img,
.live-search-noimg {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg);
    display: block;
    flex-shrink: 0;
}

.live-search-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.live-search-meta strong { font-size: 14px; line-height: 1.35; color: var(--text); }
.live-search-item .muted { color: var(--muted); }
.live-search-add { font-size: 13px; padding: 7px 12px; white-space: nowrap; flex-shrink: 0; }
.live-search-empty { padding: 12px; color: var(--muted); font-size: 14px; }

.store-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(30, 58, 95, .2);
    max-width: 320px;
}

.store-toast-success { background: #3d5f4a; }
.store-toast-error { background: #9b2c2c; }

/* Home slider */
.home-slider {
    position: relative;
    width: 100%;
    margin: 0 0 24px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 4px 20px rgba(30, 58, 95, .06);
}

.home-slider-nav {
    background: rgba(30, 58, 95, .55);
    border-color: rgba(255, 255, 255, .7);
}

.home-slider-nav:hover { background: rgba(30, 58, 95, .78); }

.home-category-card {
    background: var(--bg);
    border-color: var(--line);
}

.home-category-card:hover {
    border-color: var(--sand);
    background: var(--white);
}

@media (min-width: 901px) and (max-width: 1199px) {
    .site-header .wrap {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 900px) {
    .row { grid-template-columns: 1fr; }
    .catalog-toolbar-mobile {
        display: block;
        margin-bottom: 12px;
    }

    .catalog-filter-toggle {
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--white);
        color: var(--primary);
        font-weight: 600;
        font-size: 15px;
        cursor: pointer;
    }

    .catalog-filter-toggle:hover {
        border-color: var(--sand);
        background: var(--bg);
    }

    .catalog-filter-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(43, 47, 54, .5);
        z-index: 44;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .catalog-filter-overlay.is-open {
        opacity: 1;
        visibility: visible;
    }

    .catalog-filter-aside {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(360px, 92vw);
        max-height: 100dvh;
        z-index: 45;
        transform: translateX(100%);
        transition: transform .25s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0;
        border-radius: 0;
        box-shadow: -8px 0 30px rgba(30, 58, 95, .15);
    }

    .catalog-filter-aside.is-open {
        transform: translateX(0);
    }

    .catalog-filter-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        background: var(--primary);
        color: var(--white);
        flex-shrink: 0;
    }

    .catalog-filter-drawer-head strong { font-size: 16px; }

    .catalog-filter-aside .catalog-filter-form {
        flex: 1;
        overflow-y: auto;
        padding: 14px 16px 24px;
        -webkit-overflow-scrolling: touch;
    }

    .card img { height: 190px; }
    .product-card > a { height: 190px; }

    .site-header .wrap,
    .site-footer .wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    .header-main-inner {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 12px;
    }

    .site-logo-text {
        font-size: 18px;
    }

    .header-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        min-width: 44px;
        padding: 11px 14px;
    }

    .header-sub { display: none; }

    .lang-desktop { display: none; }

    .mobile-nav-drawer {
        left: 0;
        width: 100%;
        max-width: 100%;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 28px;
        padding-bottom: 32px;
    }

    .footer-col-brand {
        text-align: center;
    }

    .footer-brand {
        align-items: center;
        width: 100%;
    }

}

@media (min-width: 901px) {
    .mobile-nav-overlay,
    .mobile-nav-drawer { display: none !important; }

    .store-admin-link { display: inline-flex; }

    .header-actions { gap: 18px; }
}
