/* =============================================================================
   Casa Vergara Resort - FINAL responsive layer (load LAST on every page).
   Fixes: hero stats wrapping onto a 2nd row, laptop-width navbar crowding,
   tablet hero/grid layouts, fluid type, and wide-screen scaling.
   Delete this file and its <link> lines to go back to the previous CSS.
   ========================================================================== */

/* ---- 0. Fluid foundation ------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
img, video, svg, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
.container { width: 100%; }

/* ---- 1. Landing hero stats: always ONE row of three (was wrapping) -------- */
html body .hero-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: 34rem;
  align-items: stretch;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(12, 59, 93, 0.12);
}
html body .hero-stats .hero-stat-item {
  min-width: 0;
  margin: 0;
  padding: 0 clamp(0.5rem, 1.6vw, 1.25rem);
  flex: none;
}
html body .hero-stats .hero-stat-item:first-child { padding-left: 0; }
html body .hero-stats .hero-stat-item + .hero-stat-item {
  border-left: 1px solid rgba(12, 59, 93, 0.14);
}
html body .hero-stats .hero-stat-item h4 {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.15rem);
  white-space: nowrap;
}
html body .hero-stats .hero-stat-item p {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: clamp(0.74rem, 0.68rem + 0.25vw, 0.94rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
html[data-theme="dark"] body .hero-stats { border-top-color: rgba(255, 255, 255, 0.14); }
html[data-theme="dark"] body .hero-stats .hero-stat-item + .hero-stat-item { border-left-color: rgba(255, 255, 255, 0.16); }

/* ---- 2. Hero layout ------------------------------------------------------ */
.landing-hero .hero-title { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); line-height: 1.08; }
.landing-hero .hero-description { font-size: clamp(0.98rem, 0.9rem + 0.35vw, 1.2rem); max-width: 36rem; }
.hero-image-wrap { max-width: 100%; }
.hero-image-wrap .hero-pool-image { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

/* Tablets and below: stacked, centred, photo first */
@media (max-width: 991.98px) {
  .landing-hero .row { --bs-gutter-y: 1.5rem; }
  .landing-hero .hero-image-col { max-width: 40rem; margin-inline: auto; }
  .hero-image-wrap { border-radius: 96px 24px 24px 96px; }
  .landing-hero-text { text-align: center; }
  .landing-hero-text .hero-description { margin-inline: auto; }
  .landing-hero-actions { justify-content: center; }
  html body .hero-stats { margin-inline: auto; }
  .hl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hl-card { min-height: 0; padding: 2.25rem 1.5rem; }
}

/* Phones */
@media (max-width: 575.98px) {
  .hero-image-wrap { border-radius: 64px 20px 20px 64px; }
  .hero-image-wrap .hero-pool-image { aspect-ratio: 16 / 11; }
  .landing-hero-actions { flex-direction: column; align-items: stretch; }
  .landing-hero-actions .btn { width: 100%; }
  html body .hero-stats { max-width: 100%; }
  .hl-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .section-pad { padding-top: 2.75rem; padding-bottom: 2.75rem; }
}

/* Very small phones */
@media (max-width: 359.98px) {
  html body .hero-stats .hero-stat-item { padding-inline: 0.35rem; }
  html body .hero-stats .hero-stat-item p .bi { display: none; }
}

/* ---- 3. Navbar: laptop widths (992 - 1199px) no longer crowd ------------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-navbar .navbar-brand { margin-right: 0.75rem !important; }
  .site-navbar .brand-title,
  .site-navbar .figma-brand-title { font-size: 1rem; white-space: nowrap; }
  .site-navbar .nav-link,
  .site-navbar .nav-link-luxury { padding-inline: 0.55rem !important; font-size: 0.92rem; }
  .site-navbar .nav-auth-row { gap: 0.5rem !important; }
  .site-navbar .nav-auth-row .btn { padding-inline: 0.9rem; white-space: nowrap; }
}

/* Below lg the menu collapses: make the open panel scroll and full width */
@media (max-width: 991.98px) {
  .site-navbar .navbar-collapse {
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-navbar .nav-link { padding-block: 0.7rem; }
  .site-navbar .brand-title,
  .site-navbar .figma-brand-title { font-size: clamp(0.9rem, 3.6vw, 1.1rem); }
}
@media (max-width: 420px) {
  .site-navbar .brand-logo,
  .site-navbar .figma-brand-logo { width: 2.25rem; height: 2.25rem; }
  .site-navbar .nav-auth-row { gap: 0.35rem !important; }
  .site-navbar .nav-auth-row .btn { padding-inline: 0.65rem; font-size: 0.85rem; }
}

/* ---- 4. Cards, grids and sections --------------------------------------- */
@media (max-width: 991.98px) {
  .row.about-preview { --bs-gutter-y: 1.5rem; }
  .about-metrics > [class*="col"] { margin-bottom: 1rem; }
  .reviews-carousel { max-width: 100%; }
}
@media (max-width: 767.98px) {
  .room-card .room-cover { height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
  .room-card-footer { flex-wrap: wrap; gap: 0.5rem; }
  .image-mosaic .mosaic-img { width: 100%; height: auto; }
  h2, .display-5 { font-size: clamp(1.5rem, 6vw, 2rem); }
}

/* Footer columns stack cleanly */
@media (max-width: 767.98px) {
  footer .row > [class*="col"] { flex: 0 0 100%; max-width: 100%; text-align: center; }
}

/* ---- 5. Forms, tables and widgets (every page) -------------------------- */
.table-responsive, .admin-table-card { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { max-width: 100%; }
@media (max-width: 767.98px) {
  .page-link { padding: 0.4rem 0.7rem; }
  .d-flex.justify-content-between.align-items-center { flex-wrap: wrap; gap: 0.5rem; }
  .card-body, .soft-card { padding-left: clamp(0.85rem, 4vw, 1.5rem); padding-right: clamp(0.85rem, 4vw, 1.5rem); }
}

/* Floating chat button never covers content on small screens */
@media (max-width: 575.98px) {
  #cvrGuestChatRoot, #cvrFaqBotRoot { transform: scale(0.9); transform-origin: bottom right; }
}

/* ---- 6. Wide screens: keep the layout proportioned ---------------------- */
@media (min-width: 1400px) {
  .landing-hero .container { max-width: 1240px; }
}
@media (min-width: 1920px) {
  .landing-hero .container { max-width: 78rem; }
}

/* ---- 7. Short / landscape screens --------------------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
  .landing-hero { padding-block: 1.5rem; }
  .hero-image-wrap .hero-pool-image { aspect-ratio: 16 / 9; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html body .hero-stats, .landing-hero * { animation: none !important; }
}

/* A phone requesting a desktop site can report a wide layout viewport.
   Keep the compact layout when the actual device or touch viewport is small. */
@media (max-width: 767.98px), (max-device-width: 767px), (pointer: coarse) and (max-width: 1024px) {
  body { min-width: 0; }
  .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl,
  .container-fluid {
    width: 100%;
    max-width: 100%;
  }
  .row > *, .admin-main, .admin-page, .soft-card, .modal-content { min-width: 0; }
  .admin-main { padding-inline: max(0.75rem, env(safe-area-inset-left, 0px)); }
  .admin-page-head > .d-flex,
  .admin-page-head .d-flex.justify-content-between { align-items: flex-start; }
  .admin-page-head .btn-toolbar,
  .admin-page-head .btn-group,
  .admin-page-head .d-flex.gap-2 { flex-wrap: wrap; }
  .table-responsive, .admin-table-card { max-width: 100%; }
  .modal-dialog { width: auto; max-width: calc(100% - 1rem); }
  .modal-content { overflow-wrap: anywhere; }
}

@media (max-device-width: 767px), (pointer: coarse) and (max-width: 1024px) {
  .site-navbar .navbar-expand-lg > .container,
  .site-navbar .navbar-expand-lg > .container-fluid {
    flex-wrap: wrap;
  }
  .site-navbar .navbar-expand-lg .navbar-toggler { display: block; }
  .site-navbar .navbar-expand-lg .navbar-collapse { flex-basis: 100%; }
  .site-navbar .navbar-expand-lg .navbar-collapse:not(.show) { display: none; }
  .site-navbar .navbar-expand-lg .navbar-collapse.show { display: block; }
}

@media (pointer: coarse) {
  .hl-card, .room-card, .feature-card { animation: none; transition: none; }
  .admin-wrap .admin-main > *,
  .admin-wrap .admin-main > .admin-page-head,
  .admin-wrap .admin-main > .row > [class*="col"] > .soft-card {
    animation: none !important;
  }
  .admin-wrap .soft-card,
  .admin-wrap .table tbody tr,
  .admin-wrap .btn {
    transition: none;
  }
  .admin-wrap .btn-brand:hover,
  .admin-wrap .btn-primary:hover,
  .admin-wrap .btn-outline-primary:hover,
  .admin-wrap .nav-pills .nav-link:hover {
    transform: none;
  }
}

@media (max-width: 767.98px), (pointer: coarse) and (max-width: 1024px) {
  .landing-hero .container { padding-inline: 1.1rem; }
  .landing-hero .row { --bs-gutter-y: 1.25rem; }
  .landing-hero .row > [class*="col-"] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
  .landing-hero .hero-image-col { max-width: 34rem; margin-inline: auto; }
  .landing-hero-visual { margin-inline: auto; }
  .landing-hero .hero-pool-image { aspect-ratio: 16 / 10; }
  .landing-hero-text {
    margin-bottom: 0 !important;
    text-align: center;
  }
  .landing-hero .hero-title {
    max-width: 15ch;
    margin-inline: auto;
    font-size: clamp(2rem, 8vw, 2.8rem);
    line-height: 1.08;
  }
  .landing-hero-text .hero-description { max-width: 34ch; margin-inline: auto; }
  .landing-hero-actions {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.65rem !important;
  }
  .landing-hero-actions .btn { flex: 0 1 10rem; width: auto; padding-inline: 0.9rem !important; }
  html body .hero-stats { max-width: 28rem; margin-inline: auto; }

  .landing-highlights-strip {
    padding: 3.25rem 1rem 4rem;
    text-align: center;
  }
  .landing-highlights-strip .container { max-width: 38rem; }
  body .landing-highlights-strip .landing-highlights-head { margin-bottom: 1.5rem !important; }
  body .landing-highlights-strip .landing-highlights-head h2 { font-size: clamp(1.65rem, 6vw, 2.1rem); }
  body .landing-highlights-strip .hl-lead { max-width: 34ch; margin-inline: auto; }
  body .landing-highlights-strip .hl-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 28rem;
    gap: 0.9rem;
  }
  body .landing-highlights-strip .hl-card {
    display: flex;
    min-height: 0;
    align-items: center;
    padding: 1.3rem 1.15rem 1.4rem;
    text-align: center;
  }
  body .landing-highlights-strip .hl-icon { margin: 0 0 0.85rem; }
  body .landing-highlights-strip .hl-card h3 { margin-bottom: 0.4rem; font-size: 1.2rem; }
  body .landing-highlights-strip .hl-card p { max-width: 34ch; font-size: 0.95rem; }

  .landing-highlights-strip + .section-pad > .container > .about-preview > .col-lg-6:first-child {
    text-align: center;
  }
  .landing-highlights-strip + .section-pad .about-preview-cta {
    justify-content: center;
  }
  .landing-highlights-strip + .section-pad .image-mosaic { margin-top: 1.5rem; }

  .landing-cta-section-v2 { padding: 2rem 1rem !important; }
  .landing-cta-section-v2 .container { padding-inline: 0; }
  .landing-cta-panel { margin-inline: auto; }
  .landing-cta-panel > [class*="col-"] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
  .landing-cta-panel-media { min-height: 13rem; }
  .landing-cta-panel-text { align-items: center; text-align: center; }
  .landing-cta-panel-text > * { max-width: 34rem; }
  .landing-cta-kicker { align-self: center; }
  .landing-cta-panel-text > .d-flex { justify-content: center; }

  .footer-main > .container.section-pad { padding: 2rem 1.1rem 1rem !important; }
  .footer-main .footer-top-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    text-align: center;
  }
  .footer-main .footer-brand-stack {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    row-gap: 0.65rem;
  }
  .footer-main .footer-brand-logo,
  .footer-main .footer-brand-heading,
  .footer-main .footer-brand-text,
  .footer-main .footer-brand-social {
    grid-column: 1;
    justify-self: center;
  }
  .footer-main .footer-brand-logo { grid-row: 1; }
  .footer-main .footer-brand-heading { grid-row: 2; }
  .footer-main .footer-brand-text { grid-row: 3; max-width: 34ch; }
  .footer-main .footer-brand-social { grid-row: 4; justify-content: center; }
  .footer-main .footer-links-col,
  .footer-main .footer-contact-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-main .footer-title::after { left: 50%; transform: translateX(-50%); }
  .footer-main .footer-link-list,
  .footer-main .footer-contact-list {
    width: 100%;
    max-width: 24rem;
    align-items: center;
    padding: 0;
    text-align: center;
  }
  .footer-main .footer-link,
  .footer-main .footer-contact-line,
  .footer-main .footer-contact-line.is-multiline {
    justify-content: center;
    align-items: center;
    text-align: center;
  }
  .footer-main .footer-contact-line span,
  .footer-main .footer-contact-line a {
    flex: 0 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .footer-main .footer-bottom-inner {
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    text-align: center;
  }
  .footer-main .footer-bottom-right { width: 100%; justify-content: center; }
  .footer-main .footer-bottom-links { justify-content: center; gap: 0.55rem 1rem; }
}
