:root {
    --primary: #8b7355;
    --primary-light: #d4c4b5;
    --primary-dark: #6b5a47;
    --secondary: #a08070;
    --bg: #faf8f5;
    --text: #333;
    --gray: #999;
    --border: #e8e0d8;
    --success: #4caf50;
    --warning: #ff9800;
    --red: #e57373;
    --green: #81c784;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }

.header { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 15px 0; position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: bold; }
.logo-icon { font-size: 30px; margin-right: 5px; }
.nav { display: flex; gap: 25px; }
.nav a { color: rgba(255,255,255,0.9); font-size: 15px; }
.nav a:hover, .nav a.active { color: white; font-weight: bold; }
.user-actions { display: flex; align-items: center; gap: 15px; }
.user-actions a { color: rgba(255,255,255,0.9); font-size: 14px; }
.cart-icon { position: relative; font-size: 24px; cursor: pointer; }
.cart-count { position: absolute; top: -8px; right: -10px; background: var(--red); color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 12px; }

.banner { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; padding: 80px 0; text-align: center; }
.banner h1 { font-size: 42px; margin-bottom: 15px; }
.banner p { font-size: 20px; opacity: 0.9; margin-bottom: 30px; }
.banner-btn { display: inline-block; background: white; color: var(--primary); padding: 15px 50px; border-radius: 30px; font-weight: bold; font-size: 16px; }

.categories { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 40px 0; }
.category-btn { background: white; border: 2px solid var(--primary-light); padding: 12px 25px; border-radius: 25px; font-size: 14px; color: var(--primary); transition: all 0.3s; }
.category-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin: 20px 0; }
.product-card { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(139,115,85,0.1); cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(139,115,85,0.2); }
.product-image { height: 200px; background: linear-gradient(135deg, #f5f0eb, #e8e0d8); display: flex; align-items: center; justify-content: center; font-size: 80px; position: relative; }
.product-tag { position: absolute; top: 12px; left: 12px; background: var(--primary); color: white; padding: 5px 12px; border-radius: 12px; font-size: 12px; }
.product-tag.new { background: var(--secondary); }
.product-info { padding: 18px; }
.product-category { color: var(--primary); font-size: 13px; margin-bottom: 8px; }
.product-title { font-size: 17px; margin-bottom: 6px; color: var(--text); }
.product-desc { color: var(--gray); font-size: 13px; margin-bottom: 12px; }
.product-price { display: flex; justify-content: space-between; align-items: center; }
.price-left { display: flex; align-items: baseline; gap: 8px; }
.price-current { color: var(--primary); font-size: 22px; font-weight: bold; }
.price-original { color: var(--gray); font-size: 14px; text-decoration: line-through; }
.btn-add-cart { background: var(--primary); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; transition: background 0.3s; }
.btn-add-cart:hover { background: var(--primary-dark); }

.footer { background: linear-gradient(135deg, var(--primary-dark), var(--secondary)); color: white; padding: 50px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-section h4 { font-size: 18px; margin-bottom: 15px; }
.footer-section p, .footer-section a { color: rgba(255,255,255,0.8); font-size: 14px; line-height: 2; display: block; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.6); font-size: 13px; }

/* Detail Page */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin: 40px 0; background: white; padding: 40px; border-radius: 20px; }
.detail-image { background: linear-gradient(135deg, #f5f0eb, #e8e0d8); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 150px; min-height: 400px; }
.detail-info h1 { font-size: 28px; margin-bottom: 15px; }
.detail-tags { display: flex; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.detail-tag { background: var(--primary-light); color: var(--primary); padding: 5px 15px; border-radius: 15px; font-size: 13px; }
.detail-price-box { background: linear-gradient(135deg, #f5f0eb, #faf8f5); padding: 20px; border-radius: 15px; margin: 20px 0; }
.detail-price { display: flex; align-items: center; gap: 15px; }
.detail-price .price-current { font-size: 32px; }
.weight-selector, .quantity-selector { margin: 25px 0; display: flex; align-items: center; gap: 15px; }
.weight-selector label, .quantity-selector label { font-weight: bold; color: var(--text); }
.weight-options { display: flex; gap: 10px; }
.weight-option { padding: 10px 20px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; }
.weight-option.selected { border-color: var(--primary); background: var(--primary-light); }
.quantity-selector button { width: 40px; height: 40px; border: 2px solid var(--border); background: white; border-radius: 8px; font-size: 18px; cursor: pointer; }
.quantity-selector input { width: 60px; height: 40px; text-align: center; border: 2px solid var(--border); border-radius: 8px; font-size: 16px; }
.detail-actions { display: flex; gap: 15px; margin-top: 30px; }
.btn-buy-now { flex: 1; background: var(--primary); color: white; border: none; padding: 18px; border-radius: 30px; font-size: 18px; cursor: pointer; }
.btn-add-cart-detail { flex: 1; background: var(--secondary); color: white; border: none; padding: 18px; border-radius: 30px; font-size: 18px; cursor: pointer; }

/* Cart Page */
.cart-empty { text-align: center; padding: 100px 0; }
.cart-list { background: white; border-radius: 16px; overflow: hidden; }
.cart-header { display: grid; grid-template-columns: 50px 2fr 1fr 1fr 1fr 80px; padding: 20px; background: #f8f8f8; font-weight: bold; gap: 15px; align-items: center; }
.cart-item { display: grid; grid-template-columns: 50px 2fr 1fr 1fr 1fr 80px; padding: 20px; border-bottom: 1px solid var(--border); gap: 15px; align-items: center; }
.cart-item-info { display: flex; gap: 15px; cursor: pointer; }
.cart-item-icon { font-size: 40px; }
.cart-item-name { font-weight: bold; }
.cart-item-weight { color: var(--gray); font-size: 13px; }
.cart-item-quantity button { width: 30px; height: 30px; border: 1px solid var(--border); background: white; border-radius: 5px; cursor: pointer; }
.cart-item-quantity input { width: 50px; height: 30px; text-align: center; border: 1px solid var(--border); margin: 0 5px; }
.cart-item-subtotal { color: var(--primary); font-weight: bold; font-size: 18px; }
.cart-item-action button { color: var(--red); background: none; border: none; cursor: pointer; }
.cart-summary { background: white; padding: 25px; border-radius: 16px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; }
.summary-left { display: flex; align-items: center; }
.summary-right { display: flex; align-items: center; gap: 25px; }
.summary-info { text-align: right; }
.summary-total { color: var(--primary); font-size: 28px; font-weight: bold; }
.btn-checkout { background: var(--primary); color: white; border: none; padding: 18px 50px; border-radius: 30px; font-size: 18px; cursor: pointer; }

/* Checkout Page */
.checkout-section { background: white; border-radius: 16px; padding: 25px; margin: 20px 0; }
.checkout-section h3 { margin-bottom: 20px; font-size: 18px; }
.address-card { display: flex; justify-content: space-between; padding: 20px; border: 2px solid var(--border); border-radius: 12px; margin-bottom: 15px; cursor: pointer; }
.address-card.selected { border-color: var(--primary); background: var(--primary-light); }
.address-default { color: var(--primary); font-size: 13px; }
.delivery-options, .payment-options { display: flex; flex-direction: column; gap: 12px; }
.delivery-option, .payment-option { padding: 15px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.delivery-option.selected, .payment-option.selected { border-color: var(--primary); background: var(--primary-light); }
.order-items { display: flex; flex-direction: column; gap: 15px; }
.order-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: #f8f8f8; border-radius: 12px; }
.order-item-icon { font-size: 40px; }
.order-item-info { flex: 1; }
.order-item-name { font-weight: bold; }
.order-item-weight { color: var(--gray); font-size: 13px; }
.order-item-price { color: var(--gray); }
.order-item-quantity { color: var(--gray); }
.order-item-subtotal { color: var(--primary); font-weight: bold; font-size: 18px; }
textarea { width: 100%; border: 2px solid var(--border); border-radius: 12px; padding: 15px; font-size: 15px; resize: none; }
.order-summary { background: white; border-radius: 16px; padding: 25px; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.summary-row.total { font-size: 20px; font-weight: bold; color: var(--primary); border-bottom: none; margin-top: 10px; }
.checkout-footer { position: fixed; bottom: 0; left: 0; right: 0; background: white; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); padding: 15px 0; z-index: 100; }
.checkout-footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-total { font-size: 20px; }
.footer-total span { color: var(--primary); font-weight: bold; font-size: 28px; }
.btn-submit-order { background: var(--primary); color: white; border: none; padding: 18px 60px; border-radius: 30px; font-size: 18px; cursor: pointer; }

/* Payment Page */
.payment-box { background: white; border-radius: 20px; padding: 30px; margin: 30px 0; }
.payment-header { text-align: center; padding-bottom: 25px; border-bottom: 2px dashed var(--border); }
.payment-order-info p { margin: 10px 0; color: var(--gray); }
.payment-amount { color: var(--primary); font-size: 36px; font-weight: bold; }
.payment-timer { text-align: center; padding: 25px 0; }
.payment-timer p { color: var(--warning); font-size: 18px; margin-bottom: 15px; }
.timer-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.timer-progress { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 100%; transition: width 1s linear; }
.payment-methods h3 { margin-bottom: 20px; }
.payment-method { display: flex; align-items: center; padding: 20px; border: 2px solid var(--border); border-radius: 12px; margin-bottom: 15px; cursor: pointer; }
.payment-method.selected { border-color: var(--primary); background: var(--primary-light); }
.method-icon { font-size: 40px; margin-right: 15px; }
.method-info { flex: 1; }
.method-name { font-weight: bold; font-size: 17px; }
.method-desc { color: var(--gray); font-size: 13px; }
.method-check { font-size: 24px; color: var(--primary); display: none; }
.payment-method.selected .method-check { display: block; }
.payment-actions { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }
.btn-confirm-pay { background: var(--primary); color: white; border: none; padding: 18px; border-radius: 30px; font-size: 18px; cursor: pointer; }
.btn-cancel-pay { background: white; color: var(--gray); border: 2px solid var(--border); padding: 18px; border-radius: 30px; font-size: 18px; cursor: pointer; }
.payment-qr { text-align: center; padding: 50px 0; }
.payment-qr h3 { margin-bottom: 30px; }
.qr-code { background: white; padding: 30px; border-radius: 20px; display: inline-block; }

/* Order Confirm */
.order-success { text-align: center; padding: 60px 0; }
.success-icon { width: 100px; height: 100px; background: linear-gradient(135deg, var(--success), #81c784); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 50px; color: white; margin: 0 auto 30px; }
.order-success h1 { font-size: 32px; color: var(--success); margin-bottom: 10px; }
.success-desc { color: var(--gray); font-size: 18px; margin-bottom: 40px; }
.order-detail-card { background: white; border-radius: 16px; padding: 30px; text-align: left; max-width: 500px; margin: 0 auto 30px; }
.detail-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail-divider { height: 1px; background: var(--border); margin: 15px 0; }
.success-actions { margin-top: 30px; }

/* Auth Pages */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; padding: 30px; }
.auth-container { width: 100%; max-width: 450px; }
.auth-logo { text-align: center; color: white; font-size: 32px; font-weight: bold; margin-bottom: 30px; }
.auth-logo .logo-icon { font-size: 50px; }
.auth-form { background: white; border-radius: 24px; padding: 40px; }
.auth-form h2 { text-align: center; margin-bottom: 30px; color: var(--text); }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text); }
.form-group input { width: 100%; padding: 14px 18px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; }
.form-group input:focus { border-color: var(--primary); outline: none; }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 14px; }
.code-input { display: flex; gap: 12px; }
.code-input input { flex: 1; }
.btn-get-code { background: var(--primary-light); color: var(--primary); border: none; padding: 14px 20px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.btn-auth { width: 100%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border: none; padding: 16px; border-radius: 30px; font-size: 18px; cursor: pointer; margin-top: 10px; }
.auth-divider { text-align: center; margin: 25px 0; position: relative; }
.auth-divider span { background: white; padding: 0 15px; color: var(--gray); position: relative; z-index: 1; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.other-login { display: flex; justify-content: center; gap: 15px; }
.btn-other-login { background: #f0f0f0; border: none; padding: 12px 30px; border-radius: 25px; cursor: pointer; font-size: 14px; }
.auth-footer { text-align: center; margin-top: 25px; color: var(--gray); }

/* Toast */
.toast { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: white; padding: 15px 35px; border-radius: 30px; z-index: 1000; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 768px) {
    .header .container { flex-wrap: wrap; }
    .nav { display: none; }
    .product-detail { grid-template-columns: 1fr; }
    .cart-header, .cart-item { grid-template-columns: 40px 1fr 80px; }
    .cart-header > *:nth-child(3), .cart-header > *:nth-child(4), .cart-item > *:nth-child(3), .cart-item > *:nth-child(4) { display: none; }
}
