/* 
  HEAVEN HOUSE SAPPHIRE SKY - Master Responsive Stylesheet (responsive.css)
  Mobile-first & Multi-device alignment (Smartphones, Tablets, Laptops, Desktops, 4K)
  Patong Beach, Phuket, Thailand
*/

/* ==========================================================================
   1. GLOBAL RESPONSIVE DEFAULTS & VIEWPORT STABILITY
   ========================================================================== */
html, body {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Base Container Spacing */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Prevent mobile browser zoom on form input focus (iOS Safari requirement) */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   2. DESKTOP / LARGE DISPLAY OPTIMIZATIONS (1200px - 1440px+)
   ========================================================================== */
@media (min-width: 1201px) {
  .container {
    max-width: 1320px;
  }

  .food-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .rooms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   3. LAPTOPS & SMALL DESKTOPS (1024px - 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-slider {
    height: 75vh;
    min-height: 520px;
  }

  .slide-title {
    font-size: 3rem;
  }

  .food-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .rooms-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .tours-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* ==========================================================================
   4. TABLET LANDSCAPE & COMPACT LAPTOPS (992px - 1120px)
   ========================================================================== */
@media (max-width: 1120px) {
  .site-header {
    background: #FFFFFF;
  }

  .header-container {
    height: 72px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .brand-logo-img {
    max-height: 46px;
    max-width: 140px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.62rem;
  }

  /* Hamburger Toggle Display */
  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm, 8px);
    border: 1.5px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    color: var(--sapphire-main, #0C2340);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-fast, all 0.25s ease);
    z-index: 1001;
  }

  .mobile-toggle:hover {
    background: var(--sapphire-light, #EEF4FF);
    border-color: var(--sapphire-main, #0C2340);
    color: var(--sapphire-vibrant, #1D4ED8);
  }

  /* Mobile Slide-Out Drawer Navigation */
  .nav-menu {
    position: fixed;
    top: 72px;
    left: -100%;
    width: 320px;
    max-width: 85vw;
    height: calc(100vh - 72px);
    background: #FFFFFF;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0.25rem;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 35px rgba(12, 35, 64, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    border-right: 2px solid var(--accent-gold, #C59B27);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    width: 100%;
    display: block;
  }

  .nav-link {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-dark, #0F172A);
    padding: 0.75rem 0.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  .nav-link:hover, .nav-link.active {
    color: var(--sapphire-vibrant, #1D4ED8);
    background: var(--sapphire-light, #EEF4FF);
    padding-left: 0.8rem;
  }

  .nav-link::after {
    display: none;
  }

  .admin-nav-link {
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    justify-content: flex-start;
  }

  .nav-menu .btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    justify-content: center;
  }

  /* Booking Search Wrapper */
  .booking-search-wrapper {
    margin-top: -20px;
    padding: 0 1.25rem;
  }

  .booking-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .booking-form-grid .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .food-grid, .rooms-grid, .tours-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .todays-special-banner, .happy-hour-card {
    padding: 1.75rem;
  }
}

/* ==========================================================================
   5. TABLET PORTRAIT & MEDIUM SCREENS (768px - 991px)
   ========================================================================== */
@media (max-width: 991px) {
  .section-padding {
    padding: 4rem 0;
  }

  .hero-slider {
    height: 70vh;
    min-height: 520px;
  }

  .slide-caption {
    left: 2rem;
    right: 2rem;
    max-width: 100%;
    padding: 0;
  }

  .slide-title {
    font-size: clamp(2.2rem, 4.5vw, 2.9rem);
  }

  .slide-desc {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
  }

  /* Digital Menu PDF Toolbar */
  .pdf-toolbar {
    flex-direction: row;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .pdf-toolbar-group {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .pdf-canvas-container {
    min-height: 420px;
    max-height: 600px;
    padding: 1rem;
  }

  .menu-pdf-nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .menu-pdf-tabs-group {
    display: flex;
    width: 100%;
  }

  .menu-pdf-tab {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 0.65rem 0.8rem;
    font-size: 0.9rem;
  }

  .menu-pdf-nav-container .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer Layout */
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ==========================================================================
   6. MOBILE SMARTPHONES (768px and below) - FULL CENTERED ALIGNMENT
   ========================================================================== */
@media (max-width: 768px) {
  /* Header & Navigation */
  .header-container {
    height: 68px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav-menu {
    top: 68px;
    height: calc(100vh - 68px);
    width: 290px;
  }

  .brand-logo-img {
    max-height: 42px;
    max-width: 120px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-subtitle {
    font-size: 0.58rem;
    letter-spacing: 0.8px;
  }

  /* Section Spacing & Centered Headers */
  .section-padding {
    padding: 3rem 0;
  }

  .section-header, .section-title, .section-desc, .section-subtitle {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-desc {
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-width: 90%;
  }

  /* ==========================================
     HERO SLIDER - FULLY CENTERED ON MOBILE
     ========================================== */
  .hero-slider {
    height: 80vh !important;
    min-height: 520px !important;
    max-height: 640px !important;
    position: relative !important;
  }

  .slide-overlay {
    background: linear-gradient(180deg, rgba(8, 22, 40, 0.6) 0%, rgba(8, 22, 40, 0.78) 50%, rgba(8, 22, 40, 0.94) 100%) !important;
  }

  .slide-caption {
    position: absolute !important;
    top: 48% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 480px !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10 !important;
  }

  .slide-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 auto 0.85rem auto !important;
    padding: 0.35rem 1rem !important;
    font-size: 0.72rem !important;
    letter-spacing: 1.5px !important;
    border-radius: 50px !important;
  }

  .slide-title {
    text-align: center !important;
    font-size: clamp(1.65rem, 5.8vw, 2.35rem) !important;
    line-height: 1.25 !important;
    margin: 0 auto 0.75rem auto !important;
    color: #FFFFFF !important;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
    width: 100% !important;
  }

  .slide-desc {
    text-align: center !important;
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
    margin: 0 auto 1.35rem auto !important;
    max-width: 95% !important;
    color: #F1F5F9 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  /* Centered CTA Buttons in Hero */
  .hero-cta-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 290px !important;
    margin: 0 auto !important;
  }

  .slide-caption .btn {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 auto !important;
    padding: 0.75rem 1.4rem !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    min-height: 44px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  }

  /* Slider Navigation Arrows (Separated from Centered Content) */
  .slider-nav {
    position: absolute !important;
    bottom: 1.25rem !important;
    left: 1rem !important;
    right: 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    pointer-events: none !important;
    z-index: 20 !important;
    width: auto !important;
  }

  .slider-btn {
    pointer-events: auto !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 0.9rem !important;
    background: rgba(8, 22, 40, 0.75) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    color: #FFFFFF !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  }

  /* Quick Search Booking Card */
  .booking-search-wrapper {
    position: relative !important;
    z-index: 30 !important;
    margin-top: -20px !important;
    padding: 0 1rem !important;
  }

  .booking-search-card {
    padding: 1.4rem 1.25rem !important;
    border-radius: var(--radius-md, 14px) !important;
    border: 1.5px solid rgba(197, 155, 39, 0.3) !important;
    box-shadow: 0 14px 35px rgba(12, 35, 64, 0.16) !important;
  }

  .booking-form-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .booking-form-grid .form-control {
    padding: 0.7rem 0.9rem;
  }

  .booking-form-grid .btn {
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
  }

  /* Digital Menu Flipbook & PDF Viewer */
  .pdf-viewer-card {
    margin-bottom: 2rem;
  }

  .pdf-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.8rem;
  }

  .pdf-toolbar-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .pdf-btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .pdf-canvas-container {
    min-height: 360px;
    max-height: 480px;
    padding: 0.75rem;
  }

  /* Restaurant Menu Filter Bar */
  .menu-filter-bar {
    padding: 1.2rem 1rem;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .filter-search-box input {
    padding: 0.75rem 0.9rem 0.75rem 2.6rem;
    font-size: 0.9rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .filter-pills {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
    gap: 0.4rem;
    width: 100%;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .sort-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
  }

  /* Food Cards Grid & Layout */
  .food-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .food-card {
    border-radius: var(--radius-sm, 8px);
  }

  .food-card-img-wrap {
    height: 190px;
    min-height: 190px;
    max-height: 190px;
  }

  .food-body {
    padding: 1rem;
  }

  .food-header {
    min-height: auto;
    margin-bottom: 0.4rem;
  }

  .food-title {
    font-size: 1.05rem;
  }

  .food-price {
    font-size: 1.15rem;
  }

  .food-desc {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.8rem;
    min-height: auto;
    max-height: none;
    -webkit-line-clamp: 2;
  }

  .food-footer {
    padding-top: 0.75rem;
  }

  .food-order-btn {
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
    min-height: 38px;
  }

  /* Room Cards Grid */
  .rooms-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .room-thumb-wrapper {
    height: 200px;
  }

  .room-body {
    padding: 1.2rem;
  }

  .room-title {
    font-size: 1.2rem;
  }

  .room-meta {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .room-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .room-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    min-height: 42px;
  }

  /* Special Banners */
  .todays-special-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1.25rem;
    gap: 1rem;
    align-items: center;
  }

  .todays-special-banner .btn {
    width: 100%;
    justify-content: center;
  }

  .happy-hour-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1.25rem;
    gap: 1rem;
    align-items: center;
  }

  .happy-hour-card .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tours & Gallery */
  .tours-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .gallery-item {
    height: 180px;
  }

  /* Map Container */
  .map-container {
    height: 280px;
  }

  /* Footer Layout */
  .site-footer {
    padding-top: 3rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.25rem 0;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Floating Contact Widgets (WhatsApp, Call, Scroll-to-Top) */
  .floating-actions, .floating-widget-container {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right: 16px;
    gap: 10px;
    z-index: 999;
  }

  .float-btn {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Modal Popups & Upload Dropzone */
  .modal-wrapper {
    padding: 0.75rem;
  }

  .modal-box {
    padding: 1.5rem 1.2rem;
    max-width: 95vw;
    border-radius: var(--radius-sm, 8px);
  }

  .pdf-dropzone {
    padding: 1.8rem 1rem;
  }
}

/* ==========================================================================
   7. SMALL SMARTPHONES & COMPACT SCREENS (480px and below)
   ========================================================================== */
@media (max-width: 480px) {
  .header-container {
    height: 64px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .logo-brand {
    gap: 0.5rem;
    max-width: calc(100% - 50px);
    overflow: hidden;
  }

  .brand-logo-img {
    max-height: 38px;
    max-width: 90px;
  }

  .brand-title {
    font-size: 0.85rem;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    font-size: 0.52rem;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    flex-shrink: 0;
  }

  /* Hero Slider for Small Phones */
  .hero-slider {
    height: 82vh !important;
    min-height: 490px !important;
  }

  .slide-caption {
    width: 92% !important;
    top: 47% !important;
  }

  .slide-title {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
  }

  .slide-desc {
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
    margin-bottom: 1.2rem !important;
  }

  .hero-cta-group {
    max-width: 260px !important;
    gap: 0.6rem !important;
  }

  .btn {
    padding: 0.7rem 1.1rem;
    font-size: 0.88rem;
    min-height: 44px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .gallery-item {
    height: 200px;
  }

  /* Currency Exchange Table Horizontal Scroll */
  .exchange-table-container {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .exchange-table th, .exchange-table td {
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

/* ==========================================================================
   8. EXTRA SMALL SCREENS (360px and below, e.g. iPhone SE / Galaxy Mini)
   ========================================================================== */
@media (max-width: 360px) {
  .brand-title {
    font-size: 0.78rem;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-slider {
    min-height: 480px !important;
  }

  .slide-title {
    font-size: 1.45rem !important;
  }

  .slide-desc {
    font-size: 0.82rem !important;
  }

  .menu-pdf-tab {
    padding: 0.55rem 0.4rem;
    font-size: 0.8rem;
    gap: 4px;
  }

  .badge-tab {
    display: none;
  }

  .food-title {
    font-size: 0.98rem;
  }

  .food-price {
    font-size: 1.05rem;
  }
}
