/* Premium Apple-Style Liquid Glass Design System */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --font-heading: 'Be Vietnam Pro', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    /* Elegant Red & White Luxury Palette */
    --primary: #991b1b; /* Crimson Red 800 */
    --primary-light: #dc2626; /* Bright Red 600 */
    --primary-dark: #7f1d1d; /* Deep Wine Red 900 */
    --accent: #d4af37; /* Luxury Gold */
    
    /* Liquid Glass Variables */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-bg-dark: rgba(15, 23, 42, 0.6);
    --glass-border-dark: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(153, 27, 27, 0.04);
}

body {
    font-family: var(--font-body);
    background-color: #fcfcfc; /* Pure soft pearl white */
    background-image: radial-gradient(at 0% 0%, rgba(254, 226, 226, 0.3) 0px, transparent 50%),
                      radial-gradient(at 50% 0%, rgba(220, 38, 38, 0.04) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(254, 242, 242, 0.25) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* Base Glassmorphism Styles */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-panel-dark {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-dark);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Premium Card hover style with scale */
.product-card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px -2px rgba(153, 27, 27, 0.03);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card-glass:hover {
    transform: translateY(-6px) scale(1.05);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(254, 226, 226, 0.8);
    box-shadow: 0 20px 40px -10px rgba(153, 27, 27, 0.12),
                0 0 0 1px rgba(220, 38, 38, 0.15);
}

.product-card-glass img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card-glass:hover img {
    transform: scale(1.08);
}

/* Custom Horizontal Categories Tags on Mobile */
.mobile-tags-container {
    display: flex;
    overflow-x: auto;
    gap: 0.6rem;
    padding: 0.5rem 0.25rem 0.75rem 0.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mobile-tag-item {
    flex: 0 0 auto;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.825rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #4b5563;
    backdrop-filter: blur(8px);
}

.mobile-tag-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.2);
}

/* Mobile Slide-Out Drawer Menu */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer-content {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-content.active {
    transform: translateX(0);
}

/* Sticky Action Widget - Mobile */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 -4px 20px rgba(153, 27, 27, 0.05);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
}

/* Desktop Floating Widgets */
.desktop-floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.desktop-floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(153, 27, 27, 0.12);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--primary);
    cursor: pointer;
}

.desktop-floating-btn:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 12px 30px rgba(153, 27, 27, 0.22);
    background: rgba(255, 255, 255, 0.92);
}

.desktop-floating-btn.btn-hotline {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.25);
}

.desktop-floating-btn.btn-zalo {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.25);
}

.desktop-floating-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.35;
    transform: scale(1);
    animation: ping-pulse 2s infinite;
}

@keyframes ping-pulse {
    0% {
        transform: scale(1);
        opacity: 0.35;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.desktop-floating-btn .tooltip {
    position: absolute;
    right: 70px;
    background: rgba(153, 27, 27, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translateX(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.desktop-floating-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
.glass-fade-in {
    animation: glassFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* GLOBAL TAILWIND COLOR OVERRIDES (Amber -> Luxury Crimson Red) */
.text-amber-950, .text-amber-900, .text-amber-850, .text-amber-800, .text-amber-700 {
    color: var(--primary) !important;
}
.text-amber-600, .text-amber-500, .text-amber-400 {
    color: var(--primary-light) !important;
}
.bg-amber-950, .bg-amber-900, .bg-amber-850, .bg-amber-800, .bg-amber-700 {
    background-color: var(--primary) !important;
}
.bg-amber-600, .bg-amber-500, .bg-amber-400 {
    background-color: var(--primary-light) !important;
}
.bg-amber-50, .bg-amber-50\/50, .bg-amber-50\/80 {
    background-color: rgba(220, 38, 38, 0.04) !important;
    border-color: rgba(220, 38, 38, 0.1) !important;
}
.hover\:bg-amber-900:hover, .hover\:bg-amber-800:hover, .hover\:bg-amber-750:hover, .hover\:bg-amber-700:hover {
    background-color: var(--primary-dark) !important;
}
.hover\:text-amber-800:hover, .hover\:text-amber-900:hover {
    color: var(--primary-dark) !important;
}
.border-amber-900, .border-amber-800, .border-amber-700, .border-amber-200 {
    border-color: rgba(220, 38, 38, 0.15) !important;
}
.focus\:ring-amber-900:focus, .focus\:ring-amber-800:focus, .focus\:ring-amber-700:focus {
    --tw-ring-color: var(--primary-light) !important;
}

/* MOBILE VIEW UX OPTIMIZATIONS (Max-width: 640px) */
@media (max-width: 640px) {
    .max-w-7xl, .max-w-4xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .py-12 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .py-10 {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }
    
    .product-card-glass {
        border-radius: 1rem !important;
    }
    
    .product-card-glass .p-4 {
        padding: 0.5rem !important;
    }
    
    .product-card-glass .text-xs {
        font-size: 9px !important;
    }
    
    .product-card-glass .text-sm {
        font-size: 10.5px !important;
        min-height: 30px !important;
        line-height: 1.25 !important;
    }
    
    .product-card-glass .mt-4 {
        margin-top: 0.4rem !important;
    }
    
    .product-card-glass .pt-3 {
        padding-top: 0.4rem !important;
    }
    
    .product-card-glass .mt-3 {
        margin-top: 0.4rem !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    
    .gap-4 {
        gap: 0.5rem !important;
    }
    
    .gap-6 {
        gap: 0.6rem !important;
    }
    
    .gap-8 {
        gap: 0.75rem !important;
    }
    
    /* Font resizing on mobile */
    h1.text-3xl {
        font-size: 1.5rem !important;
    }
    
    h2.text-3xl {
        font-size: 1.35rem !important;
    }
    
    .text-3xl {
        font-size: 1.35rem !important;
    }
    
    /* Quick order inputs on mobile */
    input:not(.pl-10), textarea, select {
        padding: 0.5rem 0.75rem !important;
        font-size: 11px !important;
        border-radius: 0.5rem !important;
    }
}

/* ==========================================
   LIVE CHAT SYSTEM STYLES
   ========================================== */
.live-chat-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
}

@media (max-width: 640px) {
    .live-chat-container {
        bottom: 80px; /* Shifted up on mobile to avoid overlapping the bottom sticky bar */
        right: 1rem;
    }
}

.live-chat-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(153, 27, 27, 0.16);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--primary);
    cursor: pointer;
    position: relative;
}

.live-chat-toggle-btn:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 12px 30px rgba(153, 27, 27, 0.25);
    background: rgba(255, 255, 255, 0.92);
}

.live-chat-toggle-btn .pulse-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.35;
    transform: scale(1);
    animation: ping-pulse 2s infinite;
}

.live-chat-box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    height: 420px;
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: chatBoxFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 12px 40px rgba(153, 27, 27, 0.15) !important;
}

@keyframes chatBoxFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.live-chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.live-chat-body {
    flex-grow: 1;
    overflow: hidden;
    height: calc(100% - 50px);
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg-customer {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-msg-admin {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.95);
    color: #1c1917;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(120, 113, 108, 0.15);
}

.chat-msg-time {
    font-size: 9px;
    opacity: 0.6;
    margin-top: 3px;
    display: block;
}

@media (max-width: 360px) {
    .live-chat-box {
        width: 285px;
        right: -10px;
    }
}

