/* ==========================================================================
   VISAMAT — RESPONSIVE & MOBILE ADAPTATIONS
   ========================================================================== */

/* Mobile Sticky Conversion Bar */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background-color: rgba(23, 21, 18, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-inverse-subtle);
  z-index: 1500;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-sticky-bar__btn {
  width: 100%;
  padding: 0.85rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-xs);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 1001;
  padding: calc(var(--header-height) + 1rem) 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
  overflow-y: auto;
}

.mobile-nav-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.mobile-nav-link {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* --------------------------------------------------------------------------
   Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {

  /* Hero Tablet Adaptations */
  .hero-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-left-pane {
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3.5vw, 2.5rem);
  }

  .hero-right-pane {
    width: 100%;
    min-height: 520px;
    height: 520px;
    margin-left: 0;
    padding-left: 0;
  }

  .hero-overlap-wrap {
    left: 2rem;
    bottom: 2rem;
  }

  .hero-overlap-frame {
    width: 155px;
  }

  .hero-main-media-wrap::after {
    display: none;
  }
  .nav-desktop {
    display: none;
  }

  .burger-btn {
    display: flex;
  }

  .mega-menu {
    display: none !important;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .hero-media-wrap {
    aspect-ratio: 16 / 10;
  }

  .encaixar-container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .encaixar-editorial {
    max-width: 600px;
  }

  .encaixar-lead {
    max-width: 52ch;
  }

  .encaixar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
  }

  .encaixar-tile-1,
  .encaixar-tile-2,
  .encaixar-tile-3,
  .encaixar-tile-4,
  .encaixar-tile-5,
  .encaixar-tile-6 {
    margin-top: 0;
  }

  .encaixar-tile-2,
  .encaixar-tile-5 {
    margin-top: 2rem;
  }

  .services-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .service-showcase {
    min-height: 380px;
  }

  .service-item.is-active .service-item__title {
    font-size: clamp(1.25rem, 4vw, 1.55rem);
  }

  .criteri-head {
    align-items: flex-start;
  }

  .criteri-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .singulars-layout {
    grid-template-columns: 1fr;
  }

  .professionals-top {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .professionals-copy {
    max-width: 36rem;
  }

  .professionals-media {
    aspect-ratio: 16 / 10;
  }

  .professionals-capabilities {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .prof-capability {
    padding: 1.15rem 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .prof-capability:nth-child(odd) {
    padding-left: 0;
    border-right: 1px solid var(--border-subtle);
    padding-right: 1.25rem;
  }

  .prof-capability:nth-child(even) {
    padding-right: 0;
    padding-left: 1.25rem;
  }

  .prof-capability:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .team-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  /* Projects mosaic — structured 2-col with varied rhythm */
  .projects-mosaic {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(0.9rem, 1.5vw, 1.2rem);
  }

  .project-card--featured {
    grid-column: 1 / span 4;
  }

  .project-card--tall {
    grid-column: 5 / span 2;
  }

  .project-card--mid {
    grid-column: 1 / span 3;
  }

  .project-card--wide {
    grid-column: 4 / span 3;
  }

  .project-card--featured .project-media {
    aspect-ratio: 16 / 11;
  }

  .project-card--tall .project-media {
    aspect-ratio: 3 / 4;
  }

  .project-card--mid .project-media {
    aspect-ratio: 5 / 4;
  }

  .project-card--wide .project-media {
    aspect-ratio: 16 / 12;
  }

  .material-card--featured,
  .material-card--aside,
  .material-card:nth-child(n + 3) {
    grid-column: span 6;
  }

  .material-card--featured .material-card__media,
  .material-card--aside .material-card__media {
    aspect-ratio: 16 / 11;
  }

  .showroom-viewport {
    height: clamp(420px, 50vh, 560px);
  }
}

@media (max-width: 768px) {

  /* Hero Mobile Adaptations */
  .hero-section {
    padding-top: calc(var(--header-height) + 0.5rem);
  }

  .hero-left-pane {
    padding: 1.5rem 1.25rem 2rem;
  }

  .hero-headline {
    font-size: clamp(2rem, 7.5vw, 2.75rem);
    margin-bottom: 1rem;
  }

  .hero-subtext {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .hero-right-pane {
    width: 100%;
    min-height: 420px;
    height: 420px;
    margin-left: 0;
    padding-left: 0;
  }

  .hero-overlap-wrap {
    left: 1rem;
    bottom: 1rem;
  }


  .hero-overlap-frame {
    width: 120px;
    box-shadow: 0 12px 28px rgba(23, 21, 18, 0.16);
  }

  .hotspot-popover {
    width: clamp(230px, 72vw, 275px);
    z-index: 50;
  }

  .hotspot-popover.popover--left {
    right: 0;
    left: auto;
    top: auto;
    bottom: calc(100% + 12px);
    transform: translateY(-6px);
  }
  .hotspot.is-active .hotspot-popover.popover--left {
    transform: translateY(0);
  }

  .hotspot-popover.popover--right {
    left: 0;
    right: auto;
    top: calc(100% + 12px);
    bottom: auto;
    transform: translateY(6px);
  }
  .hotspot.is-active .hotspot-popover.popover--right {
    transform: translateY(0);
  }

  .hotspot-popover.popover--bottom {
    left: 50%;
    right: auto;
    top: calc(100% + 12px);
    bottom: auto;
    transform: translateX(-50%) translateY(6px);
  }
  .hotspot.is-active .hotspot-popover.popover--bottom {
    transform: translateX(-50%) translateY(0);
  }

  .hotspot-popover.popover--top {
    left: 50%;
    right: auto;
    bottom: calc(100% + 12px);
    top: auto;
    transform: translateX(-50%) translateY(-6px);
  }
  .hotspot.is-active .hotspot-popover.popover--top {
    transform: translateX(-50%) translateY(0);
  }

  .hotspot-popover__inner {
    padding: 1rem 1.15rem 0.95rem;
  }

  .hotspot-popover__title {
    font-size: 1.1rem;
  }

  .hotspot-popover__desc {
    font-size: 0.75rem;
    line-height: 1.42;
  }

  .hero-floating-caption {
    bottom: 1rem;
    right: 1rem;
    padding: 0.4rem 0.75rem;
  }

  .hero-floating-caption .caption-text {
    font-size: 0.62rem;
  }
  :root {
    --header-height: 70px;
  }

  body {
    padding-bottom: 68px; /* Space for mobile sticky CTA */
  }

  .mobile-sticky-bar {
    display: block;
  }

  .header-actions .btn-arch {
    display: none;
  }

  .hero-section {
    min-height: auto;
    padding-top: calc(var(--header-height) + 1.25rem);
  }

  /* Section 02: Encaixar Mobile Adaptation */
  .encaixar-section {
    padding: clamp(3rem, 6vw, 4.25rem) 0;
  }

  .encaixar-headline {
    font-size: clamp(2.35rem, 8.5vw, 3.2rem);
    margin-bottom: 1.1rem;
  }

  .encaixar-lead {
    font-size: 0.95rem;
    margin-bottom: 1.85rem;
  }

  .encaixar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.75rem, 2.5vw, 1.25rem);
  }

  .encaixar-tile-1,
  .encaixar-tile-3,
  .encaixar-tile-5 {
    margin-top: 0;
  }

  .encaixar-tile-2,
  .encaixar-tile-4,
  .encaixar-tile-6 {
    margin-top: 1.75rem;
  }

  .encaixar-note-wrap {
    margin-top: 1.5rem;
    justify-content: flex-end;
  }

  .encaixar-note {
    font-size: 1.7rem;
  }

  .projects-intro {
    margin-bottom: var(--space-md);
  }

  .projects-intro .section-title {
    max-width: none;
  }

  .projects-mosaic {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .project-card--featured,
  .project-card--tall,
  .project-card--mid,
  .project-card--wide {
    grid-column: 1 / -1;
  }

  .project-card--featured .project-media {
    aspect-ratio: 16 / 11;
  }

  .project-card--tall .project-media {
    aspect-ratio: 5 / 4;
  }

  .project-card--mid .project-media,
  .project-card--wide .project-media {
    aspect-ratio: 16 / 11;
  }

  .projects-cta {
    margin-top: var(--space-md);
  }

  .singulars-timeline {
    grid-template-columns: 1fr;
  }

  .process-steps-grid {
    grid-template-columns: 1fr;
  }

  .materials-grid {
    grid-template-columns: 1fr;
  }

  .material-card,
  .material-card--featured,
  .material-card--aside,
  .material-card:nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  .testimonial-quote-large {
    max-width: none;
  }

  .showroom-viewport {
    height: 380px;
  }

  .showroom-tab__verb {
    display: none;
  }

  .showroom-horizon {
    height: auto !important;
  }

  .showroom-horizon__sticky {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .showroom-horizon__rail {
    flex-direction: column;
  }

  .showroom-horizon__intro {
    flex: none;
    width: 100%;
    padding: var(--space-xl) var(--container-pad) var(--space-md);
    background: var(--bg-secondary);
  }

  .showroom-horizon__hint {
    display: none;
  }

  .showroom-horizon__track {
    flex-direction: column;
    padding: 0 var(--container-pad) var(--space-xl);
    gap: 1.25rem;
    transform: none !important;
  }

  .showroom-panel {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 340px;
    opacity: 1;
    transform: none;
  }

  .showroom-panel__media {
    position: relative;
    aspect-ratio: 4 / 3;
  }

  .showroom-panel__copy {
    position: relative;
    background: var(--bg-contrast);
  }

  .pairing-controls {
    grid-template-columns: 1fr;
  }

  .criteri-grid {
    grid-template-columns: 1fr;
  }

  .article-title--lead {
    font-size: clamp(1.45rem, 5.5vw, 1.85rem);
  }

  .section-bridge {
    justify-content: center;
    padding-right: var(--container-pad);
  }

  .professionals-capabilities {
    grid-template-columns: 1fr;
    margin-top: var(--space-lg);
  }

  .prof-capability,
  .prof-capability:nth-child(odd),
  .prof-capability:nth-child(even) {
    padding: 1.1rem 0;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .prof-capability:last-child {
    border-bottom: none;
  }

  .prof-note--prescripcio,
  .prof-note--coord {
    display: none;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .modal-backdrop {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-sheet {
    max-height: 94vh;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }
}
