:root {
    /* Tông màu Xanh Thảo Mộc chủ đạo */
    --primary-green: #2e7d32;
    --light-green: #4caf50;
    --urgent-red: #d50000;
    /* Dùng cho giá tiền */
    --warning-orange: #ff6d00;
    --bg-color: #f1f8e9;
    --white: #ffffff;
    --text-dark: #222;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    padding-bottom: 90px;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
}

/* HEADER XANH LÁ */
.header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: var(--white);
    padding: 20px 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.3rem;
    text-transform: uppercase;
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: 300;
    opacity: 0.9;
}

/* PROMO BAR */
.promo-bar {
    background: var(--warning-orange);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.promo-bar.success {
    background: linear-gradient(to right, #2e7d32, #43a047);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 8px;
}

/* PRODUCT LIST */
.group-title {
    margin: 20px 0 10px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-green);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #c8e6c9;
    padding-bottom: 5px;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.product-card.gift {
    background: #fff8e1;
    border: 1px solid #ffb300;
}

/* Badge Gift */
.badge-gift {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff6d00;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 8px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 12px;
}

.prod-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.prod-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1b5e20;
    flex: 1;
    line-height: 1.3;
}

.prod-date {
    font-size: 0.75rem;
    color: #388e3c;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
}

.prod-benefit {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: 10px;
}

.price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
}

.price-new {
    color: var(--urgent-red);
    font-weight: 800;
    font-size: 1.25rem;
}

.text-free {
    color: var(--warning-orange);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.6;
    }
}

/* Nút bấm */
.qty-control {
    display: flex;
    align-items: center;
    background: #f1f8e9;
    border-radius: 20px;
    padding: 2px;
    border: 1px solid #c8e6c9;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary-green);
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-btn:active {
    background: var(--primary-green);
    color: white;
}

.qty-btn:disabled {
    background: #e0e0e0;
    color: #bbb;
    cursor: not-allowed;
    box-shadow: none;
}

.qty-input {
    width: 35px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: bold;
    font-size: 1rem;
    color: var(--primary-green);
}

.gift-note {
    font-size: 0.8rem;
    color: #f57c00;
    font-style: italic;
}

/* BOTTOM BAR */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-box {
    display: flex;
    flex-direction: column;
}

.total-label {
    font-size: 0.75rem;
    color: #666;
}

.total-price {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--urgent-red);
}

.btn-order {
    background: linear-gradient(to right, #2e7d32, #1b5e20);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
    cursor: pointer;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal.open {
    display: flex;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.form-control {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-green);
    background: #f9fbe7;
}

textarea.form-control {
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--urgent-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 10px;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn-submit:disabled {
    background: #999;
    cursor: not-allowed;
}

/* GIFT SECTION IN MODAL */
#giftSection {
    background: #e8f5e9;
    border: 2px dashed #43a047;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: pulseGift 2s infinite;
}

@keyframes pulseGift {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.gift-label {
    font-weight: bold;
    color: var(--primary-green);
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.gift-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    font-size: 1rem;
    color: #1b5e20;
    background: #fff;
    outline: none;
    font-weight: bold;
}

/* SUCCESS POPUP */
.success-popup {
    display: none;
    position: fixed;
    z-index: 300;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-popup.show {
    display: block;
}

.success-icon {
    font-size: 4rem;
    color: var(--primary-green);
    margin-bottom: 15px;
    display: block;
}

.success-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.success-desc {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-close-success {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

@keyframes popIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    z-index: 400;
    display: none;
    text-align: center;
    font-size: 1rem;
}