:root {
    --primary: #f59e0b; --primary-dark: #d97706; --secondary: #442e66;
    --text-main: #1f2937; --text-muted: #6b7280; --bg-main: #f9fafb; --bg-card: #ffffff;
    --danger: #ef4444; --success: #10b981; --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background-color: #e5e7eb; color: var(--text-main); line-height: 1.5; display: flex; justify-content: center; }
.mobile-container { width: 100%; max-width: 480px; background: var(--bg-main); min-height: 100vh; box-shadow: 0 0 20px rgba(0,0,0,0.1); position: relative; overflow-x: hidden; }
.pb-sticky { padding-bottom: 80px; }

/* Header & Banner */
.header { position: relative; background: #fff; }
.badge-freeship-static {
    position: absolute; top: 15px; right: 0; background: var(--primary); color: #fff;
    padding: 6px 15px 6px 20px; font-weight: 700; font-size: 13px; z-index: 10;
    border-radius: 20px 0 0 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex; align-items: center; gap: 5px; animation: pulse 2s infinite;
}
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

.swiper { width: 100%; aspect-ratio: 1/1; }
.swiper-slide { display: flex; align-items: center; justify-content: center; background: #f8f8f8; }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.swiper-pagination-bullet-active { background: var(--primary) !important; }

/* Flash Sale */
.flash-sale { background: #fff; border-bottom: 1px solid var(--border); }
.flash-header { background: linear-gradient(90deg, #ef4444, #f97316); color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; }
.flash-title { font-weight: 700; font-size: 14px; }
.countdown { background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 14px; font-family: monospace; }
.product-pricing { padding: 15px 20px; }
.product-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.price-box { display: flex; align-items: baseline; gap: 15px; margin-bottom: 15px; }
.current-price { color: var(--danger); font-size: 14px; font-weight: 600; }
.current-price span { font-size: 24px; font-weight: 700; }
.original-price { color: var(--text-muted); font-size: 14px; }
.stock-progress { background: #fee2e2; border-radius: 10px; padding: 2px; position: relative; height: 20px; }
.stock-text { position: absolute; width: 100%; text-align: center; color: #7f1d1d; font-size: 11px; font-weight: 700; line-height: 16px; z-index: 2; }
.progress-bar { width: 100%; height: 100%; border-radius: 8px; overflow: hidden; position: relative; }
.progress-fill { background: linear-gradient(90deg, #f87171, #ef4444); height: 100%; border-radius: 8px; }

/* Instructions */
.instructions-section { padding: 25px 20px; background: #fff; margin-top: 10px; border-bottom: 1px solid var(--border); }
.section-title { font-size: 16px; color: var(--secondary); text-align: center; font-weight: 700; margin-bottom: 20px; }
.zalo-contact { background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px; margin-bottom: 20px; text-align: center; color: #0369a1; }
.zalo-contact strong { font-size: 16px; display: block; margin-bottom: 5px; color: #0284c7; }
.zalo-contact p { font-size: 13px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: #e5e7eb; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-icon { position: absolute; left: -20px; top: 0; width: 18px; height: 18px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; z-index: 1; box-shadow: 0 0 0 4px #fff; }
.timeline-content { padding-left: 15px; }
.timeline-content h3 { font-size: 15px; color: var(--text-main); margin-bottom: 5px; }
.timeline-content p, .timeline-content ul { font-size: 14px; color: var(--text-muted); }
.timeline-content ul { padding-left: 15px; list-style-type: disc; }
.timeline-content .note { color: var(--danger); font-style: italic; font-size: 13px; margin-top: 5px; list-style-type: none; margin-left: -15px; }

/* Sticky Bottom Bar */
.sticky-bottom-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); padding: 12px 20px;
    display: flex; justify-content: space-between; align-items: center; z-index: 90;
}
.price-summary { display: flex; flex-direction: column; }
.price-summary .text { font-size: 12px; color: var(--text-muted); }
.price-summary .price { font-size: 20px; font-weight: 700; color: var(--danger); line-height: 1.1; }
.btn-buy-now {
    background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff;
    border: none; padding: 12px 30px; border-radius: 30px; font-weight: 700;
    font-size: 16px; box-shadow: 0 4px 10px rgba(239,68,68,0.3);
    cursor: pointer; animation: pulse 2s infinite;
}

/* Bottom Sheet Modal */
.bottom-sheet-overlay {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 100%; background: rgba(0,0,0,0.5); z-index: 100;
    display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet-content { background: #fff; width: 100%; border-radius: 20px 20px 0 0; max-height: 85vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.2, 1); }
.bottom-sheet-overlay.active .bottom-sheet-content { transform: translateY(0); }
.sheet-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.sheet-header h3 { font-size: 16px; color: var(--secondary); font-weight: 700; }
.btn-close-sheet { background: transparent; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.sheet-body { padding: 20px; overflow-y: auto; }

/* Radio Cards (Product Selection) */
.product-cards { display: flex; flex-direction: column; gap: 10px; }
.product-card { position: relative; cursor: pointer; display: block; }
.product-card input[type="radio"] { position: absolute; opacity: 0; }
.card-content { border: 2px solid var(--border); border-radius: 12px; padding: 15px; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; background: #fff; }
.card-title { font-weight: 600; color: var(--text-main); font-size: 15px; display: flex; align-items: center; gap: 5px; }
.badge-hot { background: var(--danger); color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 4px; }
.card-prices { text-align: right; }
.card-price { display: block; font-weight: 700; color: var(--danger); font-size: 15px; }
.card-old-price { font-size: 12px; color: var(--text-muted); }
.check-icon { display: none; background: var(--success); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; align-items: center; justify-content: center; position: absolute; top: -8px; right: -8px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.product-card input[type="radio"]:checked + .card-content { border-color: var(--primary); background: #fffbeb; box-shadow: 0 2px 8px rgba(245,158,11,0.1); }
.product-card input[type="radio"]:checked + .card-content .check-icon { display: flex; }

/* Form General */
.form-group { margin-bottom: 18px; position: relative; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #374151; }
.required { color: var(--danger); }
input[type="text"], input[type="tel"], input[type="number"], select { width: 100%; padding: 12px 15px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; outline: none; transition: all 0.2s; background: #f9fafb; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; background-size: 20px; padding-right: 40px; }
input:focus, select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1); }
select:disabled { background-color: #e5e7eb; cursor: not-allowed; opacity: 0.7; }
.address-group select { margin-bottom: 10px; }
input.is-invalid { border-color: var(--danger); background: #fef2f2; }
input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.error-message { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
input.is-invalid + .error-message { display: block; }
.qty-control { display: flex; align-items: center; }
.btn-qty { width: 44px; height: 44px; background: #f3f4f6; border: 1px solid #d1d5db; font-size: 20px; font-weight: bold; color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-qty:first-child { border-radius: 8px 0 0 8px; }
.btn-qty:last-child { border-radius: 0 8px 8px 0; }
#quantity { width: 60px; height: 44px; border-radius: 0; border-left: 0; border-right: 0; text-align: center; padding: 0; background: #fff; pointer-events: none;}

/* Freeship Button in Form */
.btn-freeship { width: 100%; background: #fff; border: 2px dashed var(--primary); color: var(--primary-dark); font-weight: 700; font-size: 15px; padding: 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; animation: pulse 2s infinite;}
.btn-freeship .fs-limit { font-size: 12px; font-weight: normal; color: var(--text-muted); }
.btn-freeship.saved { background: var(--success); border-color: var(--success); color: #fff; animation: none; pointer-events: none;}
.btn-freeship.saved .fs-limit { color: #d1fae5; }

/* Summary Box */
.summary-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 15px; margin-top: 25px; margin-bottom: 25px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.summary-row:last-child { margin-bottom: 0; padding-top: 10px; border-top: 1px dashed #fcd34d; }
.ship-fee { color: var(--text-main); font-weight: 600; }
.ship-fee.free { color: var(--success); }
.total-row { font-weight: 700; font-size: 16px; }
#totalPriceDisplay { color: var(--danger); font-size: 20px; }
.btn-submit { width: 100%; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; padding: 15px; border: none; border-radius: 30px; cursor: pointer; text-transform: uppercase; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #10b981; color: #fff; padding: 12px 20px; border-radius: 30px; font-weight: 600; font-size: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 3000; opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); text-align: center; width: 90%; max-width: 400px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Overlays & Modals */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f4f6; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.modal { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: #fff; padding: 30px 20px; border-radius: 16px; text-align: center; width: 100%; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.success-icon { font-size: 50px; color: var(--success); margin-bottom: 15px; }
.btn-close { background: var(--primary); color: #fff; border: none; padding: 10px 30px; border-radius: 20px; font-weight: 600; cursor: pointer; margin-top: 15px;}
.confirm-box { text-align: left; padding: 25px 20px;}
.confirm-box h3 { text-align: center; color: var(--secondary); margin-bottom: 5px; }
.confirm-desc { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.4;}
.confirm-details p { font-size: 14px; margin-bottom: 10px; color: #374151; }
.confirm-details strong { color: #111827; display: inline-block; width: 85px;}
.confirm-details hr { margin: 15px 0; border: none; border-top: 1px dashed #e5e7eb; }
.conf-total { font-size: 16px !important; }
.conf-total span { color: var(--danger); font-weight: bold; font-size: 18px;}
.modal-actions { display: flex; gap: 10px; margin-top: 25px; }
.modal-actions button { flex: 1; padding: 12px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: #f3f4f6; color: var(--text-muted); }
.btn-confirm { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); }
