/* === General Styling & Variables === */
:root {
    --primary-color: #0369A1;
    --primary-hover: #0284C7;
    --primary-light: rgba(3, 105, 161, 0.1);
    --primary-glow: rgba(3, 105, 161, 0.15);
    --text-color: #020617;
    --text-secondary: #334155;
    --label-color: #475569;
    --border-color: #cbd5e1;
    --border-light: #e2e8f0;
    --background-color: #F8FAFC;
    --form-bg-color: #ffffff;
    --error-color: #ef4444;
    --error-bg: #fef2f2;
    --combo-color: #ea580c;
    --combo-bg: #ffedd5;
    --font-family: 'Nunito Sans', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 2rem 1rem;
}

/* === Focus Styles (Accessibility) === */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

input[type="checkbox"]:focus-visible {
    outline-offset: 3px;
}

/* === Main Form Container === */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--form-bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

/* Anchor jump (CTA "ĐẶT MUA NGAY" → href="#form-dat-hang" hoặc tương tự).
   User dùng html_id trong CF7 shortcode để set id trên <form>.
   scroll-margin-top tạo khoảng cách từ mép trên viewport khi scroll tới — tránh
   cảm giác form bị "kẹp" sát top, đặc biệt nếu site có sticky header. */
form.product-order-form,
.form-container {
    scroll-margin-top: 24px;
}

/* === Header === */
header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

header h1 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.logo-placeholder {
    color: var(--label-color);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* === Progress Indicator === */
.form-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--border-light);
    color: var(--label-color);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--label-color);
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.progress-step.active .step-number {
    background-color: var(--primary-color);
    color: #fff;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .step-number {
    background-color: var(--primary-color);
    color: #fff;
}

.progress-step.completed .step-number::after {
    content: '✓';
}

.progress-step.completed .step-label {
    color: var(--text-secondary);
}

.progress-connector {
    flex: 1;
    height: 2px;
    background-color: var(--border-light);
    margin: 0 12px;
    margin-bottom: 22px;
    transition: background-color 0.3s ease;
}

.progress-connector.active {
    background-color: var(--primary-color);
}

/* === Collapsible Sections === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.section-header:hover {
    background-color: var(--background-color);
}

.section-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.toggle-icon {
    color: var(--label-color);
    font-size: 14px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    padding: 8px;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.section-body {
    max-height: 2000px;
    overflow: visible;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible.collapsed .section-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.section-summary {
    padding: 12px 16px;
    background-color: var(--background-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.section-summary i {
    margin-right: 6px;
    color: var(--primary-color);
}

/* === Form Sections & Typography === */
.form-section {
    margin-bottom: 2rem;
}

h2, h3 {
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.8rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.section-description {
    color: var(--label-color);
    margin-bottom: 1rem;
}

.section-icon {
    margin-right: 0.75rem;
    color: var(--label-color);
    transition: color 0.3s ease;
}

.section-icon.validated {
    color: var(--primary-color);
}

.icon-fire { color: #ff5722; }
.icon-star { color: #ffc107; }

/* === Product List === */
.product-list-header {
    display: grid;
    grid-template-columns: 1fr 140px 100px;
    gap: 1rem;
    font-weight: 700;
    color: var(--text-color);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}


.header-quantity {
    text-align: center;
}

.header-price {
    text-align: right;
}

.product-list {
    list-style: none;
}

.product-item {
    display: grid;
    grid-template-columns: 1fr 140px 100px;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    position: relative;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item.selected {
    background-color: #f0faf3;
    border-radius: 8px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.product-info {
    display: flex;
    align-items: flex-start;
}

.product-info input[type="checkbox"] {
    margin-right: 1rem;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.product-info label {
    cursor: pointer;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.product-info .product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.social-proof {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}


.combo-deal {
    padding-top: 1.25rem;
}

/* === Quantity Controls === */
.quantity-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fdfdfd;
    overflow: hidden;
    transition: border-color 0.2s;
    justify-self: center;
}

.quantity-control:focus-within {
    border-color: var(--primary-color);
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--label-color);
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:not(:disabled):hover {
    background-color: #e9ecef;
}

.quantity-btn:not(:disabled):active {
    background-color: var(--primary-light);
}

.quantity-input {
    width: 44px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: transparent;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    appearance: textfield;
    -moz-appearance: textfield;
}

.quantity-input:focus {
    outline: none;
    background-color: #fff;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-btn:disabled,
.quantity-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #ccc;
}

.product-price {
    font-weight: 700;
    min-width: 80px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.original-price {
    text-decoration: line-through;
    color: #94a3b8; /* Muted slate color */
    font-size: 0.8em;
    font-weight: 500;
    margin-bottom: -2px;
}

.discount-price {
    color: var(--text-color);
}

.shipping-fee-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.discount-price.free-shipping {
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.95em;
    letter-spacing: 0.02em;
}

/* === Section Error === */
.section-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--error-bg);
    border-radius: 4px;
    border-left: 3px solid var(--error-color);
}

.section-error i {
    margin-right: 0.4rem;
}

/* === Summary Section === */
.summary-section {
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.summary-line.total-line {
    font-weight: 700;
    font-size: 1.3rem;
}

#total-price {
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

#total-price.updated {
    transform: scale(1.1);
}

/* === Billing & Form Fields === */
.form-group {
    margin-bottom: 2rem;
}

.group-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-field {
    position: relative;
    flex: 1;
    margin-top: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family);
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* Error state for inputs */
input.error,
select.error {
    border-color: var(--error-color);
    background-color: var(--error-bg);
}

input.error:focus,
select.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    border-color: var(--error-color);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
    padding-right: 2.5em;
}

/* === Custom Searchable Select === */
.custom-select-container .select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.custom-select-container.open {
    z-index: 60;
}

.custom-select-container.open .select-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Lazy-loading state for district while ward.js downloads */
.custom-select-container.loading .select-icon {
    visibility: hidden;
}

.custom-select-container.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.custom-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-select-list li {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    border-bottom: 1px solid #f8fafc;
    transition: background-color 0.15s ease;
}

.custom-select-list li:last-child {
    border-bottom: none;
}

.custom-select-list li:hover,
.custom-select-list li.focused {
    background-color: #f1f5f9;
}

.custom-select-list li.selected {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--primary-glow);
}

.custom-select-list li.no-results {
    color: #94a3b8;
    text-align: center;
    cursor: default;
    font-style: italic;
}
.custom-select-list li.no-results:hover {
    background-color: #fff;
}

.custom-select-list li.more-hint {
    background-color: #f8fafc;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
}

/* Floating Label Effect */
.form-field input[type="text"] + label,
.form-field input[type="tel"] + label,
.form-field input[type="email"] + label {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    color: var(--label-color);
    pointer-events: none;
    transition: all 0.2s ease;
    background-color: var(--form-bg-color);
    padding: 0 0.2rem;
}

.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label {
    top: -0.7rem;
    left: 0.5rem;
    font-size: 0.8rem;
    padding: 0 0.3rem;
    color: var(--primary-color);
}

.form-field input.error:focus + label,
.form-field input.error:not(:placeholder-shown) + label {
    color: var(--error-color);
}

.field-description {
    font-size: 0.85rem;
    color: var(--label-color);
    margin-top: 0.5rem;
}

/* Inline error message */
.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    padding-left: 0.2rem;
    animation: fadeInError 0.2s ease;
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Agreement & Submit === */
.agreement-section {
    margin: 2rem 0;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 8px 0;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 4px;
    margin-right: 0.8rem;
    flex-shrink: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.checkbox-group label {
    cursor: pointer;
}

/* === Note textarea (toggleable) === */
.note-wrapper {
    position: relative;
    margin-top: 0.5rem;
    animation: noteSlide 0.2s ease;
}

@keyframes noteSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.note-wrapper textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: #fff;
    color: var(--text-color);
    line-height: 1.5;
    resize: vertical;
    min-height: 72px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.note-wrapper textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.note-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 0.75rem;
    color: var(--label-color);
    background: rgba(255, 255, 255, 0.85);
    padding: 1px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.submit-spacer {
    display: none;
}

.risk-reversal {
    background-color: #f0faf3;
    border: 1px dashed #4caf50;
    border-radius: 8px;
    padding: 12px;
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: #2e7d32;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.risk-reversal i {
    font-size: 1.1rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.1s ease;
    font-family: var(--font-family);
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* === Toast === */
.order-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: calc(100vw - 32px);
    text-align: center;
    line-height: 1.4;
}

.order-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.order-toast[data-type="success"] {
    background: #15803d;
}

.order-toast[data-type="error"] {
    background: #b91c1c;
}

.order-toast[data-type="warning"] {
    background: #a16207;
}

@media (max-width: 768px) {
    .order-toast {
        bottom: 24px; /* v1.10: không còn sticky submit, toast về vị trí thường */
        left: 16px;
        right: 16px;
        transform: translateY(20px);
        max-width: none;
    }
    .order-toast.visible {
        transform: translateY(0);
    }
}

/* === Success Modal === */
.order-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.order-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.order-modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-modal-overlay.visible .order-modal-card {
    transform: translateY(0) scale(1);
}

.order-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalIconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.order-modal-icon i {
    font-size: 38px;
    color: #15803d;
}

@keyframes modalIconPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.order-modal-card h2 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.order-modal-card > p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.order-modal-info {
    background: var(--background-color);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 20px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 180px;
    overflow-y: auto;
}

.order-modal-info strong {
    color: var(--text-color);
}

.order-modal-close {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background-color 0.15s ease;
    width: 100%;
}

.order-modal-close:hover { background: var(--primary-hover); }
.order-modal-close:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .order-modal-card {
        padding: 24px 20px 20px;
        border-radius: 14px;
    }
    .order-modal-icon { width: 60px; height: 60px; }
    .order-modal-icon i { font-size: 30px; }
    .order-modal-card h2 { font-size: 1.2rem; }
}

/* === Footer & Background === */
footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--label-color);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.background-curve {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-color: #e9f5ec;
    border-top-left-radius: 50% 100px;
    border-top-right-radius: 50% 100px;
    z-index: 1;
}

/* ==========================================================
   MOBILE RESPONSIVE — Stitch "Professional Trust" Optimized
   ========================================================== */
@media (max-width: 768px) {
    /* --- Base --- */
    body {
        padding: 0.75rem 0.5rem;
    }

    /* --- Container: 16px padding (Stitch recommendation) --- */
    .form-container {
        padding: 16px;
        border-radius: 16px;
    }

    /* --- Typography Scale (Stitch Professional Trust) --- */
    header h1 {
        font-size: 24px;
        letter-spacing: -0.01em;
    }

    .logo-placeholder {
        font-size: 12px;
        letter-spacing: 0.04em;
    }

    h3 {
        font-size: 18px;
        font-weight: 600;
    }

    .group-label {
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.02em;
    }

    .field-description {
        font-size: 12px;
    }

    /* --- Progress Indicator (compact on mobile) --- */
    .form-progress {
        margin-bottom: 1.5rem;
        padding: 0;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-label {
        font-size: 11px;
    }

    /* --- Form Rows Stack --- */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* --- Input iOS zoom fix: always 16px on mobile --- */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px;
        padding: 14px 12px;
    }

    .form-field input[type="text"] + label,
    .form-field input[type="tel"] + label,
    .form-field input[type="email"] + label {
        top: 14px;
        left: 12px;
    }

    .form-field input:focus + label,
    .form-field input:not(:placeholder-shown) + label {
        top: -0.6rem;
        left: 8px;
        font-size: 12px;
    }

    /* --- Product List: Card-based (Stitch layout) --- */
    .product-list-header {
        display: none;
    }

    .product-item {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 12px;
        background: #fff;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
    }

    .product-item:last-child {
        border-bottom: 1px solid var(--border-light);
    }

    .product-item.combo-deal:last-child {
        border-bottom-color: var(--combo-color);
    }

    .product-item.selected {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px var(--primary-glow);
        background-color: #fafffe;
    }
    
    .product-info {
        grid-column: 1 / -1;
        width: 100%;
    }

    .combo-deal {
        padding-top: 16px;
        background-color: var(--combo-bg);
        border-color: var(--combo-color);
    }

    .combo-deal.selected {
        background-color: #fff8f0;
        border-color: var(--combo-color);
        box-shadow: 0 0 0 2px rgba(230, 81, 0, 0.15);
    }

    /* --- Product info row on mobile --- */
    .product-info {
        width: 100%;
    }

    .product-info .product-title {
        font-size: 16px; /* Ensure minimum size */
        line-height: 1.4;
    }

    .social-proof {
        font-size: 0.8rem;
    }

    /* --- Touch-friendly Quantity Controls (48px buttons, Stitch spec) --- */
    .quantity-control {
        grid-column: 1;
        justify-self: start;
        margin-left: 36px;
        border-radius: 10px;
    }

    .quantity-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .quantity-input {
        width: 52px;
        height: 44px;
        font-size: 16px;
    }

    /* --- Price on mobile --- */
    .product-price {
        grid-column: 2;
        text-align: right;
        font-size: 16px;
        align-items: flex-end;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
    }

    .product-price .discount-price {
        color: var(--primary-color);
    }

    .product-price .original-price {
        font-size: 0.85em;
        margin-top: 0;
    }

    .product-price::before {
        display: none;
    }

    /* --- Summary on mobile --- */
    .summary-line.total-line {
        font-size: 1.15rem;
    }

    /* --- Checkbox touch targets --- */
    .checkbox-group {
        padding: 12px 8px;
        border-radius: 8px;
        transition: background-color 0.15s;
    }

    .checkbox-group:active {
        background-color: var(--background-color);
    }

    .checkbox-group input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-top: 2px;
    }

    /* --- Submit Button mobile ---
       v1.10: BỎ sticky-fixed bottom hoàn toàn. Button luôn ở cuối form (in flow).
       Lý do: sticky bottom dù có IntersectionObserver vẫn khiến user khó chịu
       (overlap content gần form bottom, conflict với theme nav, anchor scroll
       không landing đúng vị trí). UX tự nhiên hơn = button cuối form, user
       scroll xuống để click. */
    .submit-btn {
        height: 56px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 16px; /* khoảng cách với khối phía trên */
    }

    /* submit-spacer giữ trong DOM để không vỡ HTML cũ, chỉ hidden */
    .submit-spacer {
        display: none;
    }

    /* --- Collapsible tweaks on mobile --- */
    .section-header {
        padding: 8px 4px;
        border-radius: 8px;
    }

    .section-summary {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* v1.10: footer spacing không cần nữa (đã bỏ sticky button) */

    .background-curve {
        display: none;
    }
}

/* === Extra small screens === */
@media (max-width: 380px) {
    .form-container {
        padding: 12px;
    }

    .product-item {
        padding: 12px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
    }

    .quantity-input {
        width: 48px;
        height: 40px;
    }
}
