/* =============================================
   MAIN.CSS — Industria Textil Express
   Covers: shell (announcement, header, nav,
   footer, floating btn) + home page sections
   + scroll reveal animations
   ============================================= */

/* ─── GOOGLE FONTS ─────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── CSS VARIABLES ────────────────────────── */
:root {
  /* Colors */
  --cream:        #f5f3ee;
  --navy:         #0d1b2a;
  --navy-hover:   #162437;
  --text-dark:    #1a1a1a;
  --text-muted:   #555555;
  --text-light:   rgba(255, 255, 255, 0.85);
  --white:        #ffffff;
  --border:       rgba(255, 255, 255, 0.12);
  --border-dark:  rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --section-pad:  80px;
  --content-max:  1200px;
  --content-pad:  40px;

  /* Transitions */
  --transition:   0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  background-color: var(--cream);
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

/* ─── UTILITY ────────────────────────────────── */
.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

/* ─── PAGE LOADING STATE ─────────────────────── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.page-loading::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-dark);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── 404 / ERROR ────────────────────────────── */
.not-found {
  padding: var(--section-pad) var(--content-pad);
  text-align: center;
}

.not-found h1 {
  font-family: var(--font-heading);
  font-size: 80px;
  color: var(--navy);
}

.not-found a {
  color: var(--navy);
  text-decoration: underline;
}


/* =============================================
   ANNOUNCEMENT BAR
   ============================================= */
#announcement-bar {
  background-color: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  min-height: 40px;
}

#ann-text {
  text-align: center;
  flex: 1;
  max-width: 600px;
}

.ann-arrow {
  color: var(--white);
  font-size: 20px;
  padding: 0 8px;
  opacity: 0.7;
  transition: opacity var(--transition);
  line-height: 1;
}

.ann-arrow:hover {
  opacity: 1;
}


/* =============================================
   HEADER
   ============================================= */
#site-header {
  background-color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px var(--content-pad);
}

.header-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
}


/* =============================================
   NAVBAR
   ============================================= */
#site-nav {
  background-color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 0 var(--content-pad) 30px;
  border-bottom: 1px solid var(--border-dark);
}

.nav-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.01em;
  padding-bottom: 4px;
  position: relative;
  transition: color var(--transition);
}

/* underline on active and hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--text-dark);
  transition: width var(--transition);
}

.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  font-weight: 500;
}


/* =============================================
   HOME — SECTION 1: HERO GRID
   ============================================= */
.hero-grid {
  display: grid;
  background-color: #999999;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 5px;
  height: 500px;
  width: 100%;
}

.hero-grid-item {
  overflow: hidden;
}

.hero-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-grid-item:hover img {
  transform: scale(1.04);
}


/* =============================================
   HOME — SECTION 2: INTRO "Desde Perú..."
   ============================================= */
.intro-section {
  background-color: var(--cream);
  text-align: center;
  padding: 80px var(--content-pad);
}

.intro-heading {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.2;
}

.intro-subtext {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.8;
}


/* =============================================
   HOME — SECTION 3: VALUE CARDS
   ============================================= */
.values-section {
  background-color: var(--navy);
  padding: var(--section-pad) var(--content-pad);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: var(--content-max);
  margin: 0 auto;
}

.value-card {
  padding: 40px 40px;
  border-right: 1px solid var(--border);
  color: var(--text-light);
}

.value-card:last-child {
  border-right: none;
}

.value-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.value-card p {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
}

.value-card strong {
  color: var(--white);
  font-weight: 500;
}


/* =============================================
   HOME — SECTION 4: ZIGZAG SERVICES
   ============================================= */
.services-section {
  background-color: var(--cream);
}

.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

/* Image always fills its cell */
.service-image {
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.service-image:hover img {
  transform: scale(1.03);
}

/* Text content */
.service-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
}

.service-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.service-heading {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.2;
}

.service-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 460px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 13px 28px;
  background-color: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: background-color var(--transition);
  align-self: flex-start;
}

.btn-primary:hover {
  background-color: var(--navy-hover);
}

.btn-dark {
  display: inline-block;
  padding: 13px 28px;
  background-color: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: background-color var(--transition);
}

.btn-dark:hover {
  background-color: var(--navy-hover);
}


/* =============================================
   HOME — SECTION 5: PROCESS ACCORDION
   ============================================= */
.process-section {
  background-color: var(--navy);
  padding: var(--section-pad) var(--content-pad);
}

.process-heading {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  color: var(--white);
  text-align: center;
  margin-bottom: 48px;
}

.process-accordion {
  max-width: 860px;
  margin: 0 auto;
}

.accordion-item {
  border-top: 1px solid var(--border);
}

.accordion-item:last-child {
  border-bottom: 1px solid var(--border);
}

/* Hide the default browser triangle */
.accordion-item summary {
  list-style: none;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: opacity var(--transition);
}

.accordion-header:hover {
  opacity: 0.8;
}

.accordion-header span:first-of-type {
  flex: 1;
}

.accordion-icon {
  flex-shrink: 0;
  opacity: 0.85;
  /* SVG icons here are white — make sure your icon files are white */
  filter: brightness(0) invert(1);
}

/* Chevron — pure CSS arrow */
.accordion-chevron {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: rotate(-135deg);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-right: 4px;
}

details[open] .accordion-chevron {
  transform: rotate(45deg);
}

.accordion-body {
  padding: 0 0 24px 34px;
}

.accordion-body p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.85;
}


/* =============================================
   HOME — SECTION 6: PORTFOLIO SLIDER
   ============================================= */
.portfolio-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slide {
  display: none;
  position: relative;
  width: 100%;
  height: 560px;
}

.slide.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slide-card {
  position: relative;
  z-index: 1;
  background-color: var(--cream);
  padding: 52px 64px;
  text-align: center;
  max-width: 460px;
  width: 90%;
}

.slide-card-heading {
  font-family: var(--font-heading);
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 16px;
}

.slide-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 28px;
}

.slide-card strong {
  color: var(--text-dark);
  font-weight: 500;
}

/* Slider controls */
.slider-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
  background-color: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  padding: 8px 20px;
  border-radius: 40px;
}

.slider-prev,
.slider-next,
.slider-pause {
  color: var(--white);
  font-size: 20px;
  padding: 0 4px;
  opacity: 0.85;
  transition: opacity var(--transition);
  line-height: 1;
}

.slider-prev:hover,
.slider-next:hover,
.slider-pause:hover {
  opacity: 1;
}

.slider-counter {
  color: var(--white);
  font-size: 13px;
  font-weight: 400;
  min-width: 32px;
  text-align: center;
}


/* =============================================
   HOME — SECTION 7: ACTUALIDAD (NEWS)
   ============================================= */
.news-section {
  background-color: var(--cream);
  padding: var(--section-pad) var(--content-pad);
}

.news-heading {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 40px;
  text-align: center;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.news-card {
  background-color: var(--cream);
}

.news-card-link {
  display: block;
}

.news-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 20px;
  transition: opacity var(--transition);
}

.news-card:hover .news-image {
  opacity: 0.88;
}

.news-content {
  padding: 0 4px;
}

.news-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.3;
}

.news-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}


/* =============================================
   FOOTER
   ============================================= */
#site-footer {
  background-color: var(--navy);
  color: var(--text-light);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1fr;
  gap: 60px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px var(--content-pad) 48px;
}

.footer-logo {
  height: 70px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
  /* if logo is dark, invert it for the navy footer */
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-tagline {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.65);
  margin-bottom: 24px;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  opacity: 0.7;
  transition: opacity var(--transition);
}

.footer-socials a:hover {
  opacity: 1;
}

.footer-socials img {
  filter: brightness(0) invert(1);
}

.footer-heading {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

/* Contact list */
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

.footer-contact-list img {
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  margin-top: 2px;
}

.footer-hours {
  flex-direction: column !important;
  gap: 4px !important;
}

.footer-hours strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}

.footer-hours span {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  padding-left: 26px;
}

/* Quick links */
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav a {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.footer-nav a:hover {
  color: var(--white);
  text-decoration-color: rgba(255,255,255,0.4);
}

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px var(--content-pad);
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-bottom p {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}


/* =============================================
   FLOATING CONTACT BUTTON
   ============================================= */
.floating-contact {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.floating-label {
  background-color: var(--white);
  color: var(--navy);
  font-size: 13px;
  font-weight: 400;
  padding: 12px 18px 12px 20px;
  white-space: nowrap;
}

.floating-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  padding: 12px 14px;
  transition: background-color var(--transition);
}

.floating-btn:hover {
  background-color: var(--navy-hover);
}

.floating-btn img {
  filter: brightness(0) invert(1);
}


/* =============================================
   SCROLL REVEAL ANIMATIONS
   Add class="reveal" (or variant) to any element
   in a page fragment. pages.js observes them.
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-36px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(36px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delays for grouped elements like cards */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }


/* =============================================
   RESPONSIVE — shell + home page
   ============================================= */

/* ── Tablet / small laptop ──────────────────── */
@media (max-width: 980px) {
  .values-grid { grid-template-columns: repeat(3, 1fr); }
  .service-content { padding: 48px 40px; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --section-pad: 52px;
    --content-pad: 20px;
  }

  /* Header */
  #site-header {
    padding: 16px 56px;
    border-bottom: 1px solid var(--border-dark);
  }
  .header-logo { height: 58px; }

  /* Show the hamburger */
  .nav-toggle { display: flex; }

  /* Navbar becomes a collapsible dropdown panel */
  #site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: none;
    transition: max-height 0.32s ease;
  }

  body.nav-open #site-nav {
    max-height: 60vh;
    border-bottom: 1px solid var(--border-dark);
  }

  #site-nav .nav-link {
    width: 100%;
    padding: 16px var(--content-pad);
    font-size: 15px;
    text-align: center;
    border-top: 1px solid var(--border-dark);
  }

  /* Drop the sliding-underline effect on mobile */
  .nav-link::after { display: none; }
  .nav-link.active { color: var(--navy); }

  /* Hero: 4-up strip becomes a 2×2 grid */
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    column-gap: 4px;
    row-gap: 4px;
  }
  .hero-grid-item { aspect-ratio: 3 / 4; }
  .hero-grid-item img { height: 100%; }

  /* Value cards stack */
  .values-grid { grid-template-columns: 1fr; }
  .value-card {
    padding: 28px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .value-card:last-child { border-bottom: none; }

  /* Services: image always on top, content below */
  .service-row {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .service-row .service-image { order: -1; height: 260px; }
  .service-content { padding: 32px var(--content-pad); }
  .service-content p { max-width: none; }

  /* Process accordion */
  .process-section { padding-left: var(--content-pad); padding-right: var(--content-pad); }

  /* Slider */
  .slide { height: 440px; }
  .slide-card { padding: 32px 24px; width: 86%; }

  /* News stacks to one column */
  .news-grid { grid-template-columns: 1fr; }

  /* Footer stacks */
  .footer-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px var(--content-pad) 32px;
  }
  .footer-tagline { max-width: none; }
  .footer-bottom { padding-left: var(--content-pad); padding-right: var(--content-pad); text-align: center; }

  /* Floating button: icon only, smaller */
  .floating-contact { bottom: 18px; right: 18px; }
  .floating-label { display: none; }

  /* Announcement bar text doesn't crowd the arrows */
  #ann-text { font-size: 12px; padding: 0 8px; }
}

/* ── Small phones ───────────────────────────── */
@media (max-width: 420px) {
  .slide { height: 400px; }
  .service-row .service-image { height: 220px; }
}