/* === DESIGN TOKENS === */
:root {
  /* Colors */
  --color-bg: #FAFAFA;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-muted: #3D3D3D;
  --color-primary: #8E4713;
  --color-primary-hover: #753A0F;
  --color-cta: #A65316;
  --color-nav: #1E293B;
  --color-nav-text: #F1F5F9;
  --color-border: #D1D5DB;
  --color-whatsapp: #25D366;
  --color-whatsapp-hover: #1DA851;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading: 1.6;
  --leading-tight: 1.2;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --max-width: 1200px;
  --radius: 0.5rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Inter 4.1 — all normal weights kept locally; only used weights are fetched */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('/fonts/Inter-Thin.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('/fonts/Inter-ExtraLight.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/Inter-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/Inter-ExtraBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/Inter-Black.woff2') format('woff2');
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === BASE === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: var(--leading-tight);
  color: var(--color-primary);
  font-weight: 700;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--text-xl); }

p { margin-bottom: var(--space-md); }

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section:nth-child(even) {
  background: var(--color-surface);
}

/* === NAV === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.22);
}

.nav-top {
  background: var(--color-nav);
  color: #F8FAFC;
}

.nav-top-inner {
  display: grid;
  grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-lg);
  min-height: 4.25rem;
}

a.nav-brand {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: var(--text-xl);
  color: #F8FAFC;
  letter-spacing: -0.5px;
  text-decoration: none;
}

a.nav-brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand-pc {
  color: #F0A16C;
}

.brand-alhaurin {
  color: #F8FAFC;
}

.brand-tld {
  color: #CBD5E1;
  font-weight: 400;
}

.nav-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-lg);
  flex: 1 1 auto;
  min-width: 0;
}

.lang-switch,
.nav-phone {
  flex: 0 0 auto;
}

.nav-menu {
  background: #172235;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
  border-bottom: 1px solid rgba(248, 250, 252, 0.14);
  color: #F8FAFC;
}

.nav-menu .container {
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  min-height: 3rem;
}

.nav-links a {
  color: #F8FAFC;
  border-bottom: 2px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-sm) 0;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  border-bottom-color: #F0A16C;
  color: #FFFFFF;
  text-decoration: none;
}

.nav-phone {
  align-items: center;
  background: var(--color-whatsapp);
  border-radius: 999px;
  color: #FFFFFF;
  display: inline-flex;
  font-size: var(--text-sm);
  font-weight: 700;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  white-space: nowrap;
}

.nav-phone:hover {
  background: var(--color-whatsapp-hover);
  color: #FFFFFF;
  text-decoration: none;
}

.lang-switch {
  font-size: var(--text-sm);
}

.lang-switch a {
  align-items: center;
  color: #F8FAFC;
  display: inline-flex;
  font-weight: 600;
  gap: var(--space-xs);
  text-decoration: none;
  white-space: nowrap;
}

.lang-flag {
  display: inline-block;
  flex: 0 0 auto;
  height: 0.75rem;
  width: 1.125rem;
  border-radius: 0.125rem;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.25);
}

.lang-switch a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.section[id] {
  scroll-margin-top: 7.5rem;
}

@media (max-width: 860px) {
  .nav-menu .container {
    justify-content: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .section[id] {
    scroll-margin-top: 7rem;
  }
}

@media (max-width: 480px) {
  .nav-top-inner {
    gap: var(--space-sm);
    min-height: 3.75rem;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .nav-utility {
    gap: var(--space-sm);
  }

  .nav-phone {
    padding: var(--space-sm);
  }

  .nav-phone-label {
    display: none;
  }

  a.nav-brand {
    font-size: var(--text-lg);
  }

  .nav-links {
    gap: var(--space-lg);
  }
}

/* === HERO === */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--color-cta);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  text-decoration: none;
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: white;
}

.btn-whatsapp:hover {
  background: var(--color-whatsapp-hover);
  text-decoration: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* === INFORMATION PAGES === */
.info-page {
  background: var(--color-bg);
}

.info-page-container {
  max-width: 1200px;
}

.info-page h1 {
  max-width: 900px;
  margin: 0 auto var(--space-lg);
  text-align: center;
}

.info-intro {
  max-width: 700px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  text-align: center;
}

.info-page-section {
  max-width: 820px;
  margin: var(--space-3xl) auto 0;
}

.info-page-section:has(.services-grid) {
  max-width: none;
}

.info-page-section h2 {
  margin-bottom: var(--space-md);
}

.info-page-section p {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.info-page .services-grid {
  margin-top: var(--space-lg);
}

.info-list {
  max-width: 700px;
  margin: var(--space-md) auto 0;
  padding-left: var(--space-xl);
  color: var(--color-text-muted);
}

.info-list li + li {
  margin-top: var(--space-sm);
}

.info-contact {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.info-contact a:not(.btn) {
  font-weight: 600;
}

.info-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-3xl);
}

/* === SERVICES === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

@media (min-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.service-card h3 {
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.service-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
  flex: 1;
}

.service-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--text-lg);
  text-align: center;
  margin-top: auto;
  padding-top: var(--space-md);
}

/* === ZONES === */
.zones-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.zones-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
}

.zones-text {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-top: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === ABOUT === */
.about p {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* === CONTACT === */
.contact {
  text-align: center;
}

.contact-phone {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.contact-hours {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-md);
}

/* === SKIP LINK (a11y) === */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--color-nav);
  color: var(--color-nav-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  z-index: 999;
  font-size: var(--text-sm);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* === FOOTER (natural-flow page shell) === */
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.footer-sticky {
  position: static;
  background: var(--color-nav);
  color: var(--color-border);
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
  line-height: 1.35;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-lg);
  min-height: 2.75rem;
}

.footer-legal,
.footer-brand {
  color: var(--color-border);
  text-decoration: none;
}

.footer-legal {
  justify-self: start;
}

.footer-copy {
  color: var(--color-border);
  justify-self: center;
  text-align: center;
}

.footer-brand {
  justify-self: end;
  text-align: right;
}

.footer-legal:hover,
.footer-brand:hover {
  text-decoration: underline;
}

/* Expand the main content on short pages without taking the footer out of flow. */
main {
  flex: 1 0 auto;
}

@media (max-width: 720px), (max-height: 650px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    text-align: center;
  }

  .footer-legal,
  .footer-copy,
  .footer-brand {
    justify-self: center;
    text-align: center;
  }
}

/* === LEGAL PAGE === */
.legal-content {
  max-width: 700px;
  margin: 0 auto;
}

.legal-content h2 {
  color: var(--color-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.legal-content h3 {
  color: var(--color-text);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal-content ul, .legal-content li {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

.legal-content em {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* === FAQ === */
.faq-section {
  background: var(--color-bg);
}

.faq-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item[open] {
  box-shadow: 0 2px 8px rgba(184, 92, 26, 0.08);
}

.faq-question {
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: '−';
  transform: rotate(0deg);
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-answer {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading);
}

.faq-answer p {
  margin-bottom: 0;
}

/* === WHATSAPP FLOATING BUTTON === */
.wa-float {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--color-whatsapp);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
  z-index: 200;
}

.wa-float:hover {
  transform: scale(1.1);
  text-decoration: none;
}

.wa-float svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* === EFFECTS === */

/* Shimmer on hero title — subtle copper metallic sweep */
.shimmer {
  background: linear-gradient(
    110deg,
    var(--color-primary) 0%,
    var(--color-primary) 40%,
    #D4844A 50%,
    var(--color-primary) 60%,
    var(--color-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: -100% 0; }
}

/* Service cards — lift on hover */
.service-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(184, 92, 26, 0.1);
}

/* Fade-in on scroll (applied via IntersectionObserver) */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Photos — subtle border glow on hover */
.photo-main,
.photo-secondary {
  border-radius: var(--radius);
  margin: var(--space-xl) auto;
  display: block;
  max-width: 600px;
  transition: box-shadow 0.3s ease;
}

.photo-main:hover,
.photo-secondary:hover {
  box-shadow: 0 0 20px rgba(184, 92, 26, 0.15);
}

/* === GALLERY (horizontal scroll, CSS-only) === */
.gallery-section {
  padding: var(--space-2xl) 0;
  overflow: hidden;
}

.gallery {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-border);
}

.gallery::-webkit-scrollbar {
  height: 6px;
}

.gallery::-webkit-scrollbar-track {
  background: var(--color-border);
  border-radius: 3px;
}

.gallery::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

.gallery-track {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) 0 var(--space-md);
}

.gallery-track img {
  scroll-snap-align: center;
  border-radius: var(--radius);
  height: 280px;
  width: auto;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-track img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(184, 92, 26, 0.15);
}

/* Section title — thin copper underline that grows on scroll */
.section-title {
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-cta);
  margin: var(--space-sm) auto 0;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.section-title:hover::after {
  width: 120px;
}

/* Services note */
.services-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-xl);
  font-style: italic;
}

/* Contact location */
.contact-location {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
}

.contact-phone-info {
  margin-top: var(--space-lg);
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.contact-phone-info strong {
  color: var(--color-text);
}

/* Photo section */
.photo-section {
  padding: var(--space-xl) 0;
}

/* Pulse on WhatsApp float */
.wa-float {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
  50% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
}

/* === RESPONSIVE === */

/* Tablet (max 768px) */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo-main,
  .photo-secondary {
    max-width: 100%;
  }
}

/* Mobile (max 640px) */
@media (max-width: 640px) {
  :root {
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --space-3xl: 2.5rem;
  }

  /* Nav: stack brand left, lang+phone condensed */
  .nav .container {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .nav-brand {
    font-size: var(--text-base);
  }

  .nav-phone {
    display: none; /* Phone prominent in hero + footer instead */
  }

  /* Hero: full width buttons stacked */
  .hero {
    padding: var(--space-2xl) 0;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-lg);
  }

  /* Services: single column */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Zones: allow wrapping, smaller chips */
  .zones-list {
    justify-content: center;
  }

  .zones-list li {
    font-size: var(--text-xs);
  }

  /* Contact phone: tap-friendly size */
  .contact-phone {
    font-size: var(--text-2xl);
  }

  .contact-phone a {
    display: block;
    padding: var(--space-md);
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    text-align: center;
  }

  /* Footer: stack vertically on tiny screens */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }

  /* WhatsApp float: move up so it doesn't overlap footer */
  .wa-float {
    bottom: calc(var(--space-xl) + 50px);
  }

  /* Sections: less padding */
  .section {
    padding: var(--space-2xl) 0;
  }
}

/* Tiny screens (max 380px) — small phones */
@media (max-width: 380px) {
  :root {
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .service-card {
    padding: var(--space-md);
  }
}

/* Touch devices: disable hover effects that don't work */
@media (hover: none) {
  .service-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  .section-title::after {
    width: 60px;
  }

  .section-title:hover::after {
    width: 60px;
  }
}
