/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Georgia', serif;
    background-color: #F5F0E8;
    color: #2C2C2C;
    line-height: 1.6;
}

a {
    color: #C8922A;
    text-decoration: none;
}

a:hover { color: #A67420; text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ───────────────────────────────────── */
header {
    background-color: #2C2C2C;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #C8922A;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #C8922A;
    letter-spacing: 1px;
    text-decoration: none;
}

header nav { display: flex; gap: 24px; align-items: center; }

header nav a {
    color: #F5F0E8;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}

header nav a:hover { color: #C8922A; text-decoration: none; }

.cart-icon {
    background-color: #C8922A;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.cart-icon:hover {
    background-color: #A67420 !important;
}

/* ── Footer ───────────────────────────────────── */
footer {
    background-color: #2C2C2C;
    color: #6B6B6B;
    text-align: center;
    padding: 24px;
    margin-top: 60px;
    font-size: 0.85rem;
    border-top: 3px solid #C8922A;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: #C8922A;
    color: #fff;
}

.btn-primary:hover {
    background-color: #A67420;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: #2C2C2C;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #444;
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background-color: #B85C4A;
    color: #fff;
}

.btn-danger:hover { background-color: #9a4a3a; color: #fff; }

.btn-small { padding: 6px 14px; font-size: 0.875rem; }

/* ── Alerts ───────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-error {
    background-color: #f9e8e6;
    border: 1px solid #B85C4A;
    color: #B85C4A;
}

.alert-success {
    background-color: #e6f0ea;
    border: 1px solid #4A7C59;
    color: #4A7C59;
}

/* ── Cards ────────────────────────────────────── */
.card {
    background-color: #fff;
    border: 1px solid #E0D8C8;
    border-radius: 6px;
    padding: 24px;
}

/* ── Product Grid ─────────────────────────────── */
.page-title {
    font-size: 1.8rem;
    margin: 36px 0 24px;
    color: #2C2C2C;
    border-bottom: 2px solid #C8922A;
    padding-bottom: 10px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.product-card {
    background-color: #fff;
    border: 1px solid #E0D8C8;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-card .product-info { padding: 16px; }

.product-card h3 { font-size: 1.1rem; margin-bottom: 6px; }

.product-card .price {
    font-size: 1.2rem;
    color: #C8922A;
    font-weight: bold;
    margin-bottom: 12px;
}

.out-of-stock {
    color: #B85C4A;
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Product Page ─────────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.product-detail img {
    border-radius: 6px;
    border: 1px solid #E0D8C8;
}

.product-detail .product-info h1 { font-size: 1.8rem; margin-bottom: 12px; }

.product-detail .price {
    font-size: 1.6rem;
    color: #C8922A;
    font-weight: bold;
    margin-bottom: 20px;
}

/* ── Forms ────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #2C2C2C;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E0D8C8;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #FDFAF5;
    color: #2C2C2C;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #C8922A;
}

.form-hint {
    font-size: 0.8rem;
    color: #6B6B6B;
    margin-top: 4px;
}

/* ── Cart Table ───────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }

.cart-table th {
    text-align: left;
    padding: 10px 12px;
    background-color: #2C2C2C;
    color: #F5F0E8;
    font-size: 0.9rem;
}

.cart-table td {
    padding: 12px;
    border-bottom: 1px solid #E0D8C8;
    vertical-align: middle;
}

.cart-table tr:last-child td { border-bottom: none; }

.cart-totals {
    text-align: right;
    font-size: 1rem;
    line-height: 2;
}

.cart-totals .total-line { font-size: 1.2rem; font-weight: bold; color: #C8922A; }

/* ── Checkout ─────────────────────────────────── */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin: 36px 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 16px;
    color: #2C2C2C;
    border-bottom: 1px solid #E0D8C8;
    padding-bottom: 8px;
}

.shipping-options { display: flex; flex-direction: column; gap: 10px; }

.shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #E0D8C8;
    border-radius: 4px;
    cursor: pointer;
    background-color: #FDFAF5;
}

.shipping-option input[type="radio"] { accent-color: #C8922A; }

/* ── Order Summary ────────────────────────────── */
.order-summary { background-color: #fff; border: 1px solid #E0D8C8; border-radius: 6px; padding: 20px; }

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #F5F0E8;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #C8922A;
    border-bottom: none;
    margin-top: 8px;
}

.summary-row.discount { color: #4A7C59; }

/* ── Referral Page ────────────────────────────── */
.referral-page {
    max-width: 480px;
    margin: 60px auto;
}

.code-display {
    background-color: #2C2C2C;
    color: #C8922A;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    padding: 24px;
    border-radius: 6px;
    margin: 20px 0;
}

.points-balance {
    font-size: 2rem;
    font-weight: bold;
    color: #C8922A;
    text-align: center;
    margin: 16px 0;
}

/* ── Confirmed Page ───────────────────────────── */
.confirmed-page { text-align: center; max-width: 560px; margin: 80px auto; }

.confirmed-icon { font-size: 4rem; margin-bottom: 20px; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
    .checkout-grid  { grid-template-columns: 1fr; }
}