/* ============================================================
   TẾT PHỒN VINH - PROSPERITY LUNAR THEME
   Voucher Plugin - Vietnamese New Year Edition
   Version: 2.0.0
   
   Synchronized with Order & Tracking Plugin Theme
   
   TABLE OF CONTENTS:
   1. CSS Variables & Root Settings
   2. Base Resets & Typography  
   3. Floating Button (Voucher Check)
   4. Popup Container & Overlay
   5. Popup Header with Tết Decoration
   6. Form Elements & Inputs
   7. Voucher Cards
   8. Countdown Timer
   9. Alerts & Notifications
   10. Empty State
   11. Toast Messages
   12. OAT Integration
   13. Animations & Effects
   14. Responsive Breakpoints
   15. Accessibility
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES & ROOT SETTINGS
   ============================================================ */
:root {
    /* Tết Color Palette - Synced with OAT */
    --vc-red-primary: #C41E3A;
    --vc-red-dark: #9B1B30;
    --vc-red-light: #E85A71;
    --vc-gold-primary: #D4AF37;
    --vc-gold-light: #F4D03F;
    --vc-gold-dark: #B8860B;
    --vc-cream: #FFF8F0;
    --vc-cream-dark: #FFF0E0;
    --vc-white: #FFFFFF;
    --vc-black: #1A1A1A;
    
    /* Neutral Colors */
    --vc-gray-100: #F8F9FA;
    --vc-gray-200: #E9ECEF;
    --vc-gray-300: #DEE2E6;
    --vc-gray-400: #CED4DA;
    --vc-gray-500: #ADB5BD;
    --vc-gray-600: #6C757D;
    --vc-gray-700: #495057;
    --vc-gray-800: #343A40;
    --vc-gray-900: #212529;
    
    /* Status Colors */
    --vc-success: #28A745;
    --vc-success-light: #D4EDDA;
    --vc-warning: #FFC107;
    --vc-warning-light: #FFF3CD;
    --vc-error: #DC3545;
    --vc-error-light: #F8D7DA;
    --vc-info: #17A2B8;
    --vc-info-light: #D1ECF1;
    
    /* Typography */
    --vc-font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --vc-font-size-xs: clamp(0.625rem, 0.5rem + 0.5vw, 0.75rem);
    --vc-font-size-sm: clamp(0.75rem, 0.65rem + 0.5vw, 0.875rem);
    --vc-font-size-base: clamp(0.875rem, 0.8rem + 0.4vw, 1rem);
    --vc-font-size-lg: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --vc-font-size-xl: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
    --vc-font-size-2xl: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
    --vc-line-height: 1.6;
    
    /* Spacing */
    --vc-space-xs: 0.25rem;
    --vc-space-sm: 0.5rem;
    --vc-space-md: 1rem;
    --vc-space-lg: 1.5rem;
    --vc-space-xl: 2rem;
    --vc-space-2xl: 3rem;
    
    /* Border Radius */
    --vc-radius-sm: 4px;
    --vc-radius-md: 8px;
    --vc-radius-lg: 12px;
    --vc-radius-xl: 16px;
    --vc-radius-full: 50%;
    
    /* Shadows */
    --vc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --vc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --vc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --vc-shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    --vc-shadow-glow-red: 0 0 20px rgba(196, 30, 58, 0.3);
    --vc-shadow-glow-gold: 0 0 20px rgba(212, 175, 55, 0.4);
    
    /* Transitions */
    --vc-transition-fast: 150ms ease;
    --vc-transition-base: 250ms ease;
    --vc-transition-slow: 400ms ease;
    
    /* Z-Index */
    --vc-z-floating: 9999;
    --vc-z-overlay: 100000;
    --vc-z-popup: 100001;
    --vc-z-toast: 100010;
}

/* ============================================================
   2. BASE RESETS & TYPOGRAPHY (Scoped to plugin)
   ============================================================ */
.vc-voucher-app,
.vc-voucher-app *,
.vc-voucher-app *::before,
.vc-voucher-app *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* Critical overflow prevention */
.vc-voucher-app .vc-popup__container {
    overflow-x: hidden !important;
}

.vc-voucher-app .vc-popup__container * {
    max-width: 100% !important;
}

.vc-voucher-app input,
.vc-voucher-app button,
.vc-voucher-app textarea,
.vc-voucher-app select {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.vc-voucher-app {
    font-family: var(--vc-font-primary);
    font-size: var(--vc-font-size-base);
    line-height: var(--vc-line-height);
    color: var(--vc-gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vc-voucher-app h1,
.vc-voucher-app h2,
.vc-voucher-app h3,
.vc-voucher-app h4 {
    margin: 0 0 var(--vc-space-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--vc-gray-900);
}

.vc-voucher-app p {
    margin: 0 0 var(--vc-space-sm);
}

.vc-voucher-app a {
    color: var(--vc-red-primary);
    text-decoration: none;
    transition: color var(--vc-transition-fast);
}

.vc-voucher-app a:hover {
    color: var(--vc-red-dark);
}

/* ============================================================
   3. FLOATING BUTTON (VOUCHER CHECK)
   ============================================================ */
.vc-voucher-app.vc-floating-wrapper {
    position: fixed;
    z-index: var(--vc-z-floating);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--vc-space-sm);
    right: 20px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   3b. NÚT VOUCHER CỐ ĐỊNH (Image Button)
   ============================================================ */
/* Wrapper cho nút voucher hình ảnh */
.vc-fixed-voucher-wrapper {
    position: fixed;
    bottom: calc(225px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    z-index: 1000;
}

/* Nút voucher dạng hình ảnh */
.vc-fixed-voucher-img-btn {
    cursor: pointer;
    display: block;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.3s ease;
    animation: vc-voucher-btn-pulse 2s infinite;
}

.vc-fixed-voucher-img-btn:hover {
    transform: scale(1.08);
    animation: none;
}

.vc-fixed-voucher-img-btn:active {
    transform: scale(0.95);
}

/* Hình ảnh nút voucher */
.vc-voucher-btn-img {
    display: block;
    width: 55px;
    height: auto;
    background: transparent !important;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
    transition: filter 0.3s ease;
}

.vc-fixed-voucher-img-btn:hover .vc-voucher-btn-img {
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.35));
}

/* Animation pulse cho nút */
@keyframes vc-voucher-btn-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Focus state cho accessibility */
.vc-fixed-voucher-img-btn:focus {
    outline: none;
    background: transparent !important;
}

/* Override styles cũ cho #global-voucher-check-button */
.vc-fixed-voucher-wrapper #global-voucher-check-button {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.vc-fixed-voucher-wrapper #global-voucher-check-button:hover,
.vc-fixed-voucher-wrapper #global-voucher-check-button:active {
    background: transparent !important;
    box-shadow: none !important;
}

.vc-fixed-voucher-wrapper #global-voucher-check-button::before,
.vc-fixed-voucher-wrapper #global-voucher-check-button::after {
    display: none !important;
}

/* ============================================================
   3c. FLOATING BUTTON CŨ (Backup styles)
   ============================================================ */
.vc-floating-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: var(--vc-radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vc-transition-base);
    overflow: visible;
    /* Red với Tết pattern - same as OAT order button */
    background: linear-gradient(135deg, var(--vc-red-light) 0%, var(--vc-red-primary) 50%, var(--vc-red-dark) 100%);
    box-shadow: var(--vc-shadow-lg), var(--vc-shadow-glow-red);
}

/* Tết pattern overlay */
.vc-floating-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C13.1 2 14 2.9 14 4C14 4.74 13.6 5.39 13 5.73V7H14C15.1 7 16 7.9 16 9H8C8 7.9 8.9 7 10 7H11V5.73C10.4 5.39 10 4.74 10 4C10 2.9 10.9 2 12 2Z' fill='%23FFD700' fill-opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* Golden ring decoration */
.vc-floating-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid var(--vc-gold-primary);
    opacity: 0.6;
    pointer-events: none;
    animation: vc-golden-ring 2s ease-in-out infinite;
}

@keyframes vc-golden-ring {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.3; }
}

.vc-floating-btn:hover {
    transform: scale(1.08) translateY(-2px);
}

.vc-floating-btn:active {
    transform: scale(0.95);
}

.vc-floating-btn:focus {
    outline: none;
    box-shadow: var(--vc-shadow-lg), var(--vc-shadow-glow-red), 0 0 0 3px rgba(196, 30, 58, 0.3);
}

.vc-floating-btn__icon {
    width: 26px;
    height: 26px;
    fill: var(--vc-white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

/* Floating label */
.vc-floating-label {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--vc-white);
    color: var(--vc-red-primary);
    font-size: var(--vc-font-size-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: var(--vc-shadow-sm);
    border: 1px solid var(--vc-gold-primary);
}

/* Badge decoration on button */
.vc-floating-btn__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: vc-bounce 2s ease-in-out infinite;
}

@keyframes vc-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Pulse animation for CTA */
.vc-floating-btn--pulse {
    animation: vc-btn-pulse 2s ease-in-out infinite;
}

@keyframes vc-btn-pulse {
    0% { box-shadow: var(--vc-shadow-lg), 0 0 0 0 rgba(196, 30, 58, 0.5); }
    50% { box-shadow: var(--vc-shadow-lg), 0 0 0 12px rgba(196, 30, 58, 0); }
    100% { box-shadow: var(--vc-shadow-lg), 0 0 0 0 rgba(196, 30, 58, 0); }
}

/* Tooltip on hover */
.vc-floating-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: var(--vc-space-xs) var(--vc-space-sm);
    font-size: var(--vc-font-size-xs);
    font-weight: 500;
    color: var(--vc-white);
    background: var(--vc-gray-800);
    border-radius: var(--vc-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--vc-transition-fast);
}

.vc-floating-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--vc-gray-800);
}

.vc-floating-btn:hover ~ .vc-floating-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   4. POPUP CONTAINER & OVERLAY
   ============================================================ */
.vc-voucher-app.vc-popup {
    position: fixed;
    inset: 0;
    z-index: var(--vc-z-overlay);
    display: flex;
    justify-content: center;
    align-items: flex-end;         /* BÁM ĐÁY - bottom sheet */
    padding: 10px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--vc-transition-base), visibility var(--vc-transition-base);
    /* Fix mobile viewport: use dvh with vh fallback */
    height: 100vh;
    height: 100dvh;
    overscroll-behavior: contain;
}

.vc-voucher-app.vc-popup--visible {
    opacity: 1;
    visibility: visible;
}

/* Overlay - matching OAT style */
.vc-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(26, 26, 26, 0.7) 0%, 
        rgba(139, 30, 58, 0.3) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Container - Mobile-first với dvh + safe-area */
.vc-popup__container {
    position: relative; /* Important: để close button position:absolute hoạt động */
    z-index: 2;
    /* Width responsive với safe-area */
    width: min(calc(100vw - 24px - 2 * env(safe-area-inset-left, 0px)), 560px);
    max-width: 560px;
    /* Height: auto để fit-content, max-height khi nội dung dài */
    height: auto;
    min-height: 300px; /* Minimum height for empty/short content */
    /* Max-height với safe-area - không bao giờ tràn */
    max-height: calc(100vh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100svh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    background: var(--vc-white);
    border-radius: 16px;
    box-shadow: var(--vc-shadow-xl);
    /* Flexbox column layout để header sticky và body cuộn */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Container không cuộn, chỉ body bên trong cuộn */
    /* KHÔNG dùng transform - tránh iOS zoom/layout bug */
    transform: none !important;
    touch-action: auto;
}

.vc-popup--visible .vc-popup__container {
    transform: none !important;
}

/* Tết border decoration - matching OAT */
.vc-popup__container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--vc-red-primary) 0%, 
        var(--vc-gold-primary) 50%, 
        var(--vc-red-primary) 100%);
    z-index: 10;
}

/* ============================================================
   5. POPUP HEADER WITH TẾT DECORATION
   ============================================================ */
.vc-popup__header {
    /* Sticky header luôn thấy, không bị cuộn */
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--vc-cream) 0%, var(--vc-white) 100%);
    z-index: 100;
    padding: var(--vc-space-lg);
    padding-right: calc(var(--vc-space-lg) + 44px);
    border-bottom: 1px solid var(--vc-gray-200);
    flex: 0 0 auto; /* Header không co/giãn, giữ nguyên kích thước */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    border-top-left-radius: var(--vc-radius-xl);
    border-top-right-radius: var(--vc-radius-xl);
    display: flex;
    align-items: center;
    gap: var(--vc-space-md);
}

/* Tết pattern background - matching OAT */
.vc-popup__header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C41E3A' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
    pointer-events: none;
}

.vc-popup__header-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--vc-space-md);
    z-index: 1;
}

.vc-popup__icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--vc-red-primary) 0%, var(--vc-red-dark) 100%);
    border-radius: var(--vc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--vc-shadow-sm);
    font-size: 1.25rem;
}

.vc-popup__icon svg {
    width: 22px;
    height: 22px;
    fill: var(--vc-white);
}

.vc-popup__title {
    flex: 1;
    font-size: var(--vc-font-size-xl);
    font-weight: 700;
    color: var(--vc-red-primary);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vc-popup__subtitle {
    display: none;
}

/* Close button - matching OAT, luôn hiển thị */
.vc-popup__close {
    position: absolute;
    top: 16px; /* Fixed pixel value thay vì var để đảm bảo predictable */
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--vc-gray-100);
    border-radius: var(--vc-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vc-transition-fast);
    color: var(--vc-gray-600);
    font-size: 20px;
    line-height: 1;
    z-index: 200; /* Tăng cao hơn để luôn nằm trên cùng */
    flex-shrink: 0; /* Không bị co lại */
}

.vc-popup__close:hover {
    background: var(--vc-error-light);
    color: var(--vc-error);
    transform: rotate(90deg);
}

.vc-popup__close:active {
    transform: rotate(90deg) scale(0.95);
}

.vc-popup__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--vc-red-light);
}

.vc-popup__close svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================================
   6. FORM ELEMENTS & INPUTS
   ============================================================ */
.vc-popup__body {
    flex: 1 1 auto; /* Body giãn để chiếm chỗ trống, co lại khi content ít */
    min-height: 0; /* Critical for flex scroll containment */
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--vc-space-lg);
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on older iOS/iPadOS */
    overscroll-behavior: contain; /* Prevent scroll chaining to body */
}

/* Custom scrollbar - matching OAT */
.vc-popup__body::-webkit-scrollbar {
    width: 6px;
}

.vc-popup__body::-webkit-scrollbar-track {
    background: var(--vc-gray-100);
    border-radius: 3px;
}

.vc-popup__body::-webkit-scrollbar-thumb {
    background: var(--vc-gray-300);
    border-radius: 3px;
}

.vc-popup__body::-webkit-scrollbar-thumb:hover {
    background: var(--vc-gray-400);
}

/* ============================================================
   POPUP FOOTER - Sticky at bottom
   ============================================================ */
.vc-popup__footer {
    flex: 0 0 auto; /* Footer không co/giãn, giữ nguyên kích thước */
    position: sticky;
    bottom: 0;
    background: var(--vc-white);
    z-index: 100;
    padding: var(--vc-space-md) var(--vc-space-lg);
    padding-bottom: calc(var(--vc-space-md) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--vc-gray-200);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   EMPTY STATE - Hiển thị khi chưa có kết quả
   ============================================================ */
.vc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--vc-space-xl) var(--vc-space-lg);
    text-align: center;
    margin-top: var(--vc-space-md);
}

.vc-empty-state__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--vc-gray-100) 0%, var(--vc-gray-50) 100%);
    border-radius: var(--vc-radius-full);
    margin-bottom: var(--vc-space-md);
    color: var(--vc-gray-400);
}

.vc-empty-state__icon svg {
    width: 32px;
    height: 32px;
}

.vc-empty-state__text {
    max-width: 320px;
}

.vc-empty-state__title {
    font-size: var(--vc-font-size-lg);
    font-weight: 600;
    color: var(--vc-gray-700);
    margin: 0 0 var(--vc-space-sm) 0;
}

.vc-empty-state__desc {
    font-size: var(--vc-font-size-sm);
    color: var(--vc-gray-500);
    line-height: 1.5;
    margin: 0;
}

/* Hide empty state when result is shown */
.vc-result:not([style*="display: none"]) ~ .vc-empty-state,
.vc-empty-state ~ .vc-result:not([style*="display: none"]) {
    display: none;
}

/* Form */
.vc-form {
    display: flex;
    flex-direction: column;
    gap: var(--vc-space-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Form directly inside container (without body wrapper) */
.vc-popup__container > .vc-form {
    padding: var(--vc-space-lg);
    padding-bottom: calc(var(--vc-space-lg) + env(safe-area-inset-bottom, 0px));
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Form inside body wrapper - no extra scroll needed */
.vc-popup__body .vc-form {
    overflow: visible;
    flex: none;
}

.vc-form__group {
    display: flex;
    flex-direction: column;
    gap: var(--vc-space-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.vc-form__actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.vc-form__label {
    display: flex;
    align-items: center;
    gap: var(--vc-space-sm);
    font-weight: 600;
    font-size: var(--vc-font-size-sm);
    color: var(--vc-gray-700);
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vc-form__label-icon {
    width: 18px;
    height: 18px;
    fill: var(--vc-red-primary);
}

.vc-form__input-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.vc-form__input {
    width: 100%;
    max-width: 100%;
    padding: var(--vc-space-md);
    font-family: inherit;
    font-size: var(--vc-font-size-base);
    color: var(--vc-gray-800);
    background: var(--vc-white);
    border: 2px solid var(--vc-gray-300);
    border-radius: var(--vc-radius-md);
    transition: all var(--vc-transition-fast);
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

/* Input with icon - add left padding only when inside wrapper */
.vc-form__input-wrapper .vc-form__input {
    padding-left: 44px;
}

.vc-form__input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--vc-gray-500);
    pointer-events: none;
    transition: color var(--vc-transition-fast);
}

.vc-form__input::placeholder {
    color: var(--vc-gray-500);
}

.vc-form__input:hover {
    border-color: var(--vc-gray-400);
}

.vc-form__input:focus {
    outline: none;
    border-color: var(--vc-red-primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.vc-form__input:focus ~ .vc-form__input-icon {
    color: var(--vc-red-primary);
}

.vc-form__input--error {
    border-color: var(--vc-error);
}

.vc-form__input--error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.vc-form__helper {
    font-size: var(--vc-font-size-xs);
    color: var(--vc-gray-600);
}

.vc-form__error {
    display: flex;
    align-items: center;
    gap: var(--vc-space-xs);
    font-size: var(--vc-font-size-xs);
    color: var(--vc-error);
    animation: vc-shake 0.4s ease;
}

@keyframes vc-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.vc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--vc-space-sm);
    padding: var(--vc-space-md) var(--vc-space-lg);
    font-family: inherit;
    font-size: var(--vc-font-size-base);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    border-radius: var(--vc-radius-md);
    cursor: pointer;
    transition: all var(--vc-transition-fast);
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.vc-btn:focus {
    outline: none;
}

.vc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button - Red Tết gradient */
.vc-btn--primary {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    color: var(--vc-white);
    background: linear-gradient(135deg, var(--vc-red-light) 0%, var(--vc-red-primary) 50%, var(--vc-red-dark) 100%);
    box-shadow: var(--vc-shadow-md), var(--vc-shadow-glow-red);
    box-sizing: border-box;
}

.vc-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--vc-shadow-lg), 0 0 25px rgba(196, 30, 58, 0.4);
}

.vc-btn--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--vc-shadow-sm);
}

.vc-btn--primary:focus {
    box-shadow: var(--vc-shadow-md), 0 0 0 3px rgba(196, 30, 58, 0.3);
}

/* Secondary Button */
.vc-btn--secondary {
    color: var(--vc-gray-700);
    background: var(--vc-white);
    border: 2px solid var(--vc-gray-300);
}

.vc-btn--secondary:hover:not(:disabled) {
    background: var(--vc-gray-100);
    border-color: var(--vc-gray-400);
}

/* Ghost Button */
.vc-btn--ghost {
    color: var(--vc-red-primary);
    background: transparent;
}

.vc-btn--ghost:hover:not(:disabled) {
    background: rgba(196, 30, 58, 0.1);
}

/* Loading State */
.vc-btn--loading {
    color: transparent !important;
    pointer-events: none;
}

.vc-btn--loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--vc-white);
    border-radius: 50%;
    animation: vc-spin 0.8s linear infinite;
}

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

/* ============================================================
   8. RESULT SECTION
   ============================================================ */
.vc-result {
    margin-top: var(--vc-space-lg);
    padding: var(--vc-space-lg);
    border-top: 1px solid var(--vc-gray-200);
    animation: vc-fade-in 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Ensure result section doesn't push content out of viewport */
    flex-shrink: 1;
    min-height: 0;
}

@keyframes vc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.vc-result__title {
    display: flex;
    align-items: center;
    gap: var(--vc-space-sm);
    font-size: var(--vc-font-size-lg);
    font-weight: 600;
    color: var(--vc-gray-800);
    margin-bottom: var(--vc-space-md);
}

.vc-result__content {
    max-height: 45vh;
    max-height: 45svh;
    max-height: 45dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 var(--vc-space-sm);
    transition: max-height 0.3s ease;
}

/* Expanded result area when results are present */
.vc-popup--has-result .vc-result__content {
    max-height: 60vh;
    max-height: 60svh;
    max-height: 60dvh;
}

/* ============================================================
   9. VOUCHER CARDS — Unified Ticket Card (dvl-voucher-card)
   ============================================================ */

/* === VOUCHER CARD CONTAINER === */
.vc-voucher-app .dvl-voucher-card {
    border-radius: 16px;
    overflow: visible;
    position: relative;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    width: calc(100% - 24px);
    max-width: 280px;
    margin: 0 auto var(--vc-space-lg, 1.5rem);
    font-size: 1rem;
    line-height: 1.5;
    box-sizing: border-box;
}
.vc-voucher-app .dvl-voucher-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
}
.vc-voucher-app .dvl-voucher-card--expired {
    opacity: 0.5;
    filter: saturate(0.4) brightness(0.95);
    pointer-events: none;
}
.vc-voucher-app .dvl-voucher-card--expired::after {
    content: 'HẾT HẠN';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 900;
    color: rgba(255,255,255,0.95);
    background: rgba(220, 53, 69, 0.9);
    padding: 6px 18px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
    pointer-events: none;
}

/* --- Segment A: Header (Deal) --- */
.vc-voucher-app .dvl-voucher-card__header {
    position: relative;
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.04) 0%, rgba(229, 62, 62, 0.01) 100%);
    padding: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.vc-voucher-app .dvl-voucher-card--hot .dvl-voucher-card__header {
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.08) 0%, rgba(255, 107, 53, 0.04) 100%);
}
.vc-voucher-app .dvl-voucher-card--grand .dvl-voucher-card__header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(229, 62, 62, 0.08) 100%);
}

/* Badge (top-right pill) */
.vc-voucher-app .dvl-voucher-card__badge {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    background: linear-gradient(135deg, #ff6b35, #ff3d00);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.18rem 0.5rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(255, 61, 0, 0.3);
    animation: vcBadgePulse 2s ease-in-out infinite alternate;
    line-height: 1.2;
}
.vc-voucher-app .dvl-voucher-card--grand .dvl-voucher-card__badge {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}
@keyframes vcBadgePulse {
    0%   { transform: scale(1); }
    100% { transform: scale(1.04); box-shadow: 0 3px 14px rgba(255, 61, 0, 0.45); }
}
.vc-voucher-app .dvl-voucher-card__deal {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 1.2rem 1rem 0.5rem;
}
.vc-voucher-app .dvl-voucher-card__percent-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.vc-voucher-app .dvl-voucher-card__percent {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dvl-primary, #e53e3e);
    line-height: 1;
    letter-spacing: -0.03em;
}
.vc-voucher-app .dvl-voucher-card--grand .dvl-voucher-card__percent {
    background: linear-gradient(135deg, #ff6b35, #e53e3e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.vc-voucher-app .dvl-voucher-card__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.35;
    padding: 0.15rem 1rem 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Segment B: Tear separator --- */
.vc-voucher-app .dvl-voucher-card__tear {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 1;
}
.vc-voucher-app .dvl-voucher-card__notch {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--dvl-bg-alt, #f5f5f5);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.vc-voucher-app .dvl-voucher-card__notch--left {
    left: -10px;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.06);
}
.vc-voucher-app .dvl-voucher-card__notch--right {
    right: -10px;
    box-shadow: inset 2px 0 4px rgba(0,0,0,0.06);
}
.vc-voucher-app .dvl-voucher-card__dashed {
    flex: 1;
    height: 0;
    border-top: 2px dashed rgba(229, 62, 62, 0.18);
    margin: 0 14px;
}

/* --- Segment C: Info + CTA --- */
.vc-voucher-app .dvl-voucher-card__info {
    padding: 0.65rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}
.vc-voucher-app .dvl-voucher-card__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.4;
}
.vc-voucher-app .dvl-voucher-card__icon {
    flex-shrink: 0;
    opacity: 0.5;
}
.vc-voucher-app .dvl-voucher-card__meta--code {
    font-weight: 700;
    color: var(--dvl-primary, #e53e3e);
}
.vc-voucher-app .dvl-voucher-card__meta--code .dvl-voucher-card__icon {
    opacity: 0.7;
    color: var(--dvl-primary, #e53e3e);
}
.vc-voucher-app .dvl-voucher-card__meta--countdown {
    color: #276749;
    font-weight: 700;
    font-size: 0.72rem;
    background: rgba(56, 161, 105, 0.08);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(56, 161, 105, 0.15);
    letter-spacing: 0.01em;
}
.vc-voucher-app .dvl-voucher-card__meta--countdown .dvl-voucher-card__icon {
    opacity: 0.75;
    color: #38a169;
}
/* Reset vc-countdown / voucher-countdown inside unified card so parent chip styles apply cleanly */
.vc-voucher-app .dvl-voucher-card__meta--countdown .vc-countdown,
.vc-voucher-app .dvl-voucher-card__meta--countdown .voucher-countdown {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    position: static;
    overflow: visible;
    animation: none;
}
.vc-voucher-app .dvl-voucher-card__meta--countdown .vc-countdown::before,
.vc-voucher-app .dvl-voucher-card__meta--countdown .voucher-countdown::after {
    display: none;
}
.vc-voucher-app .dvl-voucher-card__meta--countdown .vc-countdown--warning {
    background: none;
    border-color: transparent;
    animation: none;
    transform: none;
}
.vc-voucher-app .dvl-voucher-card__meta--countdown .vc-countdown--expired {
    background: none;
    border-color: transparent;
    animation: none;
}
.vc-voucher-app .dvl-voucher-card__meta--phone {
    color: var(--dvl-success, #38a169);
    font-weight: 600;
}
/* CTA button */
.vc-voucher-app .dvl-voucher-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: auto;
    padding: 0.7rem 1rem;
    background: var(--dvl-primary, #e53e3e);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    min-height: 44px;
    letter-spacing: 0.01em;
}
.vc-voucher-app .dvl-voucher-card__cta:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.3);
}
.vc-voucher-app .dvl-voucher-card--grand .dvl-voucher-card__cta {
    background: linear-gradient(135deg, #ff6b35, #e53e3e);
}

/* --- Voucher Popup Context Overrides --- */
/* Notch matches popup background (white/cream) */
.vc-voucher-app .dvl-voucher-card__notch {
    background: var(--vc-cream, #FFF8F0);
}
/* Ensure CTA button resets any inherited absolute positioning */
.vc-voucher-app .dvl-voucher-card__cta,
.vc-voucher-app .dvl-voucher-card__cta.vc-voucher-card__copy-btn {
    position: relative;
    bottom: auto;
    right: auto;
    left: auto;
    top: auto;
    max-width: none;
    height: auto;
    line-height: 1.4;
}
/* Slightly bump meta font sizes inside popup for readability */
.vc-voucher-app .dvl-voucher-card__meta--code {
    font-size: 0.82rem;
}
.vc-voucher-app .dvl-voucher-card__meta {
    font-size: 0.78rem;
}/* === CELEBRATION BOX - KHI TRÚNG VOUCHER === */
.vc-voucher-won-celebration {
    text-align: center;
    padding: var(--vc-space-lg);
    margin-bottom: var(--vc-space-md);
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
    border-radius: 16px;
    border: 2px solid #FFD700;
}

.vc-voucher-won-celebration__emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--vc-space-sm);
    animation: vc-celebration-bounce 0.6s ease infinite;
}

@keyframes vc-celebration-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.vc-voucher-won-celebration__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #C41E3A;
    text-shadow: 0 1px 2px rgba(196, 30, 58, 0.2);
}

/* ============================================================
   10. COUNTDOWN TIMER - TẾT STYLE
   ============================================================ */

/* Block countdown với thanh progress */
.vc-countdown {
    display: flex;
    align-items: center;
    gap: var(--vc-space-sm);
    padding: var(--vc-space-md);
    background: linear-gradient(135deg, #FFF9E6 0%, #FFE4B5 100%);
    border: 2px solid var(--vc-gold-primary);
    border-radius: var(--vc-radius-lg);
    font-size: var(--vc-font-size-sm);
    position: relative;
    overflow: hidden;
}

/* Họa tiết đồng hồ cát */
.vc-countdown::before {
    content: '⏳';
    position: absolute;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0.15;
}

.vc-countdown__icon {
    font-size: 1.25rem;
    animation: vc-hourglass 2s ease-in-out infinite;
}

@keyframes vc-hourglass {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.vc-countdown__text {
    font-weight: 700;
    color: var(--vc-red-primary);
    font-size: var(--vc-font-size-base);
}

.vc-countdown__bar {
    flex: 1;
    height: 6px;
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.vc-countdown__progress {
    height: 100%;
    background: linear-gradient(90deg, var(--vc-gold-primary) 0%, var(--vc-red-primary) 100%);
    border-radius: 3px;
    transition: width 1s linear;
    position: relative;
}

.vc-countdown__progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: vc-shimmer 1.5s infinite;
}

@keyframes vc-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Warning state - Sắp hết hạn */
.vc-countdown--warning {
    background: linear-gradient(135deg, #FFE5E5 0%, #FFC5C5 100%);
    border-color: var(--vc-error);
    animation: vc-warning-shake 0.5s ease-in-out infinite;
}

@keyframes vc-warning-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.vc-countdown--warning .vc-countdown__text {
    color: var(--vc-error);
}

.vc-countdown--warning .vc-countdown__progress {
    background: linear-gradient(90deg, var(--vc-error) 0%, #FF6B6B 100%);
}

/* Expired state - Đã hết hạn */
.vc-countdown--expired {
    background: var(--vc-gray-100);
    border-color: var(--vc-gray-400);
    animation: none;
}

.vc-countdown--expired::before {
    content: '⌛';
    opacity: 0.1;
}

.vc-countdown--expired .vc-countdown__text {
    color: var(--vc-gray-500);
    text-decoration: line-through;
}

.vc-countdown--expired .vc-countdown__icon {
    animation: none;
    opacity: 0.5;
}

/* === Inline Countdown Badge trong Voucher Card === */
.voucher-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--vc-space-xs) var(--vc-space-md);
    font-size: var(--vc-font-size-sm);
    font-weight: 700;
    color: var(--vc-white);
    background: linear-gradient(135deg, var(--vc-red-primary) 0%, #A51728 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect cho countdown */
.voucher-countdown::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: vc-badge-shimmer 2s infinite;
}

@keyframes vc-badge-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Countdown còn nhiều thời gian */
.voucher-countdown.plenty-time {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Countdown sắp hết hạn */
.voucher-countdown.warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    animation: vc-warning-pulse 1s ease-in-out infinite;
}

@keyframes vc-warning-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Countdown urgent - Rất gấp */
.voucher-countdown.urgent {
    background: linear-gradient(135deg, var(--vc-error) 0%, #B91C1C 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    animation: vc-urgent-pulse 0.5s ease-in-out infinite;
}

@keyframes vc-urgent-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 4px 16px rgba(220, 38, 38, 0.6);
    }
}

/* Countdown đã hết hạn */
.voucher-countdown.expired {
    background: var(--vc-gray-400);
    box-shadow: none;
    animation: none;
}

.voucher-countdown.expired::after {
    display: none;
}

.voucher-countdown.expired::before {
    content: '✕ ';
}

/* ============================================================
   11. VOUCHER LIST
   ============================================================ */
.vc-voucher-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Empty State */
.vc-voucher-list__empty {
    text-align: center;
    padding: var(--vc-space-2xl) var(--vc-space-lg);
}

.vc-voucher-list__empty-icon {
    font-size: 3.5rem;
    margin-bottom: var(--vc-space-md);
    display: block;
    animation: vc-bounce 3s ease-in-out infinite;
}

.vc-voucher-list__empty-title {
    font-size: var(--vc-font-size-lg);
    font-weight: 600;
    color: var(--vc-gray-800);
    margin-bottom: var(--vc-space-xs);
}

.vc-voucher-list__empty-text {
    font-size: var(--vc-font-size-sm);
    color: var(--vc-gray-600);
}

/* ============================================================
   12. ALERTS & NOTIFICATIONS
   ============================================================ */
.vc-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--vc-space-sm);
    padding: var(--vc-space-md);
    border-radius: var(--vc-radius-md);
    font-size: var(--vc-font-size-sm);
    animation: vc-fade-in 0.3s ease;
}

.vc-alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.vc-alert--success {
    color: #155724;
    background: var(--vc-success-light);
    border: 1px solid var(--vc-success);
}

.vc-alert--error {
    color: #721c24;
    background: var(--vc-error-light);
    border: 1px solid var(--vc-error);
}

.vc-alert--warning {
    color: #856404;
    background: var(--vc-warning-light);
    border: 1px solid var(--vc-warning);
}

.vc-alert--info {
    color: #0c5460;
    background: var(--vc-info-light);
    border: 1px solid var(--vc-info);
}

/* ============================================================
   13. LOADING SPINNER
   ============================================================ */
.vc-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--vc-space-md);
    padding: var(--vc-space-xl);
}

.vc-spinner__circle {
    width: 32px;
    height: 32px;
    border: 3px solid var(--vc-gray-200);
    border-top-color: var(--vc-red-primary);
    border-radius: 50%;
    animation: vc-spin 0.8s linear infinite;
}

.vc-spinner__text {
    font-size: var(--vc-font-size-sm);
    color: var(--vc-gray-600);
}

/* ============================================================
   14. TOAST NOTIFICATIONS
   ============================================================ */
.vc-toast-container {
    position: fixed;
    bottom: calc(var(--vc-space-lg) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--vc-z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--vc-space-sm);
    pointer-events: none;
    max-width: 90vw;
}

.vc-toast {
    display: flex;
    align-items: center;
    gap: var(--vc-space-sm);
    padding: var(--vc-space-md) var(--vc-space-lg);
    background: var(--vc-gray-800);
    color: var(--vc-white);
    border-radius: 25px;
    box-shadow: var(--vc-shadow-lg);
    font-size: var(--vc-font-size-sm);
    font-weight: 500;
    animation: vc-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

@keyframes vc-toast-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.vc-toast--success {
    background: var(--vc-success);
}

.vc-toast--error {
    background: var(--vc-error);
}

.vc-toast--exiting {
    animation: vc-toast-out 0.2s ease forwards;
}

@keyframes vc-toast-out {
    to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ============================================================
   15. OAT INTEGRATION STYLES
   ============================================================ */
.vc-voucher-app .vc-oat-section {
    margin-top: var(--vc-space-md);
    padding: var(--vc-space-md);
    background: var(--vc-cream);
    border: 1px solid var(--vc-gold-primary);
    border-radius: var(--vc-radius-md);
}

.vc-voucher-app .vc-oat-section__title {
    display: flex;
    align-items: center;
    gap: var(--vc-space-sm);
    font-size: var(--vc-font-size-sm);
    font-weight: 600;
    color: var(--vc-gold-dark);
    margin-bottom: var(--vc-space-sm);
}

.vc-voucher-app .vc-oat-voucher-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
}

.vc-voucher-app .vc-oat-voucher-item {
    display: block;
    padding: var(--vc-space-sm) var(--vc-space-md);
    color: var(--vc-red-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--vc-gray-200);
    transition: all var(--vc-transition-fast);
    cursor: pointer;
}

.vc-voucher-app .vc-oat-voucher-item:last-child {
    border-bottom: none;
}

.vc-voucher-app .vc-oat-voucher-item:hover {
    background: rgba(196, 30, 58, 0.1);
}

.vc-voucher-app .vc-oat-voucher-item__code {
    font-weight: 600;
    display: block;
}

.vc-voucher-app .vc-oat-voucher-item__desc {
    font-size: var(--vc-font-size-xs);
    color: var(--vc-gray-600);
}

/* ============================================================
   16. WHEEL PLUGIN INTEGRATION
   ============================================================ */
.won-voucher-display {
    position: relative;
    background: var(--vc-white, #fff);
    border-left: 4px solid var(--vc-gold-primary, #D4AF37);
    border-radius: var(--vc-radius-lg, 12px);
    padding: var(--vc-space-lg, 1.5rem);
    margin-bottom: var(--vc-space-md, 1rem);
    box-shadow: var(--vc-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
    border: 1px solid var(--vc-gray-200, #E9ECEF);
}

/* Reset khi dùng voucher card với hình ảnh */
.vc-voucher-card.won-voucher-display {
    background: transparent;
    border: none;
    border-left: none;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.won-voucher-display h4 {
    margin: 0 0 var(--vc-space-md, 1rem) 0;
    font-size: var(--vc-font-size-lg, 1.125rem);
    font-weight: 600;
    color: var(--vc-red-primary, #C41E3A);
}

.won-voucher-display p {
    margin: 0 0 var(--vc-space-sm, 0.5rem) 0;
    font-size: var(--vc-font-size-sm, 0.875rem);
    line-height: 1.6;
    color: var(--vc-gray-700, #495057);
}

.won-voucher-display p strong {
    color: var(--vc-gray-800, #343A40);
}

/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ---- iPad / Android Tablet & Phone Global Fixes ---- */

/* Touch devices: ensure popup is never taller than real visible viewport */
@supports (height: 100dvh) {
    .vc-voucher-app.vc-popup {
        height: 100dvh;
    }
    .vc-popup__container {
        max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
    .vc-result__content {
        max-height: 40dvh;
    }
    .vc-popup--has-result .vc-result__content {
        max-height: 55dvh;
    }
}

/* Desktop & Tablet (>768px): Center modal - tận dụng chiều cao viewport */
@media (min-width: 769px) {
    .vc-voucher-app.vc-popup {
        align-items: center; /* Center modal trên desktop/tablet */
        padding: var(--vc-space-lg);
        padding-bottom: calc(var(--vc-space-lg) + env(safe-area-inset-bottom, 0px));
    }
    .vc-popup__container {
        height: 85vh;
        height: 85dvh;
        max-height: calc(100vh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 16px; /* Full border-radius trên desktop */
    }
    .vc-result__content {
        max-height: 40vh;
        max-height: 40dvh;
    }
    .vc-popup--has-result .vc-result__content {
        max-height: 60vh;
        max-height: 60dvh;
    }
}
/* Desktop tall screens (>768px & chiều cao ≥900px) */
@media (min-width: 769px) and (min-height: 900px) {
    .vc-popup__container {
        height: 88vh;
        height: 88dvh;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
    }
}

/* iPad Portrait & Landscape (768-1024): thêm constraints */
@media (min-width: 768px) and (max-width: 1024px) {
    .vc-popup__container {
        max-width: 480px;
    }
}

/* ============================================================
   MOBILE: BOTTOM SHEET STYLE (≤768px)
   ============================================================ */

/* Mobile: Bottom Sheet style (bám đáy màn hình) */
@media (max-width: 768px) {
    .vc-voucher-app.vc-popup {
        padding: 0;
        padding-top: calc(10px + env(safe-area-inset-top, 0px)); /* nhỏ thôi */
        align-items: flex-end; /* BÁM ĐÁY */
        justify-content: center;
    }
    
    .vc-popup__container {
        /* Full-width trên mobile — bottom sheet */
        width: 100%;
        max-width: none;
        /* KHÔNG dùng height cứng → keyboard không gây jump */
        height: auto;
        min-height: 300px;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px));
        /* Border-radius: Bo góc trên, không bo dưới (bottom sheet) */
        border-radius: 20px 20px 0 0;
    }
    
    /* Header bottom sheet */
    .vc-popup__header {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    /* Footer bám đáy */
    .vc-popup__footer {
        border-radius: 0;
    }
    
    /* iOS input zoom fix: font >=16px */
    .vc-popup__container input,
    .vc-popup__container select,
    .vc-popup__container textarea {
        font-size: 16px !important;
    }
    
    .vc-result__content {
        max-height: 35vh;
        max-height: 35dvh;
    }
    .vc-popup--has-result .vc-result__content {
        max-height: 55vh;
        max-height: 55dvh;
    }
}

/* Mobile small screens: Tối ưu thêm */
@media (max-width: 600px) {
    .vc-popup__container {
        width: 100%; /* Full width trên mobile nhỏ */
        max-width: none;
        border-radius: 16px 16px 0 0; /* bottom-sheet bo góc trên */
    }
    
    .vc-popup__header {
        padding: 12px 15px 10px 15px;
        padding-right: calc(15px + 44px); /* Chừa chỗ cho nút X */
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    
    /* Điều chỉnh vị trí close button trên mobile */
    .vc-popup__close {
        top: 12px;
        right: 12px;
        width: 38px; /* Tăng kích thước một chút cho dễ bấm trên mobile */
        height: 38px;
    }
    
    .vc-popup__close svg {
        width: 20px;
        height: 20px;
    }
    
    .vc-popup__body {
        padding: var(--vc-space-md);
    }
}

/* ============================================================
   LANDSCAPE MODE (mobile xoay ngang)
   ============================================================ */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    /* Landscape: Quay về center style vì height thấp, bottom sheet không phù hợp */
    .vc-voucher-app.vc-popup {
        align-items: center; /* Quay về center */
        padding: var(--vc-space-sm);
    }
    
    .vc-popup__container {
        width: 85vw;
        max-width: 750px;
        height: auto;
        max-height: calc(95vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(95dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 16px;
    }
    
    .vc-popup__header {
        padding: var(--vc-space-sm) var(--vc-space-md);
        padding-right: calc(var(--vc-space-md) + 44px); /* Chừa chỗ cho nút X */
        border-radius: var(--vc-radius-lg) var(--vc-radius-lg) 0 0;
    }
    
    /* Đảm bảo close button hiển thị tốt trong landscape */
    .vc-popup__close {
        top: 10px;
        right: 10px;
    }
    
    .vc-popup__icon {
        width: 32px;
        height: 32px;
    }
    
    .vc-popup__subtitle {
        display: none;
    }
    
    .vc-result__content {
        max-height: 30vh;
        max-height: 30dvh;
    }
    .vc-popup--has-result .vc-result__content {
        max-height: 50vh;
        max-height: 50dvh;
    }
}

/* Extra Small: 320px - 359px */
@media (max-width: 359px) {
    .vc-voucher-app.vc-popup {
        padding: 0; /* Bottom sheet không cần padding */
    }

    .vc-popup__container {
        border-radius: 20px 20px 0 0; /* Giữ bottom sheet style */
    }

    .vc-popup__header {
        padding: var(--vc-space-md);
        padding-right: calc(var(--vc-space-md) + 44px); /* Chừa chỗ cho nút X */
    }
    
    /* Đảm bảo nút close không bị cắt trên màn hình nhỏ */
    .vc-popup__close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .vc-popup__icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .vc-popup__body {
        padding: var(--vc-space-md);
    }

    .vc-voucher-card {
        padding: 0;
    }

    .vc-voucher-card__code-value {
        font-size: var(--vc-font-size-base);
        letter-spacing: 1px;
    }

    .vc-floating-btn {
        width: 48px;
        height: 48px;
    }

    .vc-floating-btn__icon {
        width: 22px;
        height: 22px;
    }

    .vc-floating-label {
        display: none;
    }
}

/* Small: 360px - 389px */
@media (min-width: 360px) and (max-width: 389px) {
    .vc-popup__body {
        padding: var(--vc-space-md);
    }

    .vc-voucher-card__code {
        flex-wrap: wrap;
    }
}

/* Medium Small: 390px - 413px */
@media (min-width: 390px) and (max-width: 413px) {
    .vc-popup__body {
        padding: var(--vc-space-md) var(--vc-space-lg);
    }
}

/* Medium: 414px - 599px */
@media (min-width: 414px) and (max-width: 599px) {
    /* max-width removed — mobile bottom-sheet = full-width */
}

/* Small Tablet: 600px - 767px */
@media (min-width: 600px) and (max-width: 767px) {
    /* max-width removed — mobile bottom-sheet = full-width */

    .vc-voucher-app.vc-floating-wrapper {
        bottom: 120px;
        right: 24px;
    }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .vc-popup__container {
        max-width: 460px;
    }

    .vc-voucher-app.vc-floating-wrapper {
        bottom: 130px;
        right: 28px;
    }
}

/* Small Desktop: 1024px - 1365px */
@media (min-width: 1024px) and (max-width: 1365px) {
    .vc-popup__container {
        max-width: 480px;
    }

    .vc-voucher-app.vc-floating-wrapper {
        bottom: 140px;
        right: 32px;
    }

    .vc-floating-btn {
        width: 60px;
        height: 60px;
    }

    .vc-floating-btn__icon {
        width: 28px;
        height: 28px;
    }
}

/* Desktop: 1366px - 1439px */
@media (min-width: 1366px) and (max-width: 1439px) {
    .vc-popup__container {
        max-width: 500px;
    }

    .vc-voucher-app.vc-floating-wrapper {
        bottom: 150px;
        right: 36px;
    }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
    .vc-popup__container {
        max-width: 520px;
    }

    .vc-voucher-app.vc-floating-wrapper {
        bottom: 160px;
        right: 40px;
    }

    .vc-floating-btn {
        width: 64px;
        height: 64px;
    }

    .vc-floating-btn__icon {
        width: 30px;
        height: 30px;
    }
}

/* ============================================================
   18. PRINT STYLES
   ============================================================ */
@media print {
    .vc-voucher-app.vc-popup,
    .vc-voucher-app.vc-floating-wrapper {
        display: none !important;
    }
}

/* ============================================================
   19. ACCESSIBILITY ENHANCEMENTS
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .vc-voucher-app *,
    .vc-voucher-app *::before,
    .vc-voucher-app *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .vc-voucher-app {
        --vc-red-primary: #A01830;
        --vc-gray-300: #999;
        --vc-gray-500: #666;
    }

    .vc-form__input {
        border-width: 3px;
    }

    .vc-voucher-card:not(.dvl-voucher-card) {
        border-left-width: 0;
    }
}

/* Old copy-btn responsive overrides removed — now handled by .dvl-voucher-card__cta */