:root {
    --navy: #071a36;
    --navy-2: #0b274f;
    --ink: #102033;
    --muted: #667387;
    --line: #d9e2ee;
    --soft: #f3f7fb;
    --white: #ffffff;
    --red: #e11118;
    --shadow: 0 18px 38px rgba(7, 26, 54, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.shop-icon { width: 19px; height: 19px; flex: 0 0 19px; }
body .motion-reveal {
    opacity: 1 !important;
    transform: none !important;
}

.shop-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 78px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 28px;
    padding: 12px max(24px, calc((100% - 1240px) / 2));
    color: var(--white);
    background: rgba(7, 26, 54, 0.96);
    border-bottom: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(16px);
}
.shop-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 950;
}
.shop-brand img {
    width: 58px;
    height: 42px;
    object-fit: contain;
}
.shop-brand strong { min-width: 0; overflow: hidden; font-size: 18px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.shop-brand small { display: block; margin-top: 4px; color: #b7c7db; font-size: 11px; font-weight: 850; }
.shop-nav { display: flex; gap: 26px; color: rgba(255,255,255,.82); font-weight: 850; }
.shop-nav .is-active, .shop-nav a:hover { color: var(--white); }
.shop-login {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 6px;
    color: var(--white);
    background: var(--red);
    font-weight: 950;
    white-space: nowrap;
}

.shop-page {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 56px;
}
.catalog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 38px;
    color: var(--white);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    box-shadow: var(--shadow);
}
.catalog-hero > div { min-width: 0; }
.catalog-hero span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b7c7db;
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.catalog-hero h1 { max-width: 760px; margin: 12px 0 12px; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: 0; overflow-wrap: anywhere; }
.catalog-hero p { max-width: 680px; margin: 0; color: #d7e1ee; font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.catalog-hero > div > span + p { margin-top: 12px; }
.catalog-wa-link {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    font-weight: 950;
    white-space: nowrap;
}
.catalog-wa-link span { color: var(--white); font-size: 14px; letter-spacing: 0; text-transform: none; }
.catalog-wa-link strong { color: var(--white); }

.catalog-tools {
    display: grid;
    gap: 18px;
    margin: 24px 0;
}
.shop-search {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 24px rgba(7, 26, 54, .06);
}
.shop-search input { min-height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 800; }
.shop-search button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 6px; color: var(--white); background: var(--navy); font-weight: 950; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.category-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: #3d4d62;
    font-size: 13px;
    font-weight: 900;
}
.category-tabs .is-active { color: var(--white); border-color: var(--navy); background: var(--navy); }

.shop-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    align-items: start;
}
.shop-content-direct { grid-template-columns: minmax(0, 1fr); }
.catalog-main {
    min-width: 0;
}
.catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.catalog-head h2 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 26px;
}
.catalog-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}
.catalog-head > a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: var(--white);
    border-radius: 6px;
    background: var(--navy);
    font-weight: 950;
    white-space: nowrap;
}
.catalog-head-note {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: var(--navy);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    font-weight: 950;
    white-space: nowrap;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.shop-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 12px 28px rgba(7, 26, 54, 0.08);
}
.product-image { position: relative; display: block; overflow: hidden; background: #e8eef6; }
.product-image img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; transition: transform .18s ease; }
.shop-card:hover .product-image img { transform: scale(1.03); }
.product-image span { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 6px 9px; color: var(--white); border-radius: 6px; background: rgba(7,26,54,.82); font-size: 11px; font-weight: 950; }
.product-body { display: grid; gap: 12px; padding: 16px; }
.product-body h2 { margin: 0; color: var(--navy); font-size: 22px; line-height: 1.18; }
.product-body p { min-height: 66px; margin: 0; color: var(--muted); line-height: 1.5; font-weight: 700; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.product-meta strong { color: var(--navy); font-size: 18px; }
.product-meta span { color: #071a36; font-size: 13px; font-weight: 950; }
.product-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product-actions.product-actions-wa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-actions.product-actions-wa .detail-link { grid-column: 1 / -1; }
.shop-content-direct .product-actions { grid-template-columns: .8fr 1.35fr; }
.detail-link, .wa-link, .checkout-link, .cart-add-button, .preview-wa, .preview-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border-radius: 6px;
    font-weight: 950;
    text-align: center;
    white-space: nowrap;
}
.cart-add-button {
    border: 0;
}
.detail-link, .preview-secondary { color: var(--navy); border: 1px solid var(--line); background: var(--white); }
.cart-add-button { color: var(--navy); border: 1px solid #b9c8da; background: #f8fafc; }
.wa-link, .checkout-link, .preview-wa { color: var(--white); background: var(--red); }
.wa-buy-link { width: 100%; }
.product-actions.product-actions-wa .cart-add-button,
.product-actions.product-actions-wa .wa-buy-link {
    min-width: 0;
    padding-inline: 10px;
    font-size: 15px;
}
.product-actions.product-actions-wa .cart-add-button span,
.product-actions.product-actions-wa .wa-buy-link {
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-cart-button { min-width: 190px; }
.empty-shop-state { grid-column: 1 / -1; display: grid; place-items: center; gap: 8px; min-height: 220px; padding: 28px; border: 1px dashed #b8c7d8; border-radius: 8px; background: var(--white); text-align: center; }
.empty-shop-state strong { color: var(--navy); font-size: 24px; }
.empty-shop-state span { color: var(--muted); }
.empty-shop-state a { color: var(--red); font-weight: 950; }

.product-preview-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 22px; overflow-y: auto; }
.product-preview-modal:target,
.product-preview-modal.is-preview-open,
.product-preview-modal.is-preview-closing { display: flex; }
.product-preview-modal.is-preview-closed { display: none !important; }
.preview-backdrop { position: fixed; inset: 0; background: rgba(3, 12, 26, .68); }
.preview-panel {
    position: relative;
    z-index: 1;
    width: min(1040px, calc(100vw - 32px));
    max-height: calc(100dvh - 44px);
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(0, 1.05fr);
    overflow: hidden;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.preview-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: var(--white); color: var(--navy); font-weight: 950; }
.preview-media { display: grid; place-items: center; min-height: 500px; padding: 18px; background: #eef3f8; }
.preview-media img { width: 100%; height: 100%; max-height: calc(100dvh - 88px); object-fit: contain; }
.preview-content { min-width: 0; display: grid; align-content: start; gap: 16px; padding: 34px; overflow-y: auto; }
.preview-kicker { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-kicker span { padding: 7px 10px; border-radius: 6px; color: var(--white); background: var(--navy); font-size: 12px; font-weight: 950; }
.preview-content h2 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 42px); line-height: 1.1; }
.preview-content p { margin: 0; color: var(--muted); line-height: 1.6; font-weight: 750; }
.preview-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.preview-meta div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.preview-meta dt { color: var(--muted); font-size: 12px; font-weight: 950; }
.preview-meta dd { margin: 4px 0 0; overflow: hidden; color: var(--navy); font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.preview-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.preview-thumb { width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.preview-thumb.is-active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(225,17,24,.18); }
.preview-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.order-panel {
    position: sticky;
    top: 96px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 12px 28px rgba(7, 26, 54, 0.08);
}
.order-head {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
}
.order-head div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.order-head > span {
    padding: 5px 9px;
    color: #071a36;
    border-radius: 999px;
    background: #f3f7fb;
    font-size: 12px;
    font-weight: 950;
}
.order-items {
    display: grid;
    gap: 10px;
    max-height: 440px;
    overflow: auto;
    padding: 14px;
}
.cart-empty-state {
    margin: 0;
    padding: 16px;
    color: var(--muted);
    border: 1px dashed #bdccdc;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 800;
    line-height: 1.45;
}
.order-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}
.order-item img {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
}
.order-item-body {
    min-width: 0;
    display: grid;
    gap: 5px;
}
.order-item-body strong {
    overflow: hidden;
    color: var(--navy);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-item-body span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
.qty-control {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qty-control button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--navy);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
}
.qty-control b {
    min-width: 18px;
    text-align: center;
}
.cart-remove-button {
    width: max-content;
    min-height: 24px;
    padding: 0;
    color: #b42318;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 900;
}
.order-checkout-link {
    width: 72px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--white);
    border-radius: 6px;
    background: var(--red);
    font-size: 12px;
    font-weight: 950;
}
.order-summary {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-top: 1px dashed #c9d5e3;
}
.order-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 850;
}
.order-summary strong {
    color: var(--navy);
}
.cart-checkout-all,
.cart-whatsapp-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--white);
    border-radius: 6px;
    background: var(--red);
    font-weight: 950;
}
.cart-whatsapp-link {
    color: var(--navy);
    border: 1px solid #b9c8da;
    background: #f8fafc;
}
.order-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    font-weight: 750;
}
.mobile-cart-toggle,
.mobile-cart-backdrop,
.mobile-cart-close {
    display: none;
}

.shop-footer {
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) repeat(2, minmax(160px, .6fr));
    gap: 30px;
    align-items: start;
    padding: 34px max(24px, calc((100% - 1240px) / 2));
    color: #d7e1ee;
    background: #061428;
}
.shop-footer > div {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 10px;
}
.shop-footer p,
.shop-footer a,
.shop-footer span {
    margin: 0;
    color: #b7c5d6;
    font-weight: 750;
}
.shop-footer > div > strong { color: var(--white); }
.shop-footer small { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); text-align: center; color: #9fb0c6; }

@media (max-width: 980px) {
    .shop-header { grid-template-columns: 1fr auto; }
    .shop-nav { display: none; }
    .catalog-hero { grid-template-columns: 1fr; }
    .shop-content { grid-template-columns: 1fr; }
    .order-panel { position: static; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preview-panel { grid-template-columns: 1fr; max-height: none; }
    .preview-media { min-height: 320px; }
    .preview-content { overflow-y: visible; }
}

@media (max-width: 640px) {
    .shop-header {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 70px;
        padding: 10px 16px;
        gap: 12px;
        color: var(--white) !important;
        background: rgba(7, 26, 54, 0.96) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    .shop-brand img { width: 46px; height: 34px; }
    .shop-brand strong { max-width: min(34vw, 130px); color: var(--white) !important; font-size: 14px; }
    .shop-brand small { display: none; }
    .shop-login { min-height: 40px; padding-inline: 10px; border-radius: 6px !important; font-size: 13px; }
    .shop-page { width: min(calc(100vw - 64px), 420px); padding-top: 22px; }
    .catalog-hero { padding: 24px; }
    .catalog-hero h1 { font-size: 30px; line-height: 1.14; overflow-wrap: anywhere; }
    .catalog-hero p { font-size: 16px; line-height: 1.55; }
    .catalog-wa-link { width: 100%; justify-content: flex-start; white-space: normal; }
    .shop-search { grid-template-columns: 20px minmax(0, 1fr); }
    .shop-search button { grid-column: 1 / -1; width: 100%; }
    .category-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .category-tabs a { white-space: nowrap; }
    .catalog-head { align-items: stretch; flex-direction: column; }
    .catalog-head > a { width: 100%; }
    .product-grid { grid-template-columns: 1fr; }
    .product-body p { min-height: 0; }
    .product-actions, .product-actions.product-actions-wa, .preview-meta { grid-template-columns: 1fr; }
    .product-actions > * { width: 100%; }
    .product-actions.product-actions-wa .detail-link { grid-column: auto; }
    .product-preview-modal { align-items: flex-start; padding: 12px; }
    .preview-panel { width: min(420px, calc(100vw - 24px)); }
    .preview-media { min-height: 250px; padding: 12px; }
    .preview-media img { max-height: 300px; }
    .preview-content { padding: 22px; }
    .preview-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .preview-actions { flex-direction: column; }
    .preview-wa, .preview-secondary, .preview-cart-button { width: 100%; }
    .mobile-cart-toggle {
        position: fixed;
        top: auto !important;
        right: 18px !important;
        bottom: 88px !important;
        z-index: 70;
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        padding-right: 0 !important;
        color: var(--white);
        border: 0 !important;
        border-radius: 18px !important;
        background: var(--red) !important;
        box-shadow: 0 18px 34px rgba(225, 17, 24, .26);
        transform: none !important;
    }
    .mobile-cart-toggle span {
        position: absolute;
        top: -7px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        display: grid;
        place-items: center;
        padding: 0 5px;
        border-radius: 999px;
        color: var(--navy);
        background: var(--white);
        font-size: 12px;
        font-weight: 950;
    }
    .order-panel {
        position: fixed;
        inset: 0;
        z-index: 240;
        display: none;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .order-panel:target,
    body.mobile-cart-open .order-panel,
    body.mobile-cart-closing .order-panel {
        display: block;
    }
    .mobile-cart-backdrop {
        position: absolute;
        inset: 0;
        display: block;
        background: rgba(3, 12, 26, .5);
    }
    .mobile-cart-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 100vw;
        max-width: 100vw;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        overflow: hidden;
        border-radius: 0;
        background: var(--white);
        transform: translateX(100%);
        transition: transform .28s ease;
    }
    .order-panel:target .mobile-cart-drawer,
    body.mobile-cart-open .order-panel .mobile-cart-drawer {
        transform: translateX(0);
    }
    .mobile-cart-close {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        color: var(--navy);
        border-radius: 6px;
        background: #f0f4f8;
        font-weight: 950;
    }
    .order-items { max-height: none; overflow-y: auto; }
    .order-checkout-link { width: 72px; font-size: 11px; }
    .order-summary { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
    .shop-footer { grid-template-columns: 1fr; padding: 30px 16px; }
}
