/* ==========================================================================
   SHARON PINEDA — PORTFOLIO DESIGN SYSTEM
   Refined Zero-Scroll 4-Column Layout with Proportional Gutters
   ========================================================================== */

/* --- 1. CSS VARIABLES (TOKENS) --- */
:root {
  /* Colors */
  --bg-linen: #F9F7F2;
  --color-charcoal: #1C1C1C;
  --color-charcoal-muted: rgba(28, 28, 28, 0.65);
  --color-taupe: #D3CBBF;
  --color-taupe-light: #E8E3DA;
  --color-white: #FFFFFF;
  
  /* Overlays */
  --overlay-dark: rgba(28, 28, 28, 0.4);
  --overlay-dark-hover: rgba(28, 28, 28, 0.2);

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;

  /* Transitions */
  --ease-editorial: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.3s var(--ease-editorial);
  --transition-medium: 0.6s var(--ease-editorial);
  --transition-slow: 1.2s var(--ease-editorial); /* Fluid 1.2s transition */

  /* Layout Customization */
  --gutter-width: 40px; /* Governs all 5 gaps/margins in home and active views. Completely adjustable! */
  --panel-width: calc((100vw - 5 * var(--gutter-width)) / 4);
  --active-block-width: calc(3 * var(--panel-width) + 2 * var(--gutter-width));
}

/* --- 2. GLOBAL RESET & ZERO-SCROLL SETUP --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden; /* Zero vertical scrolling */
  background-color: var(--bg-linen);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- 3. FLOATING BRAND LOGO --- */
.site-header {
  position: fixed;
  top: 75px; /* Deeper placement in empty space above the quadrants */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 100;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--color-charcoal);
  pointer-events: auto;
  width: max-content;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.95rem; /* Increased 30% from 1.5rem */
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.1;
  display: block;
}

.brand-subtitle {
  font-family: var(--font-sans);
  font-size: 0.65rem; /* Increased font-size for larger letter presence */
  font-weight: 400;
  letter-spacing: 0.44em; /* Balanced elegant letter-spacing to match the exact span of SHARON PINEDA naturally */
  text-transform: uppercase;
  color: var(--color-charcoal-muted);
  margin-top: 8px;
  display: block;
  width: 100%;
  text-align: justify;
  text-align-last: justify; /* Guarantees mathematically perfect alignment on left and right edges */
}

/* --- 4. NAVIGATION BUTTON (VOLVER) --- */
.volver-btn {
  position: absolute;
  top: 75px; /* Aligned horizontally with the logo top boundary */
  right: var(--gutter-width);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--color-charcoal);
  border-bottom: 1px solid var(--color-charcoal);
  padding-bottom: 2px;
  z-index: 110;
  transition: all var(--transition-fast);
  text-transform: uppercase;
}

.volver-btn:hover {
  color: var(--color-charcoal-muted);
  border-color: var(--color-charcoal-muted);
  transform: translateY(-1px);
}

.projects-volver {
  position: fixed;
  display: none;
}

.state-proyectos .projects-volver {
  display: block;
}

/* --- 5. 4-COLUMN CANVAS SYSTEM WITH PROPORTIONAL GUTTERS --- */
.grid-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 160px var(--gutter-width) var(--gutter-width) var(--gutter-width);
  gap: var(--gutter-width);
  background-color: var(--bg-linen);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  transition: gap var(--transition-slow), padding var(--transition-slow);
}

.panel-card {
  position: relative;
  flex: 0 0 var(--panel-width);
  width: var(--panel-width);
  height: calc(100vh - 240px); /* Margins at top/bottom */
  max-height: 72vh;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-charcoal);
  transition: flex var(--transition-slow), width var(--transition-slow), opacity var(--transition-medium), margin var(--transition-slow), padding var(--transition-slow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 24px;
}

.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 1.2s var(--ease-editorial);
  transform: scale(1.02);
  z-index: 1;
}

.card-bg-project {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity var(--transition-slow), transform 1.2s var(--ease-editorial), filter var(--transition-medium);
  transform: scale(1.02);
  z-index: 2;
}

.state-proyectos .card-bg-project {
  opacity: 1;
  filter: sepia(0.12) brightness(0.92) contrast(1.02); /* Elegant unified editorial cast on idle */
}

.state-proyectos .panel-card:hover .card-bg-project {
  filter: sepia(0) brightness(1) contrast(1); /* Reveal full rich original color and crisp natural light on hover */
}

.panel-card:hover .card-bg,
.panel-card:hover .card-bg-project {
  transform: scale(1.06);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(28, 28, 28, 0.1) 0%,
    rgba(28, 28, 28, 0.25) 50%,
    rgba(28, 28, 28, 0.7) 100%
  );
  z-index: 5;
  transition: background var(--transition-fast);
}

.panel-card:hover .card-overlay {
  background: linear-gradient(
    180deg,
    rgba(28, 28, 28, 0.05) 0%,
    rgba(28, 28, 28, 0.15) 50%,
    rgba(28, 28, 28, 0.55) 100%
  );
}

/* Card Titles */
.card-content {
  position: relative;
  z-index: 10;
  color: var(--color-white);
  transition: opacity var(--transition-medium);
}

.card-number {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--color-taupe);
  display: block;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  line-height: 1.1;
}

.card-action {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-taupe-light);
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.panel-card:hover .card-action {
  opacity: 1;
  transform: translateX(4px);
}

/* --- 6. STATE B: STUDIO ACTIVE --- */
.studio-portrait-container,
.servicios-portrait-container,
.contacto-portrait-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  z-index: 15;
  transition: opacity var(--transition-medium);
}

.studio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.img-meta-tag {
  position: absolute;
  bottom: 40px;
  left: 30px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--color-white);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.merged-content-block {
  position: absolute; /* Take out of flex flow when inactive to prevent empty gaps on home screen */
  flex: 0 0 0;
  width: 0;
  height: calc(100vh - 240px); /* Aligns with slender cards */
  max-height: 72vh;
  background-color: var(--bg-linen);
  border: 0 solid var(--color-taupe); /* No border when inactive */
  padding: 0;
  margin-left: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: flex var(--transition-slow), width var(--transition-slow), padding var(--transition-slow), opacity var(--transition-medium), margin var(--transition-slow), border var(--transition-slow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --- ACTIVE VIEWS GRID COMPACTING --- */
.state-studio .grid-canvas,
.state-servicios .grid-canvas,
.state-contacto .grid-canvas {
  gap: 0 !important;
}

/* Studio State Resizes */
.state-studio #panel-studio {
  pointer-events: none;
}
.state-studio #panel-studio .card-content {
  opacity: 0;
}
.state-studio #panel-studio .studio-portrait-container {
  opacity: 1;
  visibility: visible;
}
.state-studio #panel-servicios,
.state-studio #panel-proyectos,
.state-studio #panel-contacto {
  width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.state-studio #studio-block {
  position: relative !important;
  border: 1px solid var(--color-taupe);
  width: var(--active-block-width);
  flex: 0 0 var(--active-block-width);
  opacity: 1;
  visibility: visible;
  padding: 60px var(--gutter-width);
  margin-left: var(--gutter-width);
}
.state-studio #studio-block .volver-btn {
  right: var(--gutter-width);
}

/* Merged Blocks Layout Details */
.merged-content-inner {
  max-width: 900px;
  text-align: center;
  width: 100%;
  margin: 0 auto; /* Centered horizontally inside the panel recuadro */
}

.merged-header {
  margin-bottom: 25px;
  text-align: center;
}

.merged-title {
  font-family: var(--font-serif);
  font-size: 3.1rem; /* Increased 10% from 2.8rem */
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--color-charcoal);
}

.merged-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem; /* Increased 10% from 0.72rem */
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-charcoal-muted);
  margin-top: 5px;
}

.merged-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem; /* Increased 10% from 1.35rem */
  line-height: 1.5;
  color: var(--color-charcoal);
  margin-bottom: 30px;
  text-align: center;
}

.merged-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.body-p {
  font-family: var(--font-sans);
  font-size: 1rem; /* Increased 10% from 0.9rem */
  line-height: 1.8;
  color: #333333;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
}

/* --- 7. STATE C: PROYECTOS VIEW --- */
.state-proyectos #panel-studio .card-bg {
  background-image: url('Proyecto Ayala/sharon-pineda-interiorismo-ayala-salon.jpeg') !important;
}
.state-proyectos #panel-servicios .card-bg {
  background-image: url('Proyecto Francisca/sharon-pineda-interiorismo-francisca-salon.png') !important;
}
.state-proyectos #panel-proyectos .card-bg {
  background-image: url('Proyecto Mártires/sharon-pineda-interiorismo-martires-salon-mesa.jpg') !important;
}
.state-proyectos #panel-contacto .card-bg {
  background-image: url('Proyecto Paseo/sharon-pineda-interiorismo-paseo-salon-detalle.jpeg') !important;
}

/* Removed 'ÚLTIMOS PROYECTOS' indicator */

/* --- 8. STATE D: SERVICIOS ACTIVE --- */
.state-servicios #panel-servicios {
  pointer-events: none;
}
.state-servicios #panel-servicios .card-content {
  opacity: 0;
}
.state-servicios #panel-servicios .servicios-portrait-container {
  opacity: 1;
  visibility: visible;
}
.state-servicios #panel-studio,
.state-servicios #panel-proyectos,
.state-servicios #panel-contacto {
  width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.state-servicios #servicios-block {
  position: relative !important;
  border: 1px solid var(--color-taupe);
  width: var(--active-block-width);
  flex: 0 0 var(--active-block-width);
  opacity: 1;
  visibility: visible;
  padding: 60px var(--gutter-width);
  margin-left: var(--gutter-width);
}
.state-servicios #servicios-block .volver-btn {
  right: var(--gutter-width);
}

/* Services Detailed List Styling */
.services-list-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 10px;
}

.service-item {
  border-top: 1px solid var(--color-taupe);
  padding-top: 16px;
  text-align: center;
}

.service-item-header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.service-index {
  font-family: var(--font-serif);
  font-size: 1.05rem; /* Increased 10% from 0.95rem */
  color: var(--color-taupe);
  font-weight: 500;
}

.service-keyword {
  font-family: var(--font-serif);
  font-size: 1.38rem; /* Increased 10% from 1.25rem */
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--color-charcoal);
}

.service-description {
  font-family: var(--font-sans);
  font-size: 0.94rem; /* Increased 10% from 0.85rem */
  line-height: 1.7;
  color: #555555;
  font-weight: 300;
  text-align: center;
}

/* --- 9. STATE E: CONTACTO ACTIVE --- */
.state-contacto #panel-contacto {
  pointer-events: none;
}
.state-contacto #panel-contacto .card-content {
  opacity: 0;
}
.state-contacto #panel-contacto .contacto-portrait-container {
  opacity: 1;
  visibility: visible;
}
.state-contacto #panel-studio,
.state-contacto #panel-servicios,
.state-contacto #panel-proyectos {
  width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.state-contacto #contacto-block {
  position: relative !important;
  border: 1px solid var(--color-taupe);
  width: var(--active-block-width);
  flex: 0 0 var(--active-block-width);
  opacity: 1;
  visibility: visible;
  padding: 60px var(--gutter-width);
  margin-left: var(--gutter-width);
}
.state-contacto #contacto-block .volver-btn {
  right: var(--gutter-width);
}

.contacto-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 26px; /* 26px split gap to match standard layout spacing */
  align-items: center;
}

.contacto-title {
  font-family: var(--font-serif);
  font-size: 2.86rem; /* Increased 10% from 2.6rem */
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--color-charcoal);
  margin-bottom: 12px;
  text-align: center;
}

.contacto-intro {
  font-size: 0.97rem; /* Increased 10% from 0.88rem */
  color: var(--color-charcoal-muted);
  margin-bottom: 35px;
  text-align: center;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.info-label {
  font-size: 0.66rem; /* Increased 10% from 0.6rem */
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--color-charcoal-muted);
  margin-bottom: 4px;
}

.info-value {
  font-family: var(--font-serif);
  font-size: 1.2rem; /* Increased 10% from 1.1rem */
  color: var(--color-charcoal);
}

.info-value:hover {
  opacity: 0.7;
}

/* Contacto Inline Form */
.contacto-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--color-charcoal-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--color-taupe);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-charcoal);
  outline: none;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--color-charcoal);
  background: rgba(255,255,255,0.4);
}

.submit-btn {
  padding: 12px 24px;
  background-color: var(--color-charcoal);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  margin-top: 10px;
  transition: opacity var(--transition-fast);
}

.submit-btn:hover {
  opacity: 0.88;
}

.form-success-msg {
  font-size: 0.78rem;
  color: #2e7d32;
  margin-top: 8px;
  letter-spacing: 0.05em;
  display: none;
}

/* --- 10. MORPHING PROJECT GALLERY OVERLAY --- */
.gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  background-color: var(--bg-linen);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow); /* Smooth 0.8s cross-fade morph */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 160px 80px 80px 80px;
  box-sizing: border-box;
}

.gallery-overlay.active {
  opacity: 1;
  visibility: visible;
}

.gallery-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 220;
}

.gallery-header .project-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--color-charcoal);
}

.gallery-viewport {
  width: 100%;
  max-width: calc(100vw - 2 * var(--gutter-width));
  height: calc(100vh - 240px);
  max-height: 72vh;
  position: relative;
  overflow: hidden;
}

.gallery-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Completely preserves image ratios without cropping */
  object-position: center;
  opacity: 0;
  filter: drop-shadow(0 12px 36px rgba(28, 28, 28, 0.06)); /* Tangible shadow matching the photo's real boundaries */
  transition: opacity var(--transition-slow); /* 0.8s image cross-fade */
}

.gallery-img.active {
  opacity: 1;
}

/* Arrow Controllers */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-charcoal);
  color: var(--color-charcoal);
  background: transparent;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 210;
  transition: all var(--transition-fast);
}

.gallery-arrow:hover {
  background-color: var(--color-charcoal);
  color: var(--color-white);
}

.prev-arrow { left: 40px; }
.next-arrow { right: 40px; }

/* Dot Indicators */
.gallery-indicators {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 210;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(28,28,28,0.25);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.indicator-dot.active {
  background-color: var(--color-charcoal);
  transform: scale(1.3);
}

/* --- 11. MEDIA RESPONSIVE --- */
@media (max-width: 1024px) {
  :root {
    --gutter-width: 16px; /* Responsive reduced gaps & padding */
  }
  
  /* 1. Header & Global Layout */
  .site-header {
    top: 35px !important; /* Lowered as requested */
  }
  
  /* Make logo text larger, increase letter-spacing and center-align to prevent wide gaps between words on mobile */
  .brand-title {
    font-size: 1.55rem !important; /* Larger brand title */
    letter-spacing: 0.16em !important;
  }
  .brand-subtitle {
    font-size: 0.52rem !important; /* Increased font size as requested */
    letter-spacing: 0.22em !important; /* Increased letter-spacing as requested */
    text-align: center !important; /* Disables the desktop justify stretching which caused large gaps on mobile! */
    text-align-last: center !important;
    width: 100% !important;
    display: block !important;
    margin-top: 5px !important;
    word-spacing: normal !important; /* Clean natural spacing */
  }
  
  .grid-canvas {
    flex-direction: column !important;
    padding: 120px var(--gutter-width) var(--gutter-width) var(--gutter-width) !important; /* Increased top padding to 120px to clear the lower, larger logo */
    gap: 12px !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  
  /* Add an 85px padding zone at the bottom of active and projects views to keep the floating caramel button completely outside the cards/text blocks! */
  .state-studio .grid-canvas,
  .state-servicios .grid-canvas,
  .state-contacto .grid-canvas {
    padding-bottom: 85px !important;
    gap: 0 !important;
  }
  .state-proyectos .grid-canvas {
    padding-bottom: 85px !important;
    gap: 12px !important;
  }
  
  /* 2. Idle State Panels (Stacking as Horizontal Bands with titles on bottom-left) */
  .panel-card {
    width: 100% !important;
    height: auto !important;
    flex: 1 1 0 !important; /* Perfect equal-height horizontal bands inside viewport */
    max-height: none !important;
    min-height: 0 !important; /* Force flex child calculation */
    padding: 12px var(--gutter-width) !important; /* Elegant compact padding */
    justify-content: flex-end !important; /* Place titles at the very bottom of each photo card */
    align-items: flex-start !important; /* Align content to the left of the card */
    border: none !important;
  }
  
  .card-content {
    align-items: flex-start !important;
    text-align: left !important;
    gap: 0px !important; /* Minimal line spacing between lines */
  }
  
  .card-number {
    margin-bottom: 0px !important;
    font-size: 0.65rem !important;
    line-height: 1.1 !important;
  }
  
  .card-title {
    font-size: 1.35rem !important;
    margin-bottom: 0px !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
  }
  
  .card-action {
    font-size: 0.6rem !important;
    line-height: 1.1 !important;
    margin-top: 2px !important;
  }
  
  /* 3. Active States: Vertical Morphing Accordion */
  
  /* Collapse non-active panel heights on active views on mobile */
  .state-studio #panel-servicios,
  .state-studio #panel-proyectos,
  .state-studio #panel-contacto,
  .state-servicios #panel-studio,
  .state-servicios #panel-proyectos,
  .state-servicios #panel-contacto,
  .state-contacto #panel-studio,
  .state-contacto #panel-servicios,
  .state-contacto #panel-proyectos {
    height: 0 !important;
    width: 100% !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  /* Keep active banner visible at 26vh showing her beautiful photo */
  .state-studio #panel-studio,
  .state-servicios #panel-servicios,
  .state-contacto #panel-contacto {
    height: 26vh !important; /* Slightly larger height to show her portrait and texture details */
    flex: 0 0 26vh !important;
    width: 100% !important;
    pointer-events: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin: 0 !important;
    padding: 12px var(--gutter-width) !important;
  }
  
  /* Fine-tune crop of the active studio portrait to raise the photo and center her face beautifully */
  .state-studio .studio-img {
    object-position: center 30% !important; /* Raised portrait image slightly, centering her face vertically in the banner */
  }
  
  /* Hides her name tag text overlay completely on mobile active view */
  .img-meta-tag {
    display: none !important;
  }
  
  /* Expand text blocks vertically below the banner card */
  .state-studio #studio-block,
  .state-servicios #servicios-block,
  .state-contacto #contacto-block {
    width: 100% !important;
    flex: 1 1 0% !important; /* Force EXACT layout distribution */
    height: 0 !important;       /* Avoid browser stretching viewport */
    min-height: 0 !important;   /* Crucial CSS layout fix for iOS/Safari height stretch */
    margin-left: 0 !important;
    margin-top: 12px !important; /* Elegant margin between banner and text block */
    padding: 24px var(--gutter-width) !important;
    border: 1px solid var(--color-taupe) !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow-y: auto !important; /* Smooth internal text-scrolling if content overflows on short devices */
    -webkit-overflow-scrolling: touch;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Starts content at the top so overflow scrolling works beautifully */
  }
  
  /* Merged Card Details Styling */
  .merged-header {
    padding-right: 0 !important; /* Back button is floating and outside the container, no collision space needed */
    margin-bottom: 16px !important;
    text-align: left !important; /* Elegant left-align for header elements on mobile */
  }
  
  .merged-title {
    font-size: 1.5rem !important;
    text-align: left !important;
  }
  
  .merged-subtitle {
    font-size: 0.6rem !important;
    text-align: left !important;
    margin-top: 4px !important;
  }
  
  .merged-quote {
    font-size: 1.05rem !important;
    margin-bottom: 20px !important;
    line-height: 1.4 !important;
    text-align: left !important;
    border-left: 2px solid var(--color-taupe);
    padding-left: 12px;
  }
  
  .merged-body {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .body-p {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
    text-align: left !important; /* Professional editorial left-aligned text on mobile */
  }
  
  /* Hide the nested back buttons inside scrollable containers on mobile to prevent browser container overflow clipping */
  .merged-content-block .volver-btn {
    display: none !important;
  }
  
  /* UNIFIED FLOATING BACK BUTTON: Direct child of body (outside scroll boundaries), visible across ALL active mobile states */
  .state-studio .projects-volver,
  .state-servicios .projects-volver,
  .state-contacto .projects-volver,
  .state-proyectos .projects-volver {
    display: block !important;
    position: fixed !important;
    bottom: 20px !important; /* Floating perfectly inside the bottom neutral 80px padding */
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    z-index: 500 !important; /* Floats on top of absolutely everything */
    background-color: #9E7556 !important; /* Natural leather caramel color */
    color: var(--color-white) !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.15em !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
    border: 1px solid #9E7556 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  .volver-btn {
    top: 15px !important;
    right: var(--gutter-width) !important;
  }
  
  /* 4. Services List Responsiveness */
  .services-list-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    text-align: left !important;
  }
  
  .service-item {
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--color-taupe-light) !important;
  }
  
  .service-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }
  
  .service-item-header {
    margin-bottom: 4px !important;
    justify-content: flex-start !important;
  }
  
  .service-keyword {
    font-size: 0.85rem !important;
  }
  
  .service-description {
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    text-align: left !important;
  }
  
  /* 5. Contact Details Card Responsiveness */
  .contacto-card {
    padding: 16px !important;
    gap: 16px !important;
  }
  
  .contacto-split {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  /* Center contact page details as requested */
  .state-contacto .merged-header {
    text-align: center !important;
  }
  .state-contacto .merged-title {
    text-align: center !important;
  }
  .state-contacto .merged-subtitle {
    text-align: center !important;
    justify-content: center !important;
  }
  .state-contacto .body-p {
    text-align: center !important;
  }
  .info-list {
    text-align: center !important;
  }
  .info-block {
    margin-bottom: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
  .info-header {
    font-size: 0.65rem !important;
    margin-bottom: 4px !important;
    text-align: center !important;
    width: 100% !important;
  }
  .info-text, .info-link, .info-value {
    font-size: 0.9rem !important;
    text-align: center !important;
  }
  
  /* Stack contact fields vertically to avoid horizontal squishing */
  .form-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .contacto-form {
    gap: 12px !important;
  }
  
  /* Disables iOS Safari auto-zoom behavior on focus, keeping the viewport layout perfectly steady and proportioned */
  .field-input, .field-select, .field-textarea {
    font-size: 16px !important;
  }
  
  /* 6. Gallery responsiveness overrides to match mobile padding */
  .gallery-overlay {
    padding: 45px var(--gutter-width) var(--gutter-width) var(--gutter-width) !important; /* Raised as high as possible! */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background-color: var(--bg-linen) !important;
  }
  
  .gallery-header {
    position: relative !important;
    width: calc(100vw - 32px) !important; /* Match the exact width of the photo */
    height: auto !important;
    padding: 0 !important;
    margin-bottom: 10px !important; /* Space between title and photo */
    display: flex !important;
    justify-content: flex-start !important; /* Aligned left above the photo */
    align-items: flex-end !important;
    z-index: 220 !important;
    top: auto !important;
    left: auto !important;
  }
  
  .gallery-header .project-title {
    font-size: 1.15rem !important; /* Elegant size */
    text-align: left !important;
    letter-spacing: 0.15em !important;
    margin: 0 !important;
  }
  
  .gallery-overlay .volver-btn {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    z-index: 500 !important;
    background-color: #9E7556 !important;
    color: var(--color-white) !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.15em !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
    border: 1px solid #9E7556 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  .gallery-viewport {
    width: calc(100vw - 32px) !important; /* Clean symmetrical gaps */
    height: 52vh !important; /* Perfectly proportioned vertical height to fit high on screen */
    max-height: 52vh !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }
  
  .gallery-arrow {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.1rem !important;
  }
  
  .prev-arrow {
    left: 12px !important;
  }
  
  .next-arrow {
    right: 12px !important;
  }
  
  /* Place indicators (dots) relatively right below the photo viewport, totally clear of the floating button! */
  .gallery-indicators {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-top: 15px !important; /* Sits 15px below the photo container */
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    z-index: 220 !important;
  }
}
