:root {
    --primary: #f45b7a;
    --secondary: #18a999;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --paper: #fffaf3;
    --blue: #2563eb;
    --amber: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

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

button,
input,
select {
    font: inherit;
}

button,
.download-link,
.ghost-button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px clamp(14px, 4vw, 36px);
    background: rgba(255, 250, 243, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nav a,
.nav button,
.ghost-button {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.page,
.admin-page {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero > div,
.offer-card,
.login-box,
.cart-panel,
.account-panel,
.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.hero > div {
    padding: clamp(28px, 6vw, 72px);
    background:
        linear-gradient(135deg, rgba(244, 91, 122, .13), transparent 45%),
        linear-gradient(315deg, rgba(24, 169, 153, .14), transparent 42%),
        #fff;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(30px, 5vw, 58px);
}

h2 {
    font-size: 24px;
}

.hero p,
.section-head p,
.product-card span,
.offer-card span,
.file-card small {
    color: var(--muted);
    line-height: 1.45;
}

.offer-card {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 12px;
    padding: 14px;
    align-items: center;
}

.offer-card img {
    width: 116px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    object-fit: cover;
}

.offer-card strong,
.offer-card span,
.offer-card b {
    display: block;
}

.offer-card b {
    color: var(--primary);
    font-size: 24px;
}

.offer-card button,
.product-card button,
.login-box button,
#checkoutButton,
.bulk-button,
.admin-card button {
    padding: 12px 16px;
    color: #fff;
    background: var(--primary);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
    gap: 14px;
}

.product-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.product-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f8fafc;
}

.product-body {
    padding: 12px;
}

.product-body strong {
    display: block;
    min-height: 42px;
}

.product-body span {
    display: block;
    margin-top: 8px;
    font-size: 14px;
}

.product-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.product-buy b {
    color: var(--blue);
}

.login-box {
    width: min(520px, 100%);
    margin: 42px auto;
    padding: 22px;
}

.login-box label,
.checkout-box label,
.admin-card label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 700;
}

.login-box input,
.checkout-box input,
.admin-card input,
.release-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.login-box button,
.checkout-box button {
    width: 100%;
    margin-top: 14px;
}

.form-error {
    color: #be123c;
    font-weight: 700;
}

.account-panel,
.cart-panel,
.admin-card {
    padding: 18px;
}

.bulk-button {
    margin-bottom: 14px;
    background: var(--secondary);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.file-card {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.file-card img {
    width: 68px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    object-fit: cover;
}

.download-link {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--blue);
}

.empty-state,
.notice {
    padding: 14px;
    border-radius: 8px;
    background: #ecfeff;
    color: #155e75;
    font-weight: 700;
}

.cart-items {
    display: grid;
    gap: 10px;
}

.cart-item,
.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.cart-item button {
    padding: 8px 10px;
    background: #fee2e2;
    color: #991b1b;
}

.cart-total {
    margin-top: 12px;
    font-size: 20px;
}

.checkout-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed var(--amber);
    border-radius: 8px;
    background: #fffbeb;
}

#checkoutMessage {
    color: var(--muted);
    font-weight: 700;
}

.admin-page {
    max-width: 1180px;
}

.admin-products {
    display: grid;
    gap: 12px;
}

.admin-product {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-product img {
    width: 96px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
}

.admin-row,
.release-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-actions,
.admin-checks {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-fields .wide {
    grid-column: 1 / -1;
}

.admin-checks {
    margin: 12px 0;
}

.admin-checks label,
.admin-note p {
    margin: 0;
}

.admin-checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.admin-card input[type="checkbox"] {
    width: auto;
    min-height: 0;
    padding: 0;
}

.admin-card input[type="file"] {
    padding: 8px;
}

.product-create-form {
    display: grid;
    gap: 12px;
}

.admin-product-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.admin-note {
    display: grid;
    gap: 6px;
    border-color: rgba(24, 169, 153, .35);
    background: #ecfeff;
}

.admin-table {
    overflow: auto;
}

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

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

code {
    padding: 2px 5px;
    border-radius: 6px;
    background: #f1f5f9;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        justify-content: flex-start;
        width: 100%;
    }

    .nav a,
    .nav button {
        flex: 1 1 auto;
        text-align: center;
    }

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

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

    .product-body strong {
        font-size: 14px;
    }

    .product-body span {
        font-size: 12px;
    }

    .product-buy {
        align-items: stretch;
        flex-direction: column;
    }

    .section-head,
    .cart-item,
    .cart-total {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-actions {
        width: 100%;
    }

    .admin-actions .ghost-button {
        flex: 1 1 auto;
        text-align: center;
    }

    .admin-product {
        grid-template-columns: 72px 1fr;
    }

    .admin-product img {
        width: 72px;
    }
}
