/* 
   Sala Garden - Custom CSS
   Overrides and Custom Utilities that complement Tailwind v4 
*/

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body, .font-sans, .font-serif {
    font-family: "Google Sans Flex", sans-serif !important;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings:
        "slnt" 0,
        "wdth" 100,
        "GRAD" 0,
        "ROND" 0;
}

body {
    font-size: clamp(14px, 1.6vw, 16px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cfa85c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a2b;
}

/* Animations that are missing from base tailwind or custom defined */
@keyframes slow-zoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.animate-slow-zoom {
    animation: slow-zoom 20s infinite alternate ease-in-out;
}

/* ===== Amenities Bento Grid ===== */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    grid-auto-flow: dense;
    gap: 10px;
}

@media (min-width: 768px) {
    .amenities-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 180px;
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .amenities-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 180px;
        gap: 16px;
    }
}

/* Styling for sticky header transitions */
.header-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* CTA Button glow pulse effect when scrolled */
@keyframes cta-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(181, 133, 76, 0.4), 0 0 20px rgba(181, 133, 76, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px rgba(181, 133, 76, 0.7), 0 0 40px rgba(181, 133, 76, 0.25);
        transform: scale(1.03);
    }
}

.cta-glow {
    animation: cta-glow 2s ease-in-out infinite;
}

.cta-glow:hover {
    animation: none;
    transform: translateY(-2px);
}

/* Form effects */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 2px rgba(207, 168, 92, 0.2);
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Swiper Blog custom pagination */
.blog-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #9C6B28;
    opacity: 0.25;
    transition: all 0.3s ease;
}

.blog-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 28px;
    border-radius: 5px;
    background: #9C6B28;
}

/* =============================================
   Body - Basic Resets & Aesthetics
   ============================================= */
body {
    color: #333;
    background-color: var(--color-surface);
}

/* =============================================
   Glass Header - Hiệu ứng kính mờ cho header
   ============================================= */
.glass-header {
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px -5px rgba(92, 58, 33, 0.08);
    border-bottom: 1px solid rgba(181, 133, 76, 0.1);
}

/* =============================================
   RESPONSIVE: Header - Mobile Only (≤767px)
   - Trang chủ (has-hero-video): relative, không che video
   - Trang phụ: fixed, full-width, flat bar  
   ============================================= */
@media (max-width: 767px) {
    /* === Trang chủ: header relative === */
    body.has-hero-video #main-header {
        position: relative !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        pointer-events: auto !important;
    }
    body.has-hero-video #main-header > div {
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: var(--color-surface) !important;
    }

    /* === Trang phụ: header fixed, flat, full-width === */
    body:not(.has-hero-video) #main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        pointer-events: auto !important;
        background: var(--color-surface) !important;
        backdrop-filter: none !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
        z-index: 50 !important;
    }
    body:not(.has-hero-video) #main-header > div {
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        padding-top: 0.6rem !important;
        padding-bottom: 0.6rem !important;
    }
}

/* =============================================
   RESPONSIVE: Hero Video - Mobile + iPad (≤1024px)
   Video YouTube hiển thị tỷ lệ 16:9,
   dùng trick width 300% + margin-left -100%
   để ẩn YouTube branding (giống đối thủ)
   ============================================= */
@media (max-width: 1024px) {
    #hero-video {
        position: relative !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
    }
    #hero-video > div {
        position: relative !important;
        width: 100%;
        aspect-ratio: 16/9;
        overflow: hidden;
    }
    #hero-video iframe {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 300% !important;
        height: 100% !important;
        min-width: unset !important;
        min-height: unset !important;
        margin-left: -100%;
        pointer-events: none;
    }
}

/* =============================================
   Product Tabs - Interactive Tabs cho Mộ Phần
   ============================================= */

/* Tab default state */
.product-tab {
    color: #666;
    background: transparent;
}

/* Tab hover */
.product-tab:hover {
    color: #9D6B33;
    background: rgba(181, 133, 76, 0.06);
    border-radius: 0.5rem;
}

/* Tab active state */
.product-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #9D6B33, #b5854c);
    border-color: transparent;
    border-radius: 0.5rem;
}

.product-tab.active i {
    opacity: 1;
    color: #fff;
}

/* Panel transitions */
.product-panel {
    animation: fadeInPanel 0.4s ease-out;
}

.product-panel.hidden {
    display: none;
}

/* Fixed height text area below swiper to prevent jitter */
.product-panel-info {
    min-height: 130px;
}

@media (min-width: 1024px) {
    .product-panel-info {
        min-height: 80px;
    }
}

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

/* Product Swiper navigation */
[class*="product-swiper"] .swiper-button-prev,
[class*="product-swiper"] .swiper-button-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

[class*="product-swiper"] .swiper-button-prev:hover,
[class*="product-swiper"] .swiper-button-next:hover {
    background: #9D6B33;
}

[class*="product-swiper"] .swiper-button-prev::after,
[class*="product-swiper"] .swiper-button-next::after {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

[class*="product-swiper"] .swiper-button-prev:hover::after,
[class*="product-swiper"] .swiper-button-next:hover::after {
    color: #fff;
}

[class*="product-swiper"] .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #9C6B28;
    opacity: 0.3;
    transition: all 0.3s ease;
}

[class*="product-swiper"] .swiper-pagination-bullet-active {
    opacity: 1;
    width: 28px;
    border-radius: 5px;
    background: #9C6B28;
}

/* Scrollbar hide for mobile tabs */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}