/*
Theme Name: DinhDa Karsterly Rock Theme
Theme URI: https://dinhda-karsterlyrock.com
Author: baotran
Description: High-performance minimalist custom theme integrated with VikBooking and tracking pipeline. Tailored for Dinh Đá H'Mông - Karsterly Rock Lodge.
Version: 1.0
Text Domain: dinhda
*/

/* ==========================================
   1. GLOBAL VARIABLES & RESET
   ========================================== */
:root {
    /* Brand Colors - Karsterly Rock Lodge */
    --dd-primary: #ba6d43;         
    --dd-primary-hover: #9c5935;
    --dd-bg-base: #fdfcfb;         
    --dd-surface: #ffffff;         
    
    /* Text Colors */
    --dd-text-main: #2b2624;       
    --dd-text-muted: #736b66;
    
    /* Search Form (Expedia-style) Variables */
    --exp-primary: var(--dd-primary);
    --exp-primary-hover: var(--dd-primary-hover);
    --exp-text-main: var(--dd-text-main);
    --exp-text-muted: var(--dd-text-muted);
    --exp-border: #e5e0dc;
    --exp-bg: var(--dd-surface);
    --exp-radius: 12px;

    /* Typography */
    --font-heading: 'Philosopher', serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Structure & Effects */
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s ease;

    /* VikBooking Override Variable */
    --vbo-light-grey-bg-color: var(--dd-surface);
}

/* Global Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* Global Overflow Protection & Base Typography */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative; /* Keeps absolute children contained */
    font-family: var(--font-ui);
    color: var(--dd-text-main);
    background-color: var(--dd-bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Responsive Media Reset */
img, picture, video, iframe, figure {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   TYPOGRAPHY & LISTS (UI/UX Reset)
   ========================================== */
ul, ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.dd-single-content ul, 
.dd-single-content ol {
    padding-left: 2.5rem;
    margin-bottom: 25px;
}

.dd-single-content li {
    margin-bottom: 12px;
}

.dd-single-content li::marker {
    color: var(--dd-primary);
    font-weight: 700;
}

.main-navigation ul,
.dd-toc-list {
    padding-left: 0;
    margin-bottom: 0;
}

/* Base Structural Container */
.plugin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-content-inner .plugin-container,
.plugin-container .plugin-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ==========================================
   2. HEADER & NAVIGATION STYLING (DESKTOP)
   ========================================== */
.site-header {
    background-color: var(--dd-surface);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.site-header .header-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.site-branding .logo-link {
    display: block;
    line-height: 0; 
}

.site-branding .site-logo {
    max-width: 120px;
    max-height: 50px;
    object-fit: contain;
    transition: transform var(--transition-speed);
}

.site-branding a:hover .site-logo {
    transform: scale(1.02);
}

.header-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 35px; 
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    text-decoration: none;
    color: var(--dd-text-main);
    font-family: 'Philosopher', serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.5px;
    padding: 16px 0;
    display: inline-block;
    position: relative;
    transition: color 0.3s ease;
}

.main-navigation a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 10px;
    left: 0;
    background-color: var(--dd-primary);
    transition: width 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current_page_item > a {
    color: var(--dd-primary);
}

.main-navigation a:hover::before,
.main-navigation .current_page_item > a::before {
    width: 100%;
}

.highlight-item > a {
    color: var(--dd-primary) !important;
}

/* Mobile Toggle Base */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 26px;
    height: 2px;
    background-color: var(--dd-text-main);
    position: relative;
    transition: 0.3s;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 2px;
    background-color: var(--dd-text-main);
    left: 0;
    transition: 0.3s;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.submenu-toggle {
    display: none;
    cursor: pointer;
    padding: 15px;
    font-size: 20px;
    color: var(--dd-text-main);
    opacity: 0.6;
}

/* ==========================================
   3. HERO IMAGE LAYOUT (LCP OPTIMIZATION)
   ========================================== */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0; 
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; 
}

/* ==========================================
   4. UTILITIES & FLOATING PHONE BUTTON FIX
   ========================================== */
.rc-anchor-normal-footer { display: none !important; }
.grecaptcha-badge { visibility: hidden !important; }

.ga4-phone-click {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
}

#custom-floating-phone {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: inline-flex !important; /* Forces the box to wrap tightly around contents */
    align-items: center;
    background-color: var(--dd-primary);
    color: #ffffff;
    padding: 8px 16px 8px 8px; /* Extra right padding for text */
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: all 0.3s ease;
    width: max-content; /* Prevents button from stretching weirdly */
}

#custom-floating-phone:hover {
    background-color: var(--dd-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.phone-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;  
    height: 40px !important; 
    background-color: #ffffff !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important; /* Prevents the circle from squishing */
    margin-right: 12px;
    position: relative;
    animation: phone-pulse 2s infinite;
}

.phone-icon-wrapper svg {
    width: 20px !important;  
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    color: var(--dd-primary) !important;
}

.phone-number {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap; /* Prevents the phone number from wrapping and breaking the pill */
}

@keyframes phone-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ==========================================
   5. EDITORIAL FOOTER & LEAD FORM
   ========================================== */
.dd-editorial-footer {
    background-color: var(--dd-bg-base);
    color: var(--dd-text-main);
    border-top: 4px solid var(--dd-text-main);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.dd-footer-newsletter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 36px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 24px;
}

.dd-footer-newsletter .newsletter-title {
    font-family: var(--font-ui, serif);
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px 0;
    letter-spacing: -0.2px;
}

.dd-footer-newsletter .newsletter-subtitle {
    font-size: 14px;
    color: var(--dd-text-muted);
    margin: 0;
}

.dd-footer-newsletter .newsletter-form-wrapper {
    flex: 1 1 420px;
    max-width: 500px;
}

.dd-footer-newsletter .wpcf7-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}

.dd-footer-newsletter .wpcf7-form-control-wrap {
    flex: 1 1 220px;
    display: block;
}

.dd-footer-newsletter input[type="email"],
.dd-footer-newsletter input[type="text"] {
    width: 100%;
    height: 48px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 14px;
    color: var(--dd-text-main);
    background-color: var(--dd-surface);
    border: 1px solid var(--exp-border);
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
}

.dd-footer-newsletter input[type="email"]:focus,
.dd-footer-newsletter input[type="text"]:focus {
    border-color: var(--dd-primary);
    box-shadow: 0 0 0 3px rgba(186, 109, 67, 0.15);
}

.dd-footer-newsletter input[type="submit"] {
    height: 48px;
    padding: 0 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--dd-primary);
    border: 1px solid var(--dd-primary);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.dd-footer-newsletter input[type="submit"]:hover {
    background-color: var(--dd-primary-hover);
    border-color: var(--dd-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(186, 109, 67, 0.2);
}

.dd-footer-newsletter .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 4px;
    display: block;
}

.dd-footer-newsletter .wpcf7-response-output {
    width: 100%;
    margin: 8px 0 0 0 !important;
    padding: 10px 14px !important;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid transparent !important;
}

.dd-footer-newsletter .wpcf7-form.sent .wpcf7-response-output {
    background-color: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.3) !important;
    color: #2ecc71;
}

.dd-footer-newsletter .wpcf7-form.failed .wpcf7-response-output,
.dd-footer-newsletter .wpcf7-form.invalid .wpcf7-response-output {
    background-color: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.3) !important;
    color: #e74c3c;
}

.dd-footer-newsletter .wpcf7-spinner {
    position: absolute;
    right: -28px;
    top: 14px;
    margin: 0;
}

/* Footer Grid */
.dd-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dd-footer-brand { padding-right: 40px; }
.dd-footer-brand .footer-logo-link { display: inline-block; margin-bottom: 15px; }
.dd-footer-brand .footer-logo-img { max-height: 90px; }

.footer-desc {
    font-size: 0.95rem;
    color: var(--dd-text-muted);
    margin-bottom: 20px;
}

.footer-contact-info p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-contact-info a {
    color: var(--dd-text-main);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-contact-info a:hover { color: var(--dd-primary); }

.footer-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }

.footer-links a {
    color: var(--dd-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.footer-links a:hover { color: var(--dd-primary); }

.dd-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    font-size: 0.8rem;
    color: var(--dd-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-utility a {
    color: var(--dd-text-muted);
    text-decoration: none;
    margin-left: 20px;
    transition: color var(--transition-speed);
}

.footer-utility a:hover { color: var(--dd-primary); }

/* ==========================================
   6. RESPONSIVE MEDIA QUERIES (CASCADING)
   ========================================== */

/* Submenu Styling (Desktop Up) */
@media screen and (min-width: 992px) {
    .main-navigation .page_item_has_children > a::after {
        content: ' ▾';
        display: inline-block;
        font-size: 11px;
        opacity: 0.5;
        margin-left: 6px;
        transform: translateY(-2px);
    }
    
    .main-navigation ul .children,
    .main-navigation li.menu-item-has-children .sub-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(15px);
        background-color: var(--dd-surface);
        min-width: 260px;
        flex-direction: column;
        box-shadow: 0 15px 35px rgba(0,0,0,0.08);
        border-radius: 4px;
        border: 1px solid var(--exp-border);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        padding: 12px 0;
        z-index: 99;
    }

    .main-navigation li:hover > .children,
    .main-navigation li.menu-item-has-children:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        display: flex;
    }
    
    .main-navigation ul .children a,
    .main-navigation .sub-menu a {
        padding: 10px 24px;
        font-size: 15px;
        font-weight: 400;
        border-bottom: 1px solid #f5f5f5;
        width: 100%;
        display: block;
    }
    
    .main-navigation ul .children a::before { display: none; }
    .main-navigation ul .children li:last-child a,
    .main-navigation .sub-menu li:last-child a { border-bottom: none; }

    .main-navigation ul .children a:hover,
    .main-navigation .sub-menu a:hover {
        background-color: transparent;
        color: var(--dd-primary);
        padding-left: 28px;
    }
}

/* Footer Grid Adjustment */
@media screen and (max-width: 1024px) {
    .dd-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
    }
    .dd-footer-brand {
        grid-column: span 2;
        padding-right: 0;
        border-bottom: 1px solid var(--exp-border);
        padding-bottom: 30px;
    }
}

/* Header & Mobile Menu Setup */
@media screen and (max-width: 991px) {
    .header-top {
        justify-content: space-between;
        padding: 15px 0;
        border-bottom: none;
    }
    
    .header-bottom, .mobile-menu-toggle { display: block; }

    .main-navigation {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--dd-surface);
        box-shadow: 0 15px 30px rgba(0,0,0,0.05);
        padding: 0;
        z-index: 999;
        border-top: 1px solid rgba(0,0,0,0.05);
    }

    .main-navigation.is-active,
    .main-navigation.is-open { display: block; }

    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }
    .main-navigation li:last-child { border-bottom: none; }

    .main-navigation a {
        padding: 18px 24px;
        display: block;
        width: 100%;
        font-size: 18px;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }
    
    .main-navigation a::before { display: none; }

    .main-navigation a:hover {
        background-color: var(--dd-bg-base);
        color: var(--dd-primary);
        border-left: 3px solid var(--dd-primary);
        padding-left: 28px; 
    }

    .main-navigation .page_item_has_children {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .main-navigation .page_item_has_children > a { width: calc(100% - 60px); }

    .submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 100%;
        border-left: 1px solid rgba(0,0,0,0.04);
    }

    .main-navigation ul .children,
    .main-navigation li.menu-item-has-children .sub-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: var(--dd-bg-base);
        width: 100%;
    }

    .main-navigation ul .children.is-open,
    .main-navigation .page_item_has_children.is-open > .children,
    .main-navigation .menu-item-has-children.is-open > .sub-menu { display: block; }
    
    .main-navigation ul .children a {
        padding: 15px 24px 15px 40px; 
        font-size: 16px;
        font-weight: 400;
        border-left: none;
    }
    
    .main-navigation ul .children a:hover {
        padding-left: 45px;
        border-left: none;
        background-color: rgba(0,0,0,0.02);
    }
    
    .main-navigation .page_item_has_children > a::after { display: none; }
}

/* Tablet / Floating Button Breakpoint */
@media screen and (max-width: 768px) {
    .header-top { padding: 10px 0; }
    .site-branding .site-logo { max-width: 80px; max-height: 60px; }
    .mobile-menu-toggle { margin-right: -10px; }

    .dd-footer-newsletter {
        flex-direction: column;
        align-items: flex-start;
    }
    .dd-footer-newsletter .newsletter-form-wrapper {
        width: 100%;
        max-width: 100%;
        flex-basis: auto;
    }
    .dd-footer-newsletter .wpcf7-form { flex-direction: column; }
    .dd-footer-newsletter input[type="submit"] { width: 100%; }
    .dd-footer-brand .footer-logo-img { max-height: 50px; }

    /* Move phone to right corner on tablets */
    #custom-floating-phone {
        left: auto !important;
        right: 20px !important;
        bottom: 20px !important;
    }
}

/* Mobile Base Adjustments */
@media screen and (max-width: 600px) {
    .dd-editorial-footer { padding: 40px 0 20px; }
    .dd-footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .dd-footer-brand { grid-column: span 1; }
    
    .dd-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .footer-utility a { margin: 0 10px; }
}

/* Ultra Small Devices (Floating Button Compression - Perfect Circle Fix) */
@media screen and (max-width: 480px) {
    #custom-floating-phone .phone-number { 
        display: none !important; 
    }
    
    #custom-floating-phone { 
        padding: 5px !important; /* Forces equal padding for a perfect circle */
        border-radius: 50% !important; 
    }
    
    #custom-floating-phone .phone-icon-wrapper { 
        margin-right: 0 !important; /* Removes gap so it stays perfectly centered */
    }
} /* <--- THIS WAS THE MISSING BRACKET! */

/* ==========================================================================
   Vikbooking Modal Policy Page Styles
   ========================================================================== */

body.vikbooking-modal-policy {
    background-color: #ffffff;
    padding: 20px 30px;
    overflow-x: hidden;
}

body.vikbooking-modal-policy .policy-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
    line-height: 1.6;
    color: #333333;
}

body.vikbooking-modal-policy .policy-container h1,
body.vikbooking-modal-policy .policy-container h2,
body.vikbooking-modal-policy .policy-container h3 {
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

body.vikbooking-modal-policy .policy-container > *:first-child {
    margin-top: 0;
}

/* ==========================================================================
   Footer Bottom Bar & WPML Language Switcher Alignment
   ========================================================================== */

/* Ensure the bottom bar splits copyright (left) and utilities (right) */
.dd-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

/* Force the language switcher and sitemap into a single row */
.footer-utility {
    display: flex;
    align-items: center;
    gap: 25px; 
}

/* Harmonize the typography for all utility links */
.footer-utility a {
    text-transform: uppercase;
    font-size: 11px; 
    letter-spacing: 1px;
    color: #666666; 
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-utility a:hover {
    color: #ba6d43; /* Adjusted to match your primary var */
}

/* ==========================================================================
   Custom WPML Flag Alignment
   ========================================================================== */

.footer-utility a.custom-lang-link {
    display: inline-flex;
    align-items: center;
    gap: 6px; 
}

.custom-lang-flag {
    display: block;
    object-fit: contain;
    border: 1px solid #eaeaea; 
}


/* ==========================================================================
   Hide Cookie Revisit Button (Zero-Flash)
   ========================================================================== */
body.cky-consent-given .cky-btn-revisit-wrapper {
    display: none !important;
}