/* ============================================================
   RESPONSIVE.CSS — Condortrekk Theme v1.8.3
   Hotfix: selectores corregidos para match con HTML real.
   Mobile menu ya definido en main.css (breakpoint 1024px).
   Este archivo APLICA sobre main.css / home.css / woocommerce.css
   ============================================================ */

/* ── OVERFLOW GLOBAL FIX ──────────────────────────────────── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
img, video, iframe, table {
  max-width: 100%;
  height: auto;
}
* {
  box-sizing: border-box;
}

/* ── TABLET (< 1200px) ────────────────────────────────────── */
@media (max-width: 1199px) {
  .container {
    padding-inline: 1.5rem;
  }
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .tours-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ── MOBILE (< 1024px) — complementa mobile nav ───────────── */
@media (max-width: 1024px) {
  /* Header CTA oculto en mobile (ya definido en main.css pero reforzamos) */
  .header-cta { display: none; }

  /* Top bar — compactar en mobile */
  .top-bar {
    display: none; /* oculta teléfono/email/horario que saturan el viewport */
  }

  /* Site header padding compacto */
  .site-header__inner {
    padding-block: 0.65rem;
  }
  .site-logo img {
    max-height: 48px;
    width: auto;
  }

  /* Nav toggle hamburger — asegurar clickabilidad SIEMPRE ARRIBA */
  .nav-toggle {
    z-index: 100002 !important;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.2);
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  /* Primary nav: DEBE estar encima del overlay oscuro */
  .primary-nav {
    width: min(320px, 85vw);
    z-index: 100001 !important;
    isolation: isolate;
  }
  .primary-nav__list {
    padding-left: 0;
    list-style: none;
  }
  .primary-nav__dropdown {
    padding-left: 0;
    list-style: none;
  }

  /* Chevron indicator del dropdown — area táctil grande */
  .primary-nav__arrow {
    transition: transform 200ms ease;
    margin-left: auto;
    width: 24px;
    height: 24px;
    padding: 8px;
    box-sizing: content-box;
    flex-shrink: 0;
    cursor: pointer;
  }
  .primary-nav__item.is-expanded > .primary-nav__link .primary-nav__arrow {
    transform: rotate(180deg);
  }

  /* Visual feedback: item expandido resaltado */
  .primary-nav__item.is-expanded > .primary-nav__link {
    background: rgba(232, 101, 26, 0.12);
  }

  /* REFUERZO: dropdowns mobile deben estar static, sin fondo blanco
     (override cualquier cascade rara) */
  .primary-nav__dropdown {
    position: static !important;
    background: rgba(255, 255, 255, 0.03) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
    padding: 0 !important;
    list-style: none;
    margin: 0;
  }
  .primary-nav__item.is-expanded > .primary-nav__dropdown {
    max-height: 2000px;
    padding: 0.25rem 0 0.5rem !important;
  }
  .primary-nav__dropdown-item {
    display: block;
    padding: 0.65rem 1.5rem !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    text-decoration: none;
  }
  .primary-nav__dropdown-item:hover,
  .primary-nav__dropdown-item:active {
    background: rgba(232, 101, 26, 0.15) !important;
    color: #fff !important;
  }
  /* "View all" link at top of each mobile submenu */
  .primary-nav__view-all {
    font-weight: 600 !important;
    color: #2DD4BF !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.02em;
  }

  /* Overlay de mobile menu — DEBAJO del menu */
  .nav-overlay {
    z-index: 100000 !important;  /* ARRIBA del contenido, DEBAJO de .primary-nav (100001) */
    position: fixed !important;
    inset: 0 !important;
  }
}

/* ── MOBILE (< 768px) ─────────────────────────────────────── */
@media (max-width: 767px) {
  .container {
    padding-inline: 1rem;
  }
  html {
    font-size: 15px;
  }

  /* HERO */
  .hero {
    min-height: 85dvh;
  }
  .hero__title {
    font-size: clamp(1.75rem, 7vw, 2.3rem);
    line-height: 1.2;
  }
  .hero__subtitle {
    font-size: 1rem;
  }
  .hero__label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }
  .hero__content {
    padding-inline: 1rem;
    text-align: center;
  }
  .hero__actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }
  .hero__actions .btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
  .hero__stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .hero__stat-number {
    font-size: 1.5rem;
  }
  .hero__stat-label {
    font-size: 0.75rem;
  }

  /* SEARCH BAR (cascade filter) */
  .search-bar {
    padding: 1.25rem 1rem;
    margin-top: -1.5rem;
    border-radius: 12px;
  }
  .search-bar__form {
    flex-direction: column;
    gap: 0.6rem;
  }
  .search-bar__field {
    width: 100%;
  }
  .search-bar__select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
  }
  .search-bar__btn {
    width: 100%;
    padding: 0.85rem;
  }

  /* GRIDS → 1 col */
  .tours-grid,
  .features-grid,
  .testimonials-grid,
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* CATEGORY CARDS — mantenemos 2 cols en mobile medio, 1 en small */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .category-card__title { font-size: 0.95rem; }
  .category-card__count { font-size: 0.75rem; }

  /* SECTIONS */
  .section {
    padding-block: 2.5rem;
  }
  .section__title {
    font-size: 1.55rem;
    line-height: 1.25;
  }
  .section__subtitle {
    font-size: 0.92rem;
  }
  .section__label {
    font-size: 0.72rem;
  }

  /* TOUR CARDS — img mobile más alta para que no se recorte feo */
  .tour-card__img-wrap {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    min-height: 240px;
  }
  .tour-card__img {
    object-position: center !important;
  }
  .tour-card__title {
    font-size: 1rem;
  }
  .tour-card__meta {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .tour-card__meta-item {
    font-size: 0.75rem;
  }

  /* ABOUT BRIEF */
  .about-brief {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .about-brief__image img {
    max-height: 300px;
    width: 100%;
    object-fit: cover;
  }

  /* GALLERY GRID (About page) */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .gallery-grid__item { aspect-ratio: 1; }

  /* FOOTER */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .footer-col {
    text-align: center;
  }
  .footer-social {
    justify-content: center;
  }
  .footer-links {
    padding-left: 0;
    list-style: none;
  }
  .footer-contact__item {
    justify-content: center;
    text-align: left;
  }
  .footer-bottom__inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  .footer-bottom__links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
  }

  /* FLOATING BUTTONS (cart + whatsapp) — el HTML real usa .cart-float y .whatsapp-float */
  .cart-float {
    width: 52px !important;
    height: 52px !important;
    bottom: 80px !important;
    right: 16px !important;
  }
  .cart-float svg {
    width: 22px !important;
    height: 22px !important;
  }
  .whatsapp-float {
    width: 52px !important;
    height: 52px !important;
    bottom: 16px !important;
    right: 16px !important;
  }
  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }

  /* BUTTONS compactos */
  .btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
  }

  /* TYPOGRAPHY smoothing */
  h1 { font-size: 1.75rem; line-height: 1.2; }
  h2 { font-size: 1.4rem; line-height: 1.25; }
  h3 { font-size: 1.15rem; }
}

/* ── MOBILE SMALL (< 480px) ────────────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding-inline: 0.875rem;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .hero__title {
    font-size: 1.6rem;
  }
  .section__title {
    font-size: 1.35rem;
  }
  .tour-card__title {
    font-size: 0.95rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ── WOOCOMMERCE SINGLE PRODUCT / TOUR ─────────────────────── */
@media (max-width: 1199px) {
  .wc-single__layout,
  .woocommerce div.product > .summary,
  .woocommerce div.product > .images {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  /* Product layout 1 col */
  .wc-single__layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Gallery mobile-sized */
  .woocommerce div.product div.images {
    width: 100% !important;
    float: none !important;
  }
  .woocommerce div.product div.summary {
    width: 100% !important;
    float: none !important;
    margin-top: 1rem;
  }

  /* Dual price group */
  .ct-price-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  .ct-price-card {
    width: 100%;
  }

  /* Tabs scroll horizontal sin desbordar */
  .woocommerce div.product .woocommerce-tabs ul.tabs,
  .wc-tabs,
  .wc-tabs__nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar,
  .wc-tabs::-webkit-scrollbar { display: none; }

  .woocommerce div.product .woocommerce-tabs ul.tabs li,
  .wc-tabs li {
    float: none;
    display: inline-block;
  }

  /* Itinerary days */
  .itinerary__day-header {
    font-size: 0.95rem;
    padding: 0.6rem 0.85rem;
    flex-wrap: wrap;
  }
  .itinerary__day-num {
    font-size: 0.7rem;
    padding: 0.18rem 0.5rem;
  }

  /* Includes/Excludes → 1 col */
  .ct-checklist-grid {
    grid-template-columns: 1fr;
  }

  /* Quick data bar (duration, altitude, difficulty) */
  .ct-quick-data {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .ct-quick-data__item {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 110px;
  }

  /* Inquiry form */
  .ct-inquiry__grid {
    grid-template-columns: 1fr;
  }
}

/* ── ARCHIVE PRODUCT (store + tours listing) ───────────────── */
@media (max-width: 1024px) {
  .woocommerce ul.products,
  .archive-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
  }
  .woocommerce ul.products li.product {
    width: 100% !important;
    margin-right: 0 !important;
    float: none !important;
  }
}

@media (max-width: 640px) {
  .woocommerce ul.products,
  .archive-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── CART + CHECKOUT ───────────────────────────────────────── */
@media (max-width: 767px) {
  .woocommerce-cart-form table {
    font-size: 0.85rem;
  }
  .woocommerce-cart-form table .product-thumbnail {
    display: none;
  }
  .woocommerce-cart-form table thead {
    display: none;
  }
  .woocommerce-cart-form table tr {
    display: block;
    border-bottom: 1px solid #ddd;
    padding-block: 0.5rem;
  }
  .woocommerce-cart-form table td {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    text-align: right;
    border: 0;
  }
  .woocommerce-cart-form table td::before {
    content: attr(data-title) ": ";
    font-weight: 600;
    text-align: left;
  }

  .cart-collaterals,
  .cart_totals {
    width: 100% !important;
    float: none !important;
  }
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review {
    width: 100% !important;
    float: none !important;
  }
  .woocommerce .col2-set .col-1,
  .woocommerce .col2-set .col-2 {
    width: 100% !important;
    float: none !important;
  }
}

/* ── ABOUT / CONTACT ───────────────────────────────────────── */
@media (max-width: 767px) {
  .about-story__layout,
  .contact-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  .contact-map iframe {
    height: 280px;
    width: 100%;
  }
}

/* ── POLICIES PAGES ────────────────────────────────────────── */
@media (max-width: 767px) {
  .policy-content__wrap,
  .policy-nav {
    max-width: 100%;
    padding-inline: 1rem;
  }
  .policy-cancellation-table {
    font-size: 0.82rem;
  }
  .policy-cancellation-table th,
  .policy-cancellation-table td {
    padding: 0.5rem 0.4rem;
  }
}

/* ── PRINT ─────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .cart-float,
  .whatsapp-float,
  .nav-toggle,
  .scroll-top,
  .policy-nav {
    display: none !important;
  }
  .policy-content__wrap {
    max-width: 100%;
    padding: 0;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* ── FOOTER mobile/tablet: centrar logo + textos v2.7.1 ────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    text-align: center;
  }
  .footer-about__logo,
  .footer-about__logo img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .footer-about__text {
    text-align: center !important;
  }
  .footer-social {
    justify-content: center !important;
  }
  .footer-col {
    text-align: center !important;
    align-items: center !important;
  }
  .footer-links,
  .footer-col ul {
    list-style: none !important;
    padding-left: 0 !important;
    text-align: center !important;
  }
  .footer-col__title {
    text-align: center !important;
  }
  .footer-col__title::after {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .footer-contact__item {
    justify-content: center !important;
    text-align: left;
  }
}
