:root {
    --ink: #18201d;
    --muted: #6f7772;
    --line: #dfe5df;
    --paper: #f7f8f4;
    --card: #ffffff;
    --accent: #d8f05e;
    --accent-dark: #a8bf36;
    --serif: "Playfair Display", Georgia, serif;
    --sans: "DM Sans", Arial, sans-serif;
    color-scheme: light;
}

:root.dark,
body.dark {
    --ink: #f3f5ef;
    --muted: #aeb8ad;
    --line: #364039;
    --paper: #17201c;
    --card: #202b25;
    --accent: #d8f05e;
    --accent-dark: #b5cc45;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 248, 244, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    transition: background-color .25s ease, border-color .25s ease;
}

.navbar-container {
    width: min(1180px, calc(100% - 48px));
    min-height: 78px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .18em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.nav-menu a,
.portfolio-return {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
    transition: color .2s ease;
}

.nav-menu a:hover,
.portfolio-return:hover { color: var(--ink); }

.portfolio-return {
    order: 3;
    white-space: nowrap;
    color: var(--ink);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    order: 4;
}

.nav-icon,
.cart {
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
}

.nav-icon {
    padding: 6px 10px;
    border-radius: 8px;
    transition: background-color .2s ease, color .2s ease;
}

.nav-icon:hover {
    background: rgba(0, 0, 0, .05);
}

.cart { display: inline-flex; align-items: center; gap: 7px; }

.cart-count {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    font-size: .72rem;
    font-weight: 700;
    transition: background-color .2s ease, color .2s ease;
}

main,
section { width: min(1180px, calc(100% - 48px)); margin: auto; }

.hero {
    min-height: 650px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 70px;
    padding: 92px 0;
}

.hero-label,
.section-label {
    display: inline-block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2em;
}

.hero h1,
.section-heading h2,
.promo h2 {
    margin: 18px 0;
    font-family: var(--serif);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.02;
}

.hero h1 { max-width: 560px; font-size: clamp(3.5rem, 7vw, 6.6rem); }
.hero h1 span { color: #8da426; }

.hero p {
    max-width: 480px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-buttons { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 99px;
    font-size: .88rem;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { border: 1px solid var(--ink); color: var(--ink); }
.btn-primary:hover,
.btn-secondary:hover { transform: translateY(-3px); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

.hero-visual { position: relative; }

.hero-product-preview {
    position: relative;
    overflow: hidden;
    min-height: 490px;
    padding: 26px;
    border-radius: 24px;
    background: #dce7d2;
    transition: background-color .25s ease, border-color .25s ease;
}

.hero-product-image {
    position: absolute;
    inset: 0;
}

.hero-product-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(24, 32, 29, .02), rgba(24, 32, 29, .72));
}

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

.hero-product-badge,
.product-badge {
    position: relative;
    z-index: 2;
    display: inline-block;
    border-radius: 99px;
    background: var(--accent);
    padding: 6px 11px;
    color: #18201d;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.hero-product-info {
    position: absolute;
    right: 26px;
    bottom: 24px;
    left: 26px;
    z-index: 2;
    color: white;
}

.hero-product-info span { color: var(--accent); font-size: .8rem; font-weight: 700; }
.hero-product-info h2 { margin: 6px 0; font-family: var(--serif); font-size: 2.2rem; }
.hero-product-info p { color: rgba(255, 255, 255, .78); font-size: .9rem; }

.featured { padding: 20px 0 100px; }

.section-heading { margin-bottom: 34px; }
.section-heading h2 { font-size: clamp(2.4rem, 5vw, 4.5rem); }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); }

.featured .section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
}

.view-all { border-bottom: 1px solid var(--ink); padding-bottom: 3px; font-weight: 700; }

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

.product-card { min-width: 0; }

.product-image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1.08;
    border-radius: 16px;
    background: #e6ebe3;
    transition: background-color .25s ease;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.88);
    transition: transform .4s ease;
}

.product-card:hover .product-image img { transform: scale(1.06); }
.product-image .product-badge { position: absolute; top: 14px; left: 14px; }

.product-info { padding: 16px 2px; }
.product-category { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.product-info h3 { margin: 5px 0 2px; font-size: 1rem; }
.product-price { margin: 0 0 12px; font-weight: 700; }

.add-to-cart {
    border: 1px solid var(--ink);
    border-radius: 99px;
    padding: 8px 13px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.add-to-cart:hover,
.add-to-cart.added { background: var(--ink); color: var(--paper); }

.categories { padding: 100px 0; border-top: 1px solid var(--line); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.category-card {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    transition: transform .2s ease, border-color .2s ease, background-color .25s ease;
}
.category-card:hover { transform: translateY(-5px); border-color: var(--ink); }
.category-number { color: var(--muted); font-size: .75rem; font-weight: 700; }
.category-content h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 1.8rem; }
.category-content p { margin: 0; color: var(--muted); font-size: .88rem; }
.category-arrow { align-self: end; font-size: 1.5rem; }

.promo {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto 100px;
    padding: 90px 8%;
    border-radius: 24px;
    background: var(--ink);
    color: white;
    transition: background-color .25s ease, border-color .25s ease;
}
.promo h2 { max-width: 540px; font-size: clamp(2.7rem, 6vw, 5.4rem); }
.promo p { max-width: 470px; color: #bec8be; }
.promo .btn-primary { margin-top: 22px; background: var(--accent); color: #18201d; }
.promo .btn-primary:hover { background: #e3f678; color: #18201d; }

.shop-hero {
    min-height: 390px;
    padding: 92px 0 70px;
    border-bottom: 1px solid var(--line);
}

.shop-hero h1 {
    margin: 18px 0;
    font-family: var(--serif);
    font-size: clamp(3.6rem, 8vw, 7rem);
    letter-spacing: -.05em;
    line-height: .98;
}

.shop-hero h1 em { color: #8da426; font-style: normal; }
.shop-hero p { max-width: 520px; margin: 0; color: var(--muted); font-size: 1.05rem; }

.shop-section { padding: 78px 0 110px; }

.shop-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.shop-toolbar h2 { margin: 10px 0 0; font-family: var(--serif); font-size: 2.4rem; }

.filter-control {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

.filter-control select {
    min-width: 190px;
    padding: 11px 35px 11px 13px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.filter-control select option {
    background: var(--card);
    color: var(--ink);
}

.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 18px; }
.shop-product-card[hidden] { display: none; }
.shop-empty { padding: 40px 0; color: var(--muted); text-align: center; }

.product-detail { padding: 62px 0 120px; }
.back-to-shop { display: inline-block; margin-bottom: 42px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.back-to-shop:hover { color: var(--ink); }
.product-detail-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 80px; }
.product-detail-visual { overflow: hidden; aspect-ratio: 1 / .92; border-radius: 24px; background: #e6ebe3; transition: background-color .25s ease; }
.product-detail-visual img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-copy { max-width: 480px; }
.product-detail-copy h1 { margin: 14px 0 12px; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.5rem); letter-spacing: -.05em; line-height: .98; }
.detail-price { margin: 0 0 26px; font-size: 1.15rem; font-weight: 700; }
.detail-description { margin-bottom: 30px; color: var(--muted); font-size: 1.05rem; }
.product-detail-copy .btn-primary { border: 0; cursor: pointer; }
.product-perks { display: grid; gap: 10px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* =============================
   DARK MODE OVERRIDES
============================= */
:root.dark .navbar,
body.dark .navbar {
    background: rgba(23, 32, 28, .92);
}

:root.dark .nav-icon:hover,
body.dark .nav-icon:hover {
    background: rgba(255, 255, 255, .08);
}

:root.dark .cart-count,
body.dark .cart-count {
    background: var(--accent);
    color: #17201c;
}

:root.dark .hero h1 span,
body.dark .hero h1 span,
:root.dark .shop-hero h1 em,
body.dark .shop-hero h1 em {
    color: var(--accent);
}

:root.dark .hero-product-preview,
body.dark .hero-product-preview {
    background: #233128;
    border: 1px solid var(--line);
}

:root.dark .product-image,
body.dark .product-image,
:root.dark .product-detail-visual,
body.dark .product-detail-visual {
    background: #202b25;
}

:root.dark .category-card:hover,
body.dark .category-card:hover {
    border-color: var(--accent);
}

:root.dark .btn-secondary,
body.dark .btn-secondary {
    border-color: var(--ink);
    color: var(--ink);
}

:root.dark .btn-secondary:hover,
body.dark .btn-secondary:hover {
    background: var(--ink);
    color: #17201c;
}

:root.dark .btn-primary,
body.dark .btn-primary {
    background: var(--accent);
    color: #17201c;
}

:root.dark .btn-primary:hover,
body.dark .btn-primary:hover {
    background: #e3f678;
    color: #17201c;
}

:root.dark .add-to-cart,
body.dark .add-to-cart {
    border-color: var(--line);
    color: var(--ink);
}

:root.dark .add-to-cart:hover,
body.dark .add-to-cart:hover {
    background: var(--ink);
    color: #17201c;
    border-color: var(--ink);
}

:root.dark .add-to-cart.added,
body.dark .add-to-cart.added {
    background: var(--accent);
    color: #17201c;
    border-color: var(--accent);
}

:root.dark .promo,
body.dark .promo {
    background: #0e1512;
    border: 1px solid var(--line);
}

:root.dark .promo .btn-primary,
body.dark .promo .btn-primary {
    background: var(--accent);
    color: #17201c;
}

:root.dark .promo .btn-primary:hover,
body.dark .promo .btn-primary:hover {
    background: #e3f678;
    color: #17201c;
}

@media (max-width: 980px) {
    .navbar-container { flex-wrap: wrap; padding: 14px 0; }
    .nav-menu { order: 5; width: 100%; justify-content: center; margin: 0; }
    .portfolio-return { margin-left: auto; }
    .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 70px; }
    .hero-product-preview { min-height: 420px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); row-gap: 25px; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); }
    .product-detail-grid { gap: 40px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    main, section, .promo { width: min(100% - 32px, 500px); }
    .navbar-container { width: calc(100% - 32px); gap: 15px; }
    .nav-actions { margin-left: auto; gap: 8px; }
    .portfolio-return { order: 5; width: 100%; padding-top: 6px; }
    .nav-menu { justify-content: space-between; gap: 8px; }
    .nav-menu a { font-size: .78rem; }
    .featured .section-heading { display: block; }
    .view-all { display: inline-block; margin-top: 18px; }
    .product-grid { gap: 14px; }
    .shop-toolbar { display: block; }
    .filter-control { margin-top: 22px; }
    .filter-control select { width: 100%; }
    .shop-grid { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
    .product-detail { padding-top: 40px; }
    .product-detail-grid { grid-template-columns: 1fr; gap: 34px; }
    .product-detail-copy { max-width: none; }
    .category-grid { grid-template-columns: 1fr; }
    .promo { padding: 58px 24px; }
}