*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --pink: #ff6b9d;
    --pink-dark: #e5537f;
    --yellow: #ffd93d;
    --green: #6bcb77;
    --bg: #fff8f0;
    --text: #2d2d2d;
    --muted: #777;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pink);
    text-decoration: none;
}
.cart-link {
    background: var(--pink);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.cart-link:hover { background: var(--pink-dark); }

/* Messages */
.messages { margin-top: 1rem; }
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-error { background: #f8d7da; color: #721c24; }

/* Product Grid */
.page-title { text-align: center; margin: 2rem 0 1rem; font-size: 2rem; }
.page-subtitle { text-align: center; color: var(--muted); margin-bottom: 2rem; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0 3rem;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.product-card .card-img {
    background: linear-gradient(135deg, #fff0f5, #ffe8d6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
}
.product-card .card-img img { max-width: 140px; height: auto; }

.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 0.3rem; }
.card-body .description { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-body .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}
.price { font-size: 1.3rem; font-weight: 700; color: var(--pink); }
.weight { font-size: 0.85rem; color: var(--muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}
.btn-primary { background: var(--pink); color: white; }
.btn-primary:hover { background: var(--pink-dark); }
.btn-secondary { background: #eee; color: var(--text); }
.btn-secondary:hover { background: #ddd; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem 0 3rem;
    align-items: start;
}
.product-detail .detail-img {
    background: linear-gradient(135deg, #fff0f5, #ffe8d6);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.product-detail .detail-img img { max-width: 250px; }
.product-detail .detail-info h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.product-detail .detail-info .price { font-size: 1.8rem; margin-bottom: 1rem; display: block; }
.product-detail .detail-info p { color: var(--muted); margin-bottom: 1.5rem; line-height: 1.8; }

/* Cart Table */
.cart-section { padding: 2rem 0 3rem; }

.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.cart-table th { text-align: left; padding: 0.8rem; border-bottom: 2px solid #eee; }
.cart-table td { padding: 0.8rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.cart-table .product-cell { display: flex; align-items: center; gap: 1rem; }
.cart-table .product-cell img { width: 50px; }
.cart-table .qty-input {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}
.cart-total {
    text-align: right;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.cart-actions { display: flex; justify-content: space-between; align-items: center; }

/* Checkout & Payment */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    padding: 2rem 0 3rem;
}
.form-section {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.form-section h2 { margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--pink); }

.order-summary {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    align-self: start;
}
.order-summary h2 { margin-bottom: 1rem; }
.summary-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; }
.summary-total { display: flex; justify-content: space-between; padding: 1rem 0 0; font-size: 1.3rem; font-weight: 700; }

/* Payment Error */
.payment-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Confirmation */
.confirmation {
    text-align: center;
    padding: 3rem 0;
}
.confirmation .check-icon {
    width: 80px;
    height: 80px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.confirmation h1 { color: var(--green); margin-bottom: 0.5rem; }
.confirmation .order-details {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-align: left;
}
.confirmation .order-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Empty state */
.empty-state { text-align: center; padding: 4rem 0; }
.empty-state h2 { margin-bottom: 1rem; color: var(--muted); }

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }
    .cart-table { font-size: 0.9rem; }
}
