/* ============================================
   BAAC Market Fruit Buffet v2.0
   Design System — Tropical Vibrant Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
    /* Primary Colors — BAAC Green */
    --gold:            #008542;
    --gold-light:      #00a250;
    --gold-dark:       #006230;
    --gold-glow:       rgba(0, 133, 66, 0.2);

    /* Accent Colors — BAAC Gold */
    --coral:           #FF5252;
    --coral-light:     #FF8A80;
    --coral-glow:      rgba(255, 82, 82, 0.18);
    --teal:            #FFB81C;
    --teal-light:      #FFCC4D;
    --teal-glow:       rgba(255, 184, 28, 0.18);
    --purple:          #8B5CF6;
    --purple-glow:     rgba(139, 92, 246, 0.18);
    --orange:          #FF9100;

    /* Semantic Colors */
    --success:         #00C853;
    --success-dark:    #009624;
    --success-glow:    rgba(0, 200, 83, 0.2);
    --warning:         #FFAB00;
    --danger:          #D50000;
    --danger-glow:     rgba(213, 0, 0, 0.2);
    --info:            #0288D1;

    /* LINE Brand */
    --line-green:      #06C755;
    --line-glow:       rgba(6, 199, 85, 0.2);

    /* Fresh Tropical Light Backgrounds */
    --bg-deep:         #FAFDFB;
    --bg-base:         #F0F6F3;
    --bg-surface:      #FFFFFF;
    --bg-elevated:     #E5EDE9;
    --bg-glass:        rgba(255, 255, 255, 0.88);
    --bg-glass-light:  rgba(0, 0, 0, 0.03);

    /* Borders */
    --border-subtle:   rgba(0, 0, 0, 0.04);
    --border-light:    rgba(0, 0, 0, 0.08);
    --border-gold:     rgba(255, 158, 0, 0.25);
    --border-teal:     rgba(0, 163, 131, 0.25);

    /* Text */
    --text-primary:    #121F1A;
    --text-secondary:  #485A52;
    --text-muted:      #7E9088;
    --text-dark:       #121F1A;

    /* Shadows */
    --shadow-sm:       0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-md:       0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg:       0 16px 50px rgba(0, 0, 0, 0.08);
    --shadow-gold:     0 8px 32px rgba(255, 158, 0, 0.12), 0 0 12px rgba(255, 158, 0, 0.06);
    --shadow-teal:     0 8px 32px rgba(0, 163, 131, 0.1);
    --shadow-coral:    0 8px 32px rgba(255, 82, 82, 0.1);

    /* Typography */
    --font-main:       'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:       'SF Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs:   0.68rem;
    --text-sm:   0.78rem;
    --text-base: 0.88rem;
    --text-md:   0.95rem;
    --text-lg:   1.1rem;
    --text-xl:   1.3rem;
    --text-2xl:  1.6rem;
    --text-3xl:  2rem;

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  12px;
    --space-lg:  16px;
    --space-xl:  24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Radius */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring:  cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast:   150ms;
    --duration-normal: 300ms;
    --duration-slow:   500ms;
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Background Ambient Glow ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 20%, rgba(0, 212, 170, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 85% 15%, rgba(255, 214, 10, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 80%, rgba(255, 107, 107, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 600px 600px at 70% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.08); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px var(--gold-glow); }
    50%      { box-shadow: 0 0 25px var(--gold-glow), 0 0 40px rgba(255, 214, 10, 0.1); }
}

@keyframes pulseGlowTeal {
    0%, 100% { box-shadow: 0 0 10px var(--teal-glow); }
    50%      { box-shadow: 0 0 25px var(--teal-glow), 0 0 40px rgba(0, 212, 170, 0.1); }
}

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

@keyframes scanLine {
    0%   { top: 0; }
    50%  { top: calc(100% - 3px); }
    100% { top: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ticketHolo {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

@keyframes confettiFall {
    0%   { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Utility animation classes */
.animate-fade-in     { animation: fadeIn var(--duration-normal) var(--ease-out) both; }
.animate-fade-in-up  { animation: fadeInUp var(--duration-slow) var(--ease-out) both; }
.animate-scale-in    { animation: scaleIn var(--duration-normal) var(--ease-bounce) both; }
.animate-bounce-in   { animation: bounceIn 0.6s var(--ease-out) both; }
.animate-float       { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow  { animation: pulseGlow 2s ease-in-out infinite; }

/* Staggered animation delays */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* ============================================
   COMPONENTS
   ============================================ */

/* ── Glass Card ── */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--duration-normal) var(--ease-spring);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--text-dark);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(255, 214, 10, 0.35), 0 0 16px rgba(255, 214, 10, 0.15);
}

.btn-primary:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled::after { display: none; }

.btn-secondary {
    background: var(--bg-glass-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: var(--text-dark);
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-danger {
    background: rgba(255, 23, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 23, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(255, 23, 68, 0.2);
}

.btn-line {
    background: var(--line-green);
    color: #fff;
    box-shadow: 0 4px 16px var(--line-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 16px;
}

.btn-ghost:hover { color: var(--text-primary); }

.btn-sm { padding: 8px 16px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 32px; font-size: var(--text-md); }
.btn-block { width: 100%; }

/* ── Form Controls ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    color: var(--text-primary);
    font-size: var(--text-base);
    outline: none;
    transition: all var(--duration-normal) var(--ease-spring);
    width: 100%;
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-glow);
}

.form-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2378909C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: rgba(0, 230, 118, 0.12); color: var(--success); }
.badge-warning { background: rgba(255, 179, 0, 0.12); color: var(--warning); }
.badge-danger  { background: rgba(255, 23, 68, 0.12); color: var(--danger); }
.badge-info    { background: rgba(41, 182, 246, 0.12); color: var(--info); }
.badge-gold    { background: rgba(255, 214, 10, 0.12); color: var(--gold); }
.badge-teal    { background: rgba(0, 212, 170, 0.12); color: var(--teal); }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.spinner-teal { border-top-color: var(--teal); }
.spinner-line { border-top-color: var(--line-green); }

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-card { height: 120px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }

/* ── Toast Notification ── */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid;
    animation: fadeInDown var(--duration-normal) var(--ease-bounce) both;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

.toast-success {
    background: rgba(0, 230, 118, 0.12);
    border-color: rgba(0, 230, 118, 0.3);
    color: var(--success);
}

.toast-error {
    background: rgba(255, 23, 68, 0.12);
    border-color: rgba(255, 23, 68, 0.3);
    color: var(--danger);
}

.toast-warning {
    background: rgba(255, 179, 0, 0.12);
    border-color: rgba(255, 179, 0, 0.3);
    color: var(--warning);
}

.toast-info {
    background: rgba(41, 182, 246, 0.12);
    border-color: rgba(41, 182, 246, 0.3);
    color: var(--info);
}

.toast-exit {
    animation: fadeIn var(--duration-fast) reverse both;
}

/* ── Quantity Selector ── */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-glass-light);
}

.qty-btn {
    border: none;
    background: transparent;
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--duration-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: rgba(255, 255, 255, 0.08); }
.qty-btn:active { background: rgba(255, 255, 255, 0.15); }

.qty-value {
    width: 48px;
    text-align: center;
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--gold);
}

/* ── Progress Bar ── */
.progress-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-out);
    background: linear-gradient(90deg, var(--teal), var(--gold));
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--coral), var(--danger));
}

/* ── Confetti ── */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

/* ── Responsive Helpers ── */
@media (max-width: 768px) {
    :root {
        --text-xs:   0.65rem;
        --text-sm:   0.72rem;
        --text-base: 0.82rem;
        --text-md:   0.9rem;
        --text-lg:   1.05rem;
        --text-xl:   1.2rem;
    }
}

/* ── Durian Icon Utility ── */
.durian-icon {
    width: 1.25em;
    height: 1.25em;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 6px;
    position: relative;
    top: -1px;
}

