/* ==========================================================================
   E-COMMERCE CUADROS DE ALUMINIO - DESIGN SYSTEM & LAYOUT
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Clean Light Theme matching reference image */
  --bg-primary: #f5f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent-cyan: #06b6d4;
  --accent-green: #2d6a4f;
  --accent-price: #2d6a4f;
  --accent-glow: rgba(6, 182, 212, 0.3);
  --accent-gradient: linear-gradient(135deg, #09090b 0%, #27272a 100%);
  
  --border-color: #e4e4e7;
  --border-active: #09090b;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.06);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-badge {
  background: var(--text-primary);
  color: #fff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-tabs {
  display: flex;
  background: #f4f4f5;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  padding: 7px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 220px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: #f4f4f5;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--text-primary);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* Title Selector Pill Bar */
.title-selector-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
}

.title-selector-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.title-pill {
  padding: 5px 16px;
  border-radius: 20px;
  background: #f4f4f5;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.title-pill:hover {
  background: #e4e4e7;
  color: var(--text-primary);
}

.title-pill.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: transparent;
  font-weight: 700;
}

/* Main Layout Grid */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* 3 Main Top Cards Layout — flex row, bottom-aligned, equal gaps */
.viewer-section {
  display: flex;
  flex-direction: row;
  align-items: flex-end;  /* align bottom edges */
  gap: 24px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .viewer-section {
    flex-direction: column;
    align-items: center;
  }
  .large-preview-card,
  .configurator-card {
    width: 100%;
    max-width: 340px;
  }
}


/* Column 1: Vista Grande Card with Arrow Buttons on sides */
.large-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  padding: 0;
  flex: 0 0 auto;
  width: 240px;           /* fixed width matching configurator */
  aspect-ratio: 20 / 30; /* fixed portrait ratio */
  box-shadow: var(--shadow-card);
}

/* Ensure the large image fills the container */
.large-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: none; /* no hover zoom */
}

/* Remove hover zoom */
.large-preview-card img:hover {
  transform: none;
}

/* Side Arrow Buttons for Previous / Next Image */
.arrow-btn {
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

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

.arrow-btn:hover {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
  transform: translateY(-50%) scale(1.08);
}

.arrow-btn:active { transform: translateY(-50%) scale(0.95); }



/* Column 2: Room Mockup Card */
.mockup-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  position: relative;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* image sits at bottom */
  flex: 1 1 auto;            /* grows to fill available space */
}



.mockup-viewport {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.mockup-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay Artwork with Metallic Sheen and Subtle Shadow */
.mockup-overlay {
  position: absolute;
  z-index: 2;
  border-radius: 2px;
  transition: all 0.4s ease;
  overflow: hidden;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.3);
}

.mockup-overlay::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.08) 18%,
    transparent 35%,
    rgba(255, 255, 255, 0.06) 55%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 100%
  );
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 3;
}

.mockup-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mockup-overlay.shadow-separated {
  /* Subtle shadow for larger frames */
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.16), 0.5px 1px 2px rgba(0, 0, 0, 0.12);
}

.mockup-overlay.shadow-compact {
  /* Very subtle shadow for smallest frames */
  box-shadow: 0.5px 1px 2px rgba(0, 0, 0, 0.08);
}

/* Column 3: Product Configurator Card — same size as large image */
.configurator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  flex: 0 0 auto;
  width: 240px;           /* same as large-preview-card */
  aspect-ratio: 20 / 30; /* same portrait ratio */
  overflow: hidden;
}

.product-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.2;
}

.product-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.price-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-price);
  letter-spacing: -1px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

/* Single Badge for Cuadro Metálico */
.product-type-single {
  background: #f4f4f5;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

/* Format Sizes Selector Cards */
.format-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.format-option:hover {
  border-color: var(--text-primary);
}

.format-option.active {
  background: #e8f5e9;
  border-color: #2d6a4f;
}

.format-dim {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.format-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-price);
}

/* Order CTA Button */
.btn-order {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 14px;
  background: #18181b;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-order:hover {
  background: #000000;
  transform: translateY(-1px);
}

.btn-order:active {
  transform: translateY(0);
}

/* Price + Mercado Pago Logo Row */
.price-and-badge-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.price-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-logo-col {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-logo-img {
  width: 110px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Bottom Gallery Section — 50% smaller thumbnails */
.gallery-section {
  width: 100%;
  max-width: 680px; /* reduced from 920px for ~50% smaller area */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-header {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr); /* more columns = smaller cards */
  gap: 6px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.thumb-card {
  aspect-ratio: 20 / 30;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  background: #e4e4e7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-secondary);
}

.thumb-card.active {
  border-color: #20c997;
  box-shadow: 0 0 0 2px #20c997, 0 4px 12px rgba(32, 201, 151, 0.3);
}

/* Modal Checkout Styling */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-summary {
  background: #f4f4f5;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.modal-summary img {
  width: 50px;
  aspect-ratio: 20 / 30;
  object-fit: cover;
  border-radius: 6px;
}

.modal-summary-details p {
  font-size: 0.85rem;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.btn-confirm-order {
  width: 100%;
  padding: 12px;
  background: #25d366; /* WhatsApp green */
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-order:hover {
  background: #1eb857;
}
