:root {
    color-scheme: light;
    --bg: #101418;
    --surface: #ffffff;
    --ink: #18212f;
    --muted: #687386;
    --line: #dfe4ea;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #eab308;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.22));
    background-position: 0 0, 0 8px, 8px -8px, -8px 0, 0 0;
    background-size: 16px 16px, 16px 16px, 16px 16px, 16px 16px, 100% 100%;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.site-header,
.site-footer {
    color: #dce5e8;
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1120px;
    padding: 22px 24px;
}

.brand {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
}

.brand img {
    display: block;
    height: 42px;
    width: auto;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.nav a {
    color: #dce5e8;
    font-weight: 700;
}

.section-heading a {
    color: var(--muted);
    font-weight: 700;
}

.page {
    margin: 0 auto;
    max-width: 1120px;
    min-height: calc(100vh - 154px);
    padding: 12px 24px 48px;
}

.hero {
    align-items: center;
    background: linear-gradient(135deg, #0f766e, #154360);
    border-radius: 8px;
    color: #fff;
    display: grid;
    min-height: 320px;
    padding: 48px;
}

.hero h1,
.section h1,
.product-detail h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.05;
    margin: 0 0 18px;
    max-width: 780px;
}

.hero p {
    max-width: 620px;
}

.eyebrow {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.section {
    padding: 42px 0 0;
}

.section-heading {
    align-items: end;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
}

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

.product-card,
.empty-state,
.cart-item,
.cart-summary,
.admin-stats > div,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.product-card {
    overflow: hidden;
}

.product-media,
.product-visual {
    align-items: center;
    background: #e0f2f1;
    color: var(--primary-dark);
    display: flex;
    font-size: 54px;
    font-weight: 800;
    justify-content: center;
}

.product-media {
    aspect-ratio: 4 / 3;
}

.product-body {
    padding: 18px;
}

.product-body h3,
.cart-item h3 {
    margin: 8px 0;
}

.product-body p,
.cart-item p,
.empty-state p {
    color: var(--muted);
    margin: 0 0 16px;
}

.tag {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.product-actions,
.cart-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.button,
button {
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    padding: 11px 16px;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #edf7f6;
    color: var(--primary-dark);
}

.product-detail {
    align-items: center;
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(240px, 420px) 1fr;
    padding: 42px 0;
}

.product-visual {
    aspect-ratio: 1;
    border-radius: 8px;
}

.price {
    font-size: 28px;
    font-weight: 800;
}

.empty-state {
    padding: 34px;
    text-align: center;
}

.cart-list {
    display: grid;
    gap: 12px;
}

.cart-item,
.cart-summary {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 18px;
}

.text-button {
    background: transparent;
    color: #b42318;
    padding: 0;
}

.text-button:hover {
    background: transparent;
    color: #7a271a;
}

.cart-summary {
    font-size: 22px;
    margin-top: 18px;
}

.admin-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.admin-stats > div {
    padding: 20px;
}

.admin-stats span {
    color: var(--muted);
    display: block;
}

.admin-stats strong {
    font-size: 34px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 620px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 720px) {
    .site-header,
    .site-footer,
    .section-heading,
    .cart-item,
    .cart-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding: 30px;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }
}

.product-meta,
.product-data,
.small-note {
    color: var(--muted);
    font-size: 14px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.product-data {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.product-data div,
.summary-line,
.summary-total {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.product-data dt {
    font-weight: 800;
}

.product-data dd {
    margin: 0;
}

.inline-form,
.form-panel {
    display: grid;
    gap: 14px;
}

.inline-form {
    align-items: end;
    grid-template-columns: 100px auto;
    justify-content: start;
}

.form-panel,
.summary-panel,
.legal-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.form-panel label,
.inline-form label {
    color: var(--muted);
    display: grid;
    font-weight: 700;
    gap: 6px;
}

input,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.qty-input {
    max-width: 100px;
}

.checkout-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 360px;
}

.summary-panel {
    align-self: start;
}

.summary-line,
.summary-total {
    border-bottom: 1px solid var(--line);
    gap: 16px;
    padding: 12px 0;
}

.summary-total {
    border-bottom: 0;
    font-size: 22px;
}

.checkout-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.auth-page {
    display: grid;
    min-height: 55vh;
    place-items: center;
}

.auth-panel {
    max-width: 420px;
    width: 100%;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.alert p {
    margin: 0;
}

.alert.error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #7a271a;
}

.footer-nav {
    display: flex;
    gap: 14px;
}

.legal-page {
    margin-top: 42px;
}

.legal-page h1 {
    margin-top: 0;
}

@media (max-width: 860px) {
    .checkout-layout,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .checkout-actions {
        justify-content: stretch;
    }
}

.header-actions {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 18px;
    justify-content: flex-end;
    min-width: 0;
}

.brand img {
    height: 84px;
    max-width: min(340px, 42vw);
}

.header-search {
    align-items: center;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 0 44px;
    justify-content: end;
    overflow: hidden;
    transition: grid-template-columns 180ms ease;
}

.header-search.is-open,
.header-search:focus-within {
    grid-template-columns: minmax(180px, 260px) 44px;
}

.header-search-input {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px 0 0 6px;
    height: 44px;
    min-width: 0;
    opacity: 0;
    padding: 0 12px;
    transform: translateX(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.header-search.is-open .header-search-input,
.header-search:focus-within .header-search-input {
    opacity: 1;
    transform: translateX(0);
}

.search-toggle {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    padding: 0;
}

.header-search.is-open .search-toggle,
.header-search:focus-within .search-toggle {
    border-radius: 0 6px 6px 0;
}

.search-toggle:hover,
.search-toggle:focus-visible {
    background: var(--primary);
}

.section-note {
    color: var(--muted);
    margin: 8px 0 0;
}

@media (max-width: 920px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .header-actions {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .header-search,
    .header-search.is-open,
    .header-search:focus-within {
        grid-template-columns: minmax(0, 1fr) 44px;
        width: 100%;
    }

    .header-search-input {
        opacity: 1;
        transform: none;
    }
}
