:root {
    --text: #231815;
    --muted: #6d5c56;
    --line: rgba(35, 24, 21, 0.12);
    --accent: #a36d4f;
    --accent-dark: #6f4128;
    --gold: #b9905f;
    --success: #dff1e4;
    --error: #f9d9d2;
    --shadow: 0 18px 50px rgba(69, 40, 24, 0.08);
    --page-bg:
        radial-gradient(circle at top left, rgba(214, 185, 138, 0.3), transparent 30%),
        linear-gradient(180deg, #fbf6f0 0%, #f4ede5 100%);
    --header-bg: rgba(251, 246, 240, 0.82);
    --card-bg: rgba(255, 250, 245, 0.86);
    --card-border: rgba(163, 109, 79, 0.15);
    --hero-overlay: linear-gradient(160deg, rgba(255, 255, 255, 0.65), rgba(214, 185, 138, 0.28));
    --secondary-bg: rgba(255, 255, 255, 0.6);
    --section-alt-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(214, 185, 138, 0.16));
    --filter-bg: rgba(255, 255, 255, 0.58);
    --filter-active-bg: rgba(163, 109, 79, 0.12);
    --filter-active-text: #6f4128;
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: rgba(35, 24, 21, 0.12);
    --input-placeholder: rgba(35, 24, 21, 0.4);
    --footer-bg: rgba(255, 255, 255, 0.46);
}

.theme-dark {
    --text: #f5ebe1;
    --muted: #cbb7a5;
    --line: rgba(231, 210, 188, 0.16);
    --accent: #b37b58;
    --accent-dark: #7b4a31;
    --gold: #d3b07f;
    --success: #1f3a2b;
    --error: #532a27;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
    --page-bg:
        radial-gradient(circle at top left, rgba(211, 176, 127, 0.16), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(179, 123, 88, 0.12), transparent 24%),
        linear-gradient(180deg, #181211 0%, #261d1b 48%, #1b1513 100%);
    --header-bg: rgba(24, 18, 17, 0.82);
    --card-bg: linear-gradient(180deg, rgba(47, 36, 32, 0.94), rgba(33, 26, 24, 0.98));
    --card-border: rgba(211, 176, 127, 0.14);
    --hero-overlay: linear-gradient(160deg, rgba(19, 14, 13, 0.18), rgba(19, 14, 13, 0.58));
    --secondary-bg: rgba(241, 229, 216, 0.08);
    --section-alt-bg: linear-gradient(180deg, rgba(211, 176, 127, 0.08), rgba(24, 18, 17, 0.1));
    --filter-bg: rgba(241, 229, 216, 0.06);
    --filter-active-bg: rgba(211, 176, 127, 0.14);
    --filter-active-text: #f4dfc7;
    --input-bg: rgba(241, 229, 216, 0.08);
    --input-border: rgba(231, 210, 188, 0.14);
    --input-placeholder: rgba(245, 235, 225, 0.55);
    --footer-bg: rgba(14, 10, 9, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background: var(--page-bg);
}

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

img {
    max-width: 100%;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
}

.nav-bar,
.main-nav,
.hero-actions,
.section-heading,
.product-meta,
.admin-topbar,
.admin-actions,
.total-row,
.inline-form {
    display: flex;
    align-items: center;
}

.nav-bar,
.admin-topbar,
.total-row {
    justify-content: space-between;
}

.nav-bar {
    min-height: 78px;
    gap: 20px;
}

.brand,
h1,
h2,
h3,
h4 {
    font-family: 'Cormorant Garamond', serif;
}

.brand {
    font-size: 2rem;
    font-weight: 700;
}

.main-nav {
    gap: 18px;
    flex-wrap: wrap;
}

.menu-toggle,
.theme-toggle,
.admin-link {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--secondary-bg);
    color: var(--text);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.theme-toggle {
    cursor: pointer;
}

.cart-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
}

.hero,
.section {
    padding: 72px 0;
}

.hero-grid,
.split-grid,
.checkout-layout,
.catalogue-layout,
.product-view,
.admin-edit-grid,
.footer-grid,
.commitment-grid,
.stats-grid {
    display: grid;
    gap: 26px;
}

.hero-grid {
    grid-template-columns: 1.5fr 0.9fr;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.eyebrow {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-size: 0.76rem;
    margin-bottom: 12px;
}

.theme-dark .eyebrow {
    color: var(--gold);
}

h1 {
    font-size: clamp(3rem, 6vw, 5.6rem);
    line-height: 0.94;
    margin: 0;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    margin: 0;
}

.hero-copy,
.feature-list p,
.product-body p,
.panel,
.auth-box,
.checkout-form,
.checkout-summary,
.commitment-card p {
    color: var(--muted);
}

.hero-card,
.product-card,
.commitment-card,
.panel,
.auth-box,
.checkout-summary,
.checkout-form,
.stat-card,
.empty-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 32px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    background:
        var(--hero-overlay),
        url('https://images.unsplash.com/photo-1617038220319-276d3cfab638?auto=format&fit=crop&w=1200&q=80') center/cover;
    color: #fff;
}

.hero-card strong {
    font-size: 2rem;
    font-family: 'Cormorant Garamond', serif;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
}

.button-secondary {
    border-color: var(--line);
    background: var(--secondary-bg);
    color: var(--text);
}

.section-heading {
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.product-card {
    overflow: hidden;
}

.product-image,
.product-image-large {
    background-size: cover;
    background-position: center;
}

.product-image {
    aspect-ratio: 0.85;
}

.product-image-large {
    min-height: 620px;
    border-radius: 28px;
}

.product-body,
.commitment-card,
.panel,
.auth-box,
.checkout-summary,
.checkout-form,
.stat-card {
    padding: 24px;
}

.product-meta,
.hero-actions,
.admin-actions,
.inline-form {
    gap: 12px;
}

.admin-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-actions .button {
    white-space: nowrap;
    min-height: 52px;
}

.split-grid,
.checkout-layout,
.catalogue-layout,
.product-view,
.admin-edit-grid,
.footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-list,
.form-grid {
    display: grid;
    gap: 18px;
}

.section-alt {
    background: var(--section-alt-bg);
}

.commitment-grid,
.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 30px 0;
}

.catalogue-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
}

.filters {
    position: sticky;
    top: 110px;
    display: grid;
    gap: 10px;
    padding: 20px;
    background: var(--filter-bg);
    border-radius: 24px;
    border: 1px solid var(--line);
}

.filter-link {
    padding: 12px 14px;
    border-radius: 16px;
}

.filter-link.active {
    background: var(--filter-active-bg);
    color: var(--filter-active-text);
    font-weight: 700;
}

.product-panel,
.checkout-form {
    padding: 10px 0;
}

.product-points {
    padding-left: 18px;
    color: var(--muted);
}

.price-lg {
    font-size: 2rem;
    margin: 18px 0;
    font-weight: 700;
}

.cart-row,
.flash {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.cart-row {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.cart-row > div:last-child {
    text-align: right;
}

.remove-link {
    color: var(--accent-dark);
}

.form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

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

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.flash {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 18px;
}

.flash-success {
    background: var(--success);
    color: #1b4227;
}

.theme-dark .flash-success {
    color: #e7f5ea;
}

.flash-error {
    background: var(--error);
    color: #6b1f1f;
}

.theme-dark .flash-error {
    color: #ffe5e0;
}

.admin-shell h1 {
    font-size: clamp(2.6rem, 4vw, 4rem);
}

.admin-table-wrap,
.panel {
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--gold);
    font-weight: 700;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 30px 0 60px;
    background: var(--footer-bg);
}

.footer-grid h4,
.footer-grid h3 {
    margin-top: 0;
}

.footer-grid a,
.footer-grid p {
    display: block;
    margin: 8px 0;
    color: var(--muted);
}

@media (max-width: 980px) {
    .hero-grid,
    .split-grid,
    .checkout-layout,
    .catalogue-layout,
    .product-view,
    .admin-edit-grid,
    .footer-grid,
    .commitment-grid,
    .stats-grid,
    .product-grid {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav,
    .nav-bar,
    .section-heading,
    .admin-topbar,
    .cart-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        display: none;
        width: 100%;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: var(--card-bg);
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: grid;
        grid-template-columns: 1fr;
    }

    .main-nav a,
    .main-nav button,
    .admin-actions .button,
    .hero-actions .button {
        width: 100%;
        justify-content: center;
    }

    .nav-bar {
        padding: 14px 0;
    }

    .brand {
        font-size: 1.7rem;
    }

    h1 {
        font-size: clamp(2.4rem, 11vw, 4rem);
        line-height: 1;
    }

    h2 {
        font-size: clamp(1.8rem, 8vw, 2.8rem);
    }

    .hero,
    .section {
        padding: 44px 0;
    }

    .hero {
        padding-top: 32px;
    }

    .hero-grid {
        min-height: auto;
        gap: 20px;
    }

    .hero-card,
    .product-body,
    .commitment-card,
    .panel,
    .auth-box,
    .checkout-summary,
    .checkout-form,
    .stat-card {
        padding: 20px;
    }

    .product-image-large {
        min-height: 360px;
    }

    .product-meta,
    .hero-actions,
    .admin-actions,
    .inline-form,
    .total-row {
        width: 100%;
    }

    .admin-actions {
        justify-content: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .cart-row > div:last-child {
        text-align: left;
    }

    .checkout-layout,
    .catalogue-layout,
    .product-view,
    .admin-edit-grid,
    .footer-grid {
        gap: 18px;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px 10px;
        white-space: nowrap;
    }

    .filters {
        position: static;
        padding: 14px;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 1180px);
    }

    .section-heading {
        margin-bottom: 20px;
    }

    .hero-card {
        min-height: 260px;
        padding: 22px;
    }

    .product-grid {
        gap: 18px;
    }

    .product-card,
    .commitment-card,
    .panel,
    .auth-box,
    .checkout-summary,
    .checkout-form,
    .stat-card,
    .empty-box {
        border-radius: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .flash {
        padding: 12px 14px;
    }

    input,
    textarea,
    select {
        padding: 13px 14px;
        border-radius: 16px;
    }
}
