:root {
  /* Colors from Config (fallbacks) */
  --color-primary: #1c1c1c;
  --color-secondary: #f5f5dc;
  --color-accent: #f4a261;
  --color-text: #333;
  --color-bg: #fff;
  --color-bg-alt: #fafafa;
  --color-border: #e0e0e0;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Fluid Spacing & Sizes */
  --space-sm: clamp(0.5rem, 1vw, 1rem);
  --space-md: clamp(1rem, 2vw, 2rem);
  --space-lg: clamp(2rem, 4vw, 4rem);
  --space-xl: clamp(4rem, 8vw, 8rem);
  
  --text-xs: clamp(0.75rem, 1vw, 0.875rem);
  --text-sm: clamp(0.875rem, 1.5vw, 1rem);
  --text-base: clamp(1rem, 2vw, 1.125rem);
  --text-lg: clamp(1.25rem, 3vw, 1.5rem);
  --text-xl: clamp(2rem, 5vw, 3rem);
  --text-xxl: clamp(3rem, 8vw, 5rem);
}

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

html {
  scroll-behavior: initial; /* Lenis handles this */
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* Custom cursor */
}

@media (max-width: 768px) {
  body {
    cursor: auto;
  }
}

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

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

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Custom Cursor */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
  mix-blend-mode: difference;
}

#custom-cursor.hovering {
  width: 40px;
  height: 40px;
  background-color: rgba(244, 162, 97, 0.2);
}

@media (max-width: 768px) {
  #custom-cursor { display: none; }
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-primary);
  color: var(--color-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  flex-direction: column;
}

.loader-content {
  text-align: center;
}

.progress-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  margin: 20px auto;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.1s linear;
}

/* Navbar */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  transition: transform 0.3s;
}

.logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-weight: 600;
  font-size: var(--text-sm);
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .nav-links { display: none; } /* Hamburger menu in a real app */
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: none; /* let custom cursor handle */
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
  font-size: var(--text-base);
}
@media (max-width: 768px) {
  .btn-primary, .btn-secondary, .btn-outline { cursor: pointer; }
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
  background-color: var(--color-accent);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.6rem 1.2rem;
  font-size: var(--text-sm);
}

.btn-full {
  width: 100%;
  gap: 10px;
  margin-top: var(--space-md);
}

/* Hero */
#hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  overflow: hidden;
  background-color: var(--color-secondary);
}

.hero-thread {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 600px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-xxl);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.hero-title span {
  font-style: italic;
  color: var(--color-accent);
}

.hero-subtitle {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
}

.hero-images {
  position: absolute;
  right: 10%;
  top: 20%;
  width: 40vw;
  height: 60vh;
  z-index: 5;
}

.floating-img {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.img-1 {
  width: 60%;
  top: 0;
  right: 0;
  z-index: 2;
}

.img-2 {
  width: 50%;
  bottom: 0;
  left: 0;
  z-index: 1;
}

@media (max-width: 768px) {
  #hero { flex-direction: column; justify-content: center; text-align: center; padding-top: 100px; }
  .hero-images { opacity: 0.2; width: 100%; right: 0; top: 0; height: 100%; }
  .hero-actions { justify-content: center; flex-direction: column; }
}

/* Sections */
.scene {
  padding: var(--space-xl) 0;
  position: relative;
}

.scene h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  text-align: center;
}

.scene > .container > p {
  text-align: center;
  font-size: var(--text-lg);
  margin-bottom: var(--space-lg);
}

/* Scrollytelling Taller */
#taller {
  background-color: var(--color-primary);
  color: var(--color-secondary);
  height: 300vh; /* Para dar espacio al scroll */
}

.taller-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-md);
}

.taller-text {
  flex: 1;
  padding: var(--space-lg);
}

.taller-text h2 {
  text-align: left;
  font-size: var(--text-xxl);
  margin-bottom: var(--space-sm);
}

.taller-visual {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fabric-stage {
  position: absolute;
  font-size: 10rem;
  opacity: 0;
  transform: scale(0.5) translateY(50px);
}

@media (max-width: 768px) {
  .taller-sticky-container { flex-direction: column; }
  .taller-text { text-align: center; }
  .taller-text h2 { text-align: center; font-size: var(--text-xl); }
  .fabric-stage { font-size: 6rem; }
}

/* Catálogo */
.filters {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  border-radius: 30px;
  cursor: none;
  font-weight: 600;
  transition: all 0.3s;
}

@media (max-width: 768px) { .filter-btn { cursor: pointer; } }

.filter-btn.active, .filter-btn:hover {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-color: var(--color-primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-alt);
  transition: transform 0.3s;
  cursor: none;
}
@media (max-width: 768px) { .product-card { cursor: pointer; } }

.product-card:hover {
  transform: translateY(-10px);
}

.product-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 125%; /* 4:5 aspect ratio */
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-promo {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-accent);
  color: #fff;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: bold;
  border-radius: 20px;
  z-index: 2;
}

.product-info {
  padding: var(--space-md);
  text-align: center;
}

.product-category {
  font-size: var(--text-xs);
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0.5rem 0;
}

.product-price {
  font-weight: bold;
  font-size: var(--text-base);
}

/* Modal Vista Rápida */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(5px);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--color-bg);
  width: 90%;
  max-width: 900px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  transform: translateY(50px);
  transition: transform 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  color: var(--color-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-img-container {
  width: 100%;
  height: 100%;
}

.modal-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-details {
  padding: var(--space-xl) var(--space-lg);
}

.selector-group {
  margin: var(--space-md) 0;
}

.selector-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.size-options, .color-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.size-btn, .color-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.2s;
}

.size-btn.selected, .color-btn.selected {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-color: var(--color-primary);
}

@media (max-width: 768px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-details { padding: var(--space-md); }
}

/* Floating WhatsApp Button */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: transform 0.3s;
}

.fab:hover {
  transform: scale(1.1);
}

/* Sound toggle */
#sound-toggle {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  z-index: 1000;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Probador / Scratch / Tape (Juegos) */
.probador-game, .scratch-cards-container, .tape-measure-game {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.color-palette {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.color-swatch {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: grab;
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.shirt-silhouette {
  width: 300px;
  height: 300px;
  transition: color 0.3s;
  color: #e0e0e0;
}

.scratch-card {
  position: relative;
  width: 300px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-secondary);
  border: 2px dashed var(--color-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: crosshair;
}

.scratch-content {
  padding: 1rem;
}

.scratch-content h3 {
  font-size: var(--text-xl);
  color: var(--color-accent);
}

.btn-whatsapp-promo {
  margin-top: 10px;
  padding: 5px 10px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.tape-measure-game {
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.tape-measure-game input[type=range] {
  width: 100%;
  margin: 20px 0;
}

.result-box {
  background: var(--color-primary);
  color: var(--color-secondary);
  padding: var(--space-md);
  border-radius: 10px;
  text-align: center;
  width: 100%;
}
.result-box h3 {
  font-size: var(--text-xxl);
  color: var(--color-accent);
}

/* Confianza */
.stats-container {
  display: flex;
  justify-content: space-around;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.stat {
  text-align: center;
  font-size: var(--text-xxl);
  font-family: var(--font-display);
  font-weight: bold;
  color: var(--color-accent);
}
.stat p {
  font-size: var(--text-base);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: normal;
}

.testimonials {
  display: flex;
  overflow-x: auto;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  scroll-snap-type: x mandatory;
}

.testimonial {
  min-width: 300px;
  background: var(--color-bg-alt);
  padding: var(--space-lg);
  border-radius: 10px;
  scroll-snap-align: center;
  font-style: italic;
  border-left: 4px solid var(--color-accent);
}

/* Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

#contact-form input, #contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: var(--text-base);
}

#contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

#footer {
  background: var(--color-primary);
  color: var(--color-secondary);
  text-align: center;
  padding: var(--space-md) 0;
}
