@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Montserrat:wght@600;700;800;900&display=swap');

:root {
    color-scheme: dark;
    --bg: #10110f;
    --panel: #191b17;
    --line: #363930;
    --gold: #fdda05;
    --white: #f5f5ef;
    --muted: #a9ac9e;
    --header-height: 78px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
body { margin: 0; background: var(--bg); color: var(--white); font: 400 15px/1.7 Cairo, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
.container { width: min(1160px, 92%); margin-inline: auto; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}
.primary, .secondary, .nav-search, .cart-trigger, .add-button, .text-button {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
    padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 800;
    font-size: 13px; text-decoration: none; text-align: center;
}
.primary { background: var(--gold); color: #17180e; }
.primary:hover { background: #ffe44b; }
.secondary, .nav-search { border-color: var(--line); background: transparent; color: var(--white); }
.secondary:hover, .nav-search:hover, .add-button:hover { border-color: var(--gold); }
.text-link, .text-button { color: var(--gold); }
.text-button { background: transparent; }
.text-button:hover { text-decoration: underline; }

.site-header {
    position: sticky; top: 0; z-index: 10; height: var(--header-height);
    background: rgb(16 17 15 / 94%); border-bottom: 1px solid #292c23; backdrop-filter: blur(12px);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand-mark { border-radius: 9px; border: 1px solid #55532b; object-fit: cover; }
.brand-name { font-size: 23px; font-weight: 900; line-height: 1.2; }
.brand-name small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; }
.links, .nav-actions { display: flex; align-items: center; gap: clamp(12px, 2.6vw, 34px); }
.links a { font-size: 13px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.links a:hover { color: var(--gold); }
.nav-actions { gap: 9px; }
.cart-trigger { position: relative; background: #252416; color: var(--gold); border-color: #595125; white-space: nowrap; }
#cart-count { min-width: 24px; padding-inline: 5px; background: var(--gold); color: var(--bg); border-radius: 30px; }

.hero {
    display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 65px); align-items: center;
    padding-block: 42px; border-bottom: 1px solid #292c23;
}
.hero-art { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.hero-art img { width: 100%; height: auto; }
.hero h1 { font-size: clamp(34px, 4.6vw, 57px); line-height: 1.32; margin: 0 0 12px; font-weight: 900; }
.hero h1 span, .eyebrow { color: var(--gold); }
.hero p { color: var(--muted); margin: 0 0 20px; }
.catalog { padding-block: 36px 50px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 28px; margin: 0; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 220px); gap: 10px; margin-bottom: 12px; }
.search-row input, .search-row select, .copy-field {
    min-width: 0; min-height: 46px; border-radius: 8px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel);
}
.search-row input { font-size: 16px; }
.search-row select { font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter {
    min-height: 44px; padding-inline: 13px; white-space: nowrap; color: var(--muted);
    border: 1px solid var(--line); background: var(--panel); border-radius: 8px; font-size: 12px;
}
.filter[aria-pressed=true] { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 900; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 246px), 1fr)); gap: 18px; }
.product-card { min-width: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid #303329; border-radius: 11px; }
.product-card:hover { border-color: #73692e; }
.product-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; border-radius: inherit; }
.product-visual {
    position: relative; height: 220px; display: flex; justify-content: center;
    border-radius: 10px 10px 0 0; overflow: hidden; padding: 9px; background: #11120f;
}
.product-visual img { width: 100%; height: 100%; object-fit: contain; }
.category-tag {
    position: absolute; inset-block-start: 10px; inset-inline-start: 9px; color: var(--gold);
    background: #17180e; border: 1px solid #4e4624; border-radius: 5px; padding: 2px 7px;
    font-weight: 800; font-size: 10px;
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 0; overflow-wrap: anywhere; }
.latin { font: 700 10px/1.45 Montserrat, sans-serif; letter-spacing: .25px; color: var(--muted); text-align: right; }
.card-body h3 { font-size: 16px; line-height: 1.45; margin: 4px 0; }
.card-body p { color: var(--muted); font-size: 12px; margin: 0 0 5px; }
.details { color: var(--gold); font-size: 12px; font-weight: 800; margin-block: auto 0; min-height: 34px; display: flex; gap: 6px; align-items: center; }
.product-link:hover .details { text-decoration: underline; }
.card-foot { padding: 2px 14px 12px; }
.add-button { width: 100%; padding-inline: 6px; background: #272717; border-color: #494528; color: var(--gold); }
.empty { border: 1px dashed var(--line); border-radius: 10px; text-align: center; padding: 24px; color: var(--muted); }
.about { padding-block: 4px 45px; }
.about-card { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 20px; }
.about-card img { border-radius: 9px; }
.about-card h2 { margin: 0 0 4px; }
.about-card p { margin: 0; font-size: 13px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); padding-block: 18px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.footer-contact { font-weight: 800; text-decoration: none; color: var(--white); }

.product-page { padding-block: 22px 48px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumb a { color: var(--gold); min-height: 44px; display: inline-flex; align-items: center; }
.product-detail { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); }
.detail-image { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 17px; align-self: start; }
.detail-image img { width: 100%; height: min(58vh, 520px); object-fit: contain; }
.detail-copy { min-width: 0; overflow-wrap: anywhere; align-self: center; }
.eyebrow { font-size: 13px; font-weight: 800; }
.detail-copy h1 { font-size: clamp(25px, 4vw, 43px); margin: 4px 0; line-height: 1.35; }
.detail-latin { font-size: 14px; margin: 0 0 10px; }
.detail-brand, .product-reference { color: var(--muted); font-size: 12px; }
.detail-description { color: #c8cabc; margin: 6px 0 12px; }
.detail-copy h2 { color: var(--gold); font-size: 16px; margin: 16px 0 4px; }
.specs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 12px 0; padding: 0; list-style: none; }
.specs li { border: 1px solid var(--line); padding: 5px 9px; border-radius: 6px; font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.copy-field { width: 100%; margin-top: 10px; }
.not-found { display: grid; justify-items: start; align-content: center; gap: 12px; min-height: 60vh; }

body:has(.cart-dialog[open]) { overflow: hidden; }
.cart-dialog {
    width: min(460px, calc(100% - 32px)); max-height: 90vh; max-height: 90dvh;
    padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--white);
    border-radius: 13px; margin: auto 16px auto auto; overscroll-behavior: contain;
}
.cart-dialog::backdrop { background: rgb(0 0 0 / 70%); }
.cart-title, .cart-actions { background: var(--panel); position: sticky; z-index: 1; padding: 12px 16px; }
.cart-title { top: 0; display: flex; align-items: start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.cart-title h2 { margin: 0; font-size: 22px; }
.cart-title p { margin: 0; font-size: 12px; color: var(--muted); }
.close-cart {
    background: transparent; border: 1px solid var(--line); border-radius: 50%;
    width: 44px; height: 44px; font-size: 24px; line-height: 1;
}
.cart-content { padding: 4px 16px 14px; }
.cart-content > p { color: var(--muted); }
.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 11px; border-bottom: 1px solid var(--line); padding-block: 12px; }
.cart-item:last-child { border: 0; }
.cart-image { border-radius: 7px; background: var(--bg); object-fit: contain; }
.cart-item-name { font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.cart-item-name:hover { text-decoration: underline; }
.cart-item-variant { font-size: 12px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.cart-item-actions { margin-top: 5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 7px; }
.stepper button, .remove-item { border: 0; background: transparent; min-width: 44px; height: 44px; }
.stepper button { color: var(--gold); font-weight: 800; font-size: 17px; }
.quantity { min-width: 24px; text-align: center; }
.remove-item { padding-inline: 6px; color: var(--muted); text-decoration: underline; font-size: 12px; }
.cart-actions { bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border-top: 1px solid var(--line); }
.cart-actions .status { grid-column: 1 / -1; }
.status { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status:empty { display: none; }
.toast {
    position: fixed; z-index: 12; inset-block-end: 18px; inset-inline-start: 4%; max-width: 92%;
    border: 1px solid #655a2b; border-radius: 8px; background: #262518; padding: 9px 14px; color: var(--white);
}

@media (max-width: 760px) {
    :root { --header-height: 62px; }
    .nav { gap: 8px; }
    .brand-mark { width: 37px; height: 37px; }
    .brand-name { font-size: 20px; }
    .links, .nav-search { display: none; }
    .cart-trigger { padding-inline: 10px; }
    .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 34%); gap: 13px; padding-block: 21px 17px; }
    .hero-copy { grid-row: 1; grid-column: 1; }
    .hero-art { grid-row: 1; grid-column: 2; }
    .hero h1 { font-size: clamp(24px, 5.7vw, 34px); margin-bottom: 6px; }
    .hero p { font-size: 12px; margin-bottom: 10px; }
    .hero .primary { padding-inline: 10px; }
    .catalog { padding-block: 16px 34px; }
    .section-head { margin-bottom: 9px; }
    .section-head h2 { font-size: 22px; }
    .search-row { grid-template-columns: minmax(0, 1fr) minmax(104px, 34%); gap: 7px; margin-bottom: 8px; }
    .search-row input, .search-row select { padding-inline: 8px; }
    .filters { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-bottom: 12px; padding: 4px; scrollbar-width: thin; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .product-visual { height: clamp(118px, 38vw, 174px); padding: 5px; }
    .category-tag { font-size: 9px; inset-block-start: 6px; inset-inline-start: 5px; padding: 1px 4px; }
    .card-body { padding: 7px 8px 0; }
    .card-body h3 { font-size: 14px; }
    .card-body p { font-size: 11px; }
    .details { min-height: 28px; }
    .card-foot { padding: 0 8px 8px; }
    .product-page { padding-block: 11px 34px; }
    .product-detail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .detail-image { padding: 8px; }
    .detail-image img { height: clamp(182px, 35vh, 325px); }
    .detail-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .footer-inner { flex-direction: column; align-items: start; }
    .cart-dialog {
        inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88vh; max-height: 88dvh;
        border-radius: 14px 14px 0 0;
    }
    .cart-actions { padding-block-end: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
