/* ============================================================
   POMPA ART STUDIO — Estilos globales
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Raleway:wght@300;400;500;600&family=Great+Vibes&family=Dancing+Script:wght@400;700&family=Pinyon+Script&family=Montserrat:wght@300;400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --cream:        #FAF6F0;
  --cream-dark:   #F0E8DE;
  --gold:         #C9A96E;
  --gold-light:   #DFC08A;
  --gold-dark:    #A07840;
  --burgundy:     #7B2D42;
  --burgundy-dark:#5A1F2F;
  --dark:         #1C1008;
  --text:         #3A2410;
  --text-light:   #7A6050;
  --white:        #FFFAF5;
  --shadow:       0 4px 20px rgba(28,16,8,0.15);
  --shadow-lg:    0 10px 40px rgba(28,16,8,0.2);
  --radius:       12px;
  --radius-lg:    20px;
  --transition:   0.3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Raleway', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: var(--burgundy);
  line-height: 1.2;
}

p { line-height: 1.7; color: var(--text-light); }

a { color: var(--gold-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--burgundy); }

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

button, .btn {
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  border: none;
  outline: none;
  transition: all var(--transition);
}

/* ─── Scrollbar elegante ─────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ─── Header / Logo ──────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: linear-gradient(to bottom, rgba(28,16,8,0.6), transparent);
  transition: background var(--transition);
}

.site-header.scrolled {
  background: rgba(250,246,240,0.96);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.site-header.scrolled .logo-img { filter: none; }
.site-header.scrolled .header-nav a { color: var(--text); }

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* ─── Selector de fuente con buscador ───────────────── */
.font-selector { position: relative; }

.font-selector-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition);
  text-align: left;
}
.font-selector-btn:hover,
.font-selector-btn.open { border-color: var(--gold); }

.font-selector-label {
  font-size: 1rem;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.font-arrow {
  font-size: 0.75rem;
  color: var(--gold-dark);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.font-selector-btn.open .font-arrow { transform: rotate(180deg); }

.font-selector-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 300;
  background: var(--white);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.font-selector-panel.open { display: block; }

.font-search {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-bottom: 1px solid var(--cream-dark);
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  outline: none;
  background: var(--cream);
  color: var(--text);
}
.font-search::placeholder { color: #bbb; }

.font-list {
  max-height: 520px;
  overflow-y: auto;
}
.font-list::-webkit-scrollbar { width: 5px; }
.font-list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

.font-option {
  padding: 6px 14px;
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--text);
  transition: background var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-option:hover { background: var(--cream); }
.font-option.selected {
  background: var(--cream-dark);
  color: var(--burgundy);
}

/* ─── Select elegante ────────────────────────────────── */
.select-elegante {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A07840' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.select-elegante:focus { border-color: var(--gold); }

.fuente-preview {
  font-size: 1.4rem;
  text-align: center;
  margin-top: 8px;
  color: var(--text);
  min-height: 2.2rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  transition: font-family 0.2s;
}

.header-nav { display: flex; gap: 32px; align-items: center; }

.header-nav a {
  color: var(--white);
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-light);
}

/* ─── Botones ────────────────────────────────────────────── */
.btn-primary {
  background: var(--burgundy);
  color: var(--white);
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(123,45,66,0.35);
}
.btn-primary:hover {
  background: var(--burgundy-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(123,45,66,0.45);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: var(--dark);
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(201,169,110,0.4);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201,169,110,0.55);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold-dark);
  padding: 12px 34px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--dark);
  transform: translateY(-2px);
}

/* ─── Separador ornamental ───────────────────────────────── */
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.4rem;
  margin: 16px 0;
  letter-spacing: 8px;
  user-select: none;
}

.section-title {
  text-align: center;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-subtitle {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 48px;
}

/* ─── Panel de selección (opciones) ─────────────────────── */
.options-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  border: 1px solid var(--cream-dark);
}

.option-group {
  margin-bottom: 24px;
}

.option-label {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--burgundy);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* ─── Chips de selección ─────────────────────────────────── */
.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { background: var(--cream-dark); border-color: var(--gold-dark); }
.chip.selected {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--white);
}

/* ─── Swatches de color ──────────────────────────────────── */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: relative;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: var(--burgundy);
  transform: scale(1.2);
}
.color-swatch[title="Blanco"] { border-color: #ddd; }

/* ─── Input elegante ─────────────────────────────────────── */
.input-elegante {
  width: 100%;
  padding: 12px 18px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition);
  outline: none;
}
.input-elegante:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}
.input-elegante::placeholder { color: #bbb; }

/* ─── Grid de miniaturas ─────────────────────────────────── */
.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.thumb-item {
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 10px 8px 8px;
  text-align: center;
}
.thumb-item:hover { border-color: var(--gold); transform: translateY(-2px); }
.thumb-item.selected { border-color: var(--burgundy); background: rgba(123,45,66,0.06); }
.thumb-item img { max-width: 90%; max-height: 100px; width: auto; height: auto; object-fit: contain; }
.thumb-item span { font-size: 0.7rem; color: var(--text-light); margin-top: 5px; }

/* ─── Telas: cuadros pequeños de textura con nombre ─────── */
#telasGrid {
  grid-template-columns: repeat(3, 1fr);
}
.tela-thumb {
  min-height: auto !important;
  padding: 0 !important;
}
.tela-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  flex-shrink: 0;
}
.tela-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  max-width: 100% !important;
  max-height: none !important;
  transition: transform 0.3s ease;
}
.tela-thumb:hover .tela-img-wrap img {
  transform: scale(1.5);
}
.tela-thumb span {
  padding: 3px 5px 5px;
  font-size: 0.6rem !important;
  line-height: 1.2;
  display: block;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Preview del diseño ─────────────────────────────────── */
.preview-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--cream-dark);
}

.preview-canvas-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* ─── Barra de acción inferior ───────────────────────────── */
.action-bar {
  background: var(--white);
  border-top: 1px solid var(--cream-dark);
  padding: 20px 28px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ─── Toast de notificación ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--dark);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 4px solid #4CAF50; }
.toast.error { border-left: 4px solid var(--burgundy); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,16,8,0.6);
  backdrop-filter: blur(6px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  max-width: 520px;
  width: 90%;
  transform: scale(0.9);
  transition: transform var(--transition);
}
.modal-overlay.open .modal-box { transform: scale(1); }

/* ─── Formulario de pedido ───────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  color: var(--burgundy);
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem;
  outline: none;
  background: var(--cream);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
  background: var(--white);
}

/* ─── Loading spinner ────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .logo-img { height: 44px; }
  .header-nav { gap: 12px; }
  .header-nav a { font-size: 0.8rem; letter-spacing: 0.05em; }

  .options-panel { padding: 18px 16px; }
  .action-bar {
    justify-content: center;
    padding: 16px;
    gap: 10px;
  }
  .action-bar .btn-primary,
  .action-bar .btn-outline,
  .action-bar .btn-gold {
    flex: 1 1 100%;
    text-align: center;
  }

  .modal-box {
    padding: 24px 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-actions { flex-direction: column; }
  .modal-actions button { width: 100%; }

  .toast { bottom: 16px; right: 16px; left: 16px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .site-header { padding: 8px 12px; }
  .logo-img { height: 36px; }
  .header-nav { gap: 8px; }
  .header-nav a {
    font-size: 0.72rem;
    letter-spacing: 0;
    padding: 4px 0;
  }

  .btn-primary, .btn-gold, .btn-outline {
    padding: 11px 20px;
    font-size: 0.82rem;
  }

  .options-panel { padding: 14px 12px; }
  .paso-header h3 { font-size: 0.95rem; }
  .option-label { font-size: 0.85rem; }

  .color-swatch { width: 30px; height: 30px; }
  .thumbs-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
  #telasGrid { grid-template-columns: repeat(3, 1fr); }
  .thumb-item:not(.tela-thumb) img { width: 48px; height: 48px; }
}


/* ─── Cookie Banner ──────────────────────────────────────── */
#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--dark, #1C1008);
  color: #eee;
  padding: 16px 24px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
#cookieBanner.visible { transform: translateY(0); }
.cookie-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  line-height: 1.6;
}
.cookie-banner-text strong { font-size: 0.95rem; color: var(--gold, #C9A96E); }
.cookie-banner-text a { color: var(--gold-light, #DFC08A); }
.cookie-banner-btns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 600;
  transition: opacity 0.2s;
}
.cookie-btn:hover { opacity: 0.85; }
.cookie-btn-primary {
  background: var(--gold, #C9A96E);
  color: #fff;
}
.cookie-btn-outline {
  background: transparent;
  color: #ccc;
  border: 1px solid #555;
}
@media (max-width: 600px) {
  .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
  .cookie-banner-btns { width: 100%; }
  .cookie-btn { flex: 1; text-align: center; }
}
