/* ── Reset & Base ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream: #faf8f5;
    --cream-dark: #f3efe9;
    --sand: #e8e0d4;
    --gold: #d4a574;
    --gold-dark: #b8864e;
    --brown: #5c3d2e;
    --brown-light: #8b6f5e;
    --text: #2c2c2c;
    --text-light: #6b6b6b;
    --text-muted: #999;
    --white: #ffffff;
    --green: #4a8c5c;
    --red: #c0392b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.06);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Page ────────────────────────────────────── */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px 120px;
}

/* ── Header ──────────────────────────────────── */
.header {
    text-align: center;
    padding: 40px 0 20px;
}

.header__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.header__logo {
    width: 160px;
    height: auto;
}

.header__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--brown);
    letter-spacing: -0.01em;
}

.header__sub {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 2px;
}

/* ── Deadline ────────────────────────────────── */
.deadline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--sand);
    border-radius: 100px;
    padding: 8px 20px;
    margin-top: 20px;
    font-size: 0.85rem;
}

.deadline__label {
    color: var(--text-light);
}

.deadline__timer {
    font-weight: 600;
    color: var(--brown);
    font-variant-numeric: tabular-nums;
}

.deadline--urgent .deadline__timer {
    color: var(--red);
}

/* ── Sections ────────────────────────────────── */
.section {
    margin-top: 36px;
}

.section__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--brown);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 16px;
}

/* ── Product Card ────────────────────────────── */
.product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--white);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product:hover {
    border-color: var(--sand);
    box-shadow: var(--shadow);
}

.product.active {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), var(--shadow);
}

.product__info {
    flex: 1;
    min-width: 0;
}

.product__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.3;
}

.product__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.product__price {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold-dark);
}

.product__unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Quantity Stepper ────────────────────────── */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.stepper__btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--sand);
    background: var(--cream);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
}

.stepper__btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.stepper__btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.stepper__btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}

.stepper__btn:active {
    transform: scale(0.95);
}

.stepper__btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
}

.stepper__btn:disabled:hover {
    background: var(--cream);
    border-color: var(--sand);
    color: var(--text);
}

.stepper__val {
    width: 44px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--sand);
    border-bottom: 1px solid var(--sand);
    background: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

/* ── Contact ─────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 540px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    .contact-grid .field:first-child {
        grid-column: 1 / -1;
    }
}

.field {}

.label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.req { color: var(--red); }

.input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sand);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.input--textarea {
    resize: vertical;
    min-height: 70px;
}

.input--error {
    border-color: var(--red);
}

.field__error {
    font-size: 0.8rem;
    color: var(--red);
    margin-top: 4px;
    display: none;
}

.field--invalid .field__error {
    display: block;
}

/* ── Summary (Sticky) ────────────────────────── */
.summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    border-top: 1px solid var(--sand);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    padding: 14px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.summary.visible {
    transform: translateY(0);
}

.summary__inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.summary__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.summary__count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary__total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ── Button ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--gold);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    min-height: 46px;
}

.btn:hover {
    background: var(--gold-dark);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn--loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Success ─────────────────────────────────── */
.success {
    text-align: center;
    padding: 60px 20px;
}

.success__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green);
    color: var(--white);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--brown);
    margin-bottom: 8px;
}

.success__number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 12px;
}

.success__msg {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

.success__payment {
    margin-top: 20px;
    display: inline-block;
    padding: 8px 20px;
    background: var(--cream-dark);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brown-light);
}

/* ── Closed ──────────────────────────────────── */
.closed {
    text-align: center;
    padding: 80px 20px;
}

.closed__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--brown);
    margin-bottom: 12px;
}

.closed__msg {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── Footer ──────────────────────────────────── */
.footer {
    text-align: center;
    padding: 30px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Error Toast ─────────────────────────────── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: var(--red);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
    .header__title { font-size: 1.6rem; }
    .header__logo { width: 120px; }
    .product { padding: 12px; gap: 10px; }
    .product__name { font-size: 0.88rem; }
    .stepper__btn { width: 32px; height: 32px; }
    .stepper__val { width: 38px; height: 32px; font-size: 0.88rem; }
    .summary__total { font-size: 1.1rem; }
    .btn { padding: 11px 20px; font-size: 0.88rem; }
}
