/* ================================================================
   VARIABLES Y RESET
================================================================ */
:root {
  --gold:       #C9A84C;
  --gold-light: #E8D5A3;
  --dark:       #0D0D0D;
  --dark-2:     #1A1A1A;
  --dark-3:     #252525;
  --dark-4:     #2e2e2e;
  --white:      #F5F0E8;
  --gray:       #888;
  --gray-2:     #555;
  --edit-blue:  #4A90E2;
  --edit-blue2: rgba(74,144,226,0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', sans-serif;
  --radius:     12px;
  --transition: 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--dark);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
}
body.has-admin-bar { padding-top: 56px; }

/* ================================================================
   BARRA EDICIÓN
================================================================ */
#edit-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(13,13,13,0.96);
  border-bottom: 1px solid #2a2a2a;
  backdrop-filter: blur(12px);
  z-index: 9999;
}
.edit-bar__inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.edit-bar__logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.edit-bar__actions { display: flex; gap: 10px; align-items: center; }

.eb-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: 0.03em;
}
.eb-btn:hover { opacity: 0.85; transform: scale(1.02); }
.eb-btn--primary { background: var(--gold); color: var(--dark); }
.eb-btn--save    { background: #27ae60; color: #fff; }
.eb-btn--ghost   { background: transparent; border: 1px solid #444; color: var(--gray); }
.eb-btn--ghost:hover { border-color: var(--white); color: var(--white); }

/* ================================================================
   NAV DOTS
================================================================ */
#nav-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 8888;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.5);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  padding: 0;
}
.dot.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.3);
}
.dot:hover { border-color: var(--gold); background: rgba(201,168,76,0.4); }

/* ================================================================
   PANTALLAS
================================================================ */
.screen {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px 100px;
}

/* Fade-in al hacer scroll */
.screen { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.screen.visible { opacity: 1; transform: translateY(0); }

/* ================================================================
   PORTADA
================================================================ */
.screen--cover {
  overflow: hidden;
  text-align: center;
  justify-content: center;
  opacity: 1 !important;
  transform: none !important;
}

.cover__bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1600')
              center/cover no-repeat;
  filter: brightness(0.35) saturate(0.6);
  transition: background-image 0.5s;
  z-index: 0;
}
.cover__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(13,13,13,0.9) 100%);
}

.cover__bg-edit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  pointer-events: none;
}
.cover__bg-edit.edit-only.visible { pointer-events: auto; }

.cover__content {
  position: relative;
  z-index: 3;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeUp 1.2s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cover__logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cover__logo {
  max-height: 110px;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
  border-radius: 8px;
}

.cover__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--white);
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.cover__title-input {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 900;
  text-align: center;
  background: rgba(0,0,0,0.5);
  border: 2px dashed var(--gold);
  border-radius: 12px;
  color: var(--white);
  padding: 12px 24px;
  width: 100%;
  max-width: 700px;
}

/* Subtítulo portada */
.cover__subtitle-wrap { width: 100%; }
.cover__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--gold-light);
  opacity: 0.9;
  letter-spacing: 0.06em;
}
.cover__subtitle-input {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
  width: 100%;
  max-width: 600px;
}

/* Flecha scroll */
.cover__scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.scroll-arrow {
  display: block;
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.6;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(8px); opacity: 1; }
}

/* ================================================================
   SECTION TITLE EDITABLE
================================================================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  display: inline-block;
  margin-bottom: 16px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 16px auto 0;
}
.section-title-input {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  width: 100%;
  max-width: 600px;
  background: rgba(0,0,0,0.4);
  color: var(--white);
}
/* ocultar línea dorada cuando está el input */
body.editing .section-title::after { display: none; }

.section-header {
  text-align: center;
  margin-bottom: 48px;
  width: 100%;
}

/* ================================================================
   SECCIÓN INFO
================================================================ */
.screen--info {
  background: var(--dark-3);
  justify-content: flex-start;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1000px;
  width: 100%;
}
@media (max-width: 700px) {
  .info-grid { grid-template-columns: 1fr; }
}
.info-card {
  background: var(--dark-2);
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.info-card__icon {
  font-size: 1.5rem;
  color: var(--gold);
}
.info-desc {
  font-size: 1rem;
  color: var(--white);
  line-height: 1.8;
  opacity: 0.85;
}
.info-textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  min-height: 160px;
  resize: vertical;
  width: 100%;
  background: rgba(0,0,0,0.3);
  color: var(--white);
  border-radius: 10px;
  padding: 14px;
}
.info-card--details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.info-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.idr-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.idr-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.idr-value {
  font-size: 0.95rem;
  color: var(--white);
  opacity: 0.85;
}
.idr-input {
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: rgba(0,0,0,0.3);
  color: var(--white);
  border-radius: 8px;
  padding: 6px 12px;
  width: 100%;
}

/* ================================================================
   GALERÍA
================================================================ */
.screen--gallery {
  background: var(--dark-2);
  justify-content: flex-start;
}
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

/* ================================================================
   CARD FOTO — 9:16
================================================================ */
.photo-card {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
}
.photo-card__img-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-3);
  border: 2px solid transparent;
  position: relative;
  flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.photo-card__img-wrap:hover {
  border-color: rgba(201,168,76,0.6);
  box-shadow: 0 6px 32px rgba(201,168,76,0.18);
}
/* Solo mostrar borde discontinuo en modo edición cuando no hay imagen */
body.editing .photo-card__img-wrap:not(.has-image) {
  border: 2px dashed var(--gray-2);
}
body.editing .photo-card__img-wrap:not(.has-image):hover {
  border-color: var(--gold);
}
.photo-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* cursor pointer en vista previa para lightbox */
.photo-card__img-wrap.clickable { cursor: zoom-in; }

.photo-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.photo-card__placeholder .ph-icon { font-size: 2.2rem; opacity: 0.5; }
.photo-card__placeholder .ph-text { font-size: 0.78rem; color: var(--gray); text-align: center; line-height: 1.4; }
.photo-card__img-wrap input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.photo-card__img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.photo-card__img-wrap:hover .photo-card__img-overlay { opacity: 1; pointer-events: auto; }
.photo-card__img-overlay span {
  font-size: 0.78rem;
  color: var(--white);
  background: rgba(201,168,76,0.8);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
}

.photo-card__info { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 0; }
.photo-card__info-view .pci-titulo { font-size: 0.85rem; font-weight: 700; color: var(--white); }
.photo-card__info-view .pci-desc   { font-size: 0.75rem; color: var(--gold-light); line-height: 1.4; }
.photo-card__info-view .pci-fecha  { font-size: 0.72rem; color: var(--gray); letter-spacing: 0.05em; }
.photo-card__info-edit { display: flex; flex-direction: column; gap: 6px; }

.pci-input {
  background: var(--dark-3);
  border: 1px solid #3a3a3a;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.78rem;
  width: 100%;
  transition: border-color var(--transition);
}
.pci-input:focus { outline: none; border-color: var(--gold); }
.pci-input::placeholder { color: var(--gray-2); }

.photo-card__del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.75);
  border: 1px solid #555;
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background var(--transition);
  opacity: 0; pointer-events: none;
}
.photo-card:hover .photo-card__del { opacity: 1; pointer-events: auto; }
.photo-card__del:hover { background: #c0392b; border-color: #c0392b; }

/* ================================================================
   BOTÓN AGREGAR ITEM
================================================================ */
.btn-add-item {
  margin-top: 32px;
  background: rgba(201,168,76,0.12);
  border: 2px dashed var(--gold);
  color: var(--gold);
  border-radius: 50px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background var(--transition), transform var(--transition);
}
.btn-add-item:hover { background: rgba(201,168,76,0.25); transform: scale(1.03); }

/* ================================================================
   VIDEOS
================================================================ */
.screen--videos { background: var(--dark); justify-content: flex-start; }
.videos-row {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;
  width: 100%; max-width: 1200px;
}
.video-card {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column; position: relative;
}
.video-card__vid-wrap {
  width: 100%; aspect-ratio: 9 / 16;
  border-radius: var(--radius); overflow: hidden;
  background: var(--dark-3);
  border: 2px solid transparent;
  position: relative; flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.video-card__vid-wrap:hover {
  border-color: rgba(201,168,76,0.6);
  box-shadow: 0 6px 32px rgba(201,168,76,0.18);
}
/* Solo mostrar borde discontinuo en modo edición cuando no hay video */
body.editing .video-card__vid-wrap:not(.has-video) {
  border: 2px dashed var(--gray-2);
}
body.editing .video-card__vid-wrap:not(.has-video):hover {
  border-color: var(--gold);
}
.video-card__vid-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card__vid-wrap input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; z-index: 2;
}
.video-card__info { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 0; }
.video-card__info-view .pci-titulo { font-size: 0.85rem; font-weight: 700; color: var(--white); }
.video-card__info-view .pci-desc   { font-size: 0.75rem; color: var(--gold-light); line-height: 1.4; }
.video-card__info-view .pci-fecha  { font-size: 0.72rem; color: var(--gray); letter-spacing: 0.05em; }
.video-card__del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.75); border: 1px solid #555;
  color: #fff; border-radius: 50%; font-size: 0.65rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5; transition: background var(--transition);
  opacity: 0; pointer-events: none;
}
.video-card:hover .video-card__del { opacity: 1; pointer-events: auto; }
.video-card__del:hover { background: #c0392b; border-color: #c0392b; }

/* ================================================================
   DROP ZONES (portada)
================================================================ */
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone--bg {
  width: 160px; height: 100px;
  background: rgba(0,0,0,0.6);
  border: 2px dashed rgba(201,168,76,0.6);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.drop-zone--bg:hover { border-color: var(--gold); background: rgba(201,168,76,0.12); }
.drop-zone--logo {
  width: 120px; height: 80px;
  background: rgba(0,0,0,0.5);
  border: 2px dashed rgba(201,168,76,0.5);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.drop-zone--logo:hover { border-color: var(--gold); background: rgba(201,168,76,0.1); }
.dz-icon { font-size: 1.4rem; opacity: 0.7; }
.dz-text { font-size: 0.7rem; color: var(--gold-light); text-align: center; line-height: 1.5; }
.dz-text small { color: var(--gray); }

/* ================================================================
   MODO EDICIÓN — indicadores visuales
================================================================ */
body.editing .screen--cover   { outline: 2px dashed rgba(74,144,226,0.3); outline-offset: -4px; }
body.editing .screen--gallery { outline: 2px dashed rgba(74,144,226,0.2); outline-offset: -4px; }
body.editing .screen--videos  { outline: 2px dashed rgba(74,144,226,0.2); outline-offset: -4px; }
body.editing .screen--info    { outline: 2px dashed rgba(74,144,226,0.2); outline-offset: -4px; }

/* ================================================================
   VISIBILIDAD MODO EDICIÓN
================================================================ */
.edit-only { display: none !important; }
body.editing .edit-only { display: flex !important; }
body.editing .edit-only.btn-add-item { display: inline-block !important; }

.view-only { display: block; }
body.editing .view-only { display: none !important; }
.view-only-flex { display: flex; }
body.editing .view-only-flex { display: none !important; }

/* ================================================================
   INLINE EDIT
================================================================ */
.inline-edit {
  background: rgba(0,0,0,0.55);
  border: 2px dashed var(--gold) !important;
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-body);
  width: 100%;
  padding: 10px 14px;
  transition: border-color var(--transition);
}
.inline-edit:focus { outline: none; border-color: var(--gold) !important; }

/* ================================================================
   LIGHTBOX
================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFade 0.25s ease;
}
@keyframes lbFade { from { opacity:0 } to { opacity:1 } }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
}
.lb-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,0.1); border: 1px solid #555;
  color: var(--white); font-size: 1.2rem; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lb-close:hover { background: rgba(255,255,255,0.25); }
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(201,168,76,0.15); border: 1px solid var(--gold);
  color: var(--gold); font-size: 2rem; width: 50px; height: 50px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover, .lb-next:hover { background: rgba(201,168,76,0.35); }

/* ================================================================
   PLACEHOLDER VACÍO
================================================================ */
.empty-hint {
  color: var(--gray); font-size: 0.9rem; padding: 60px 0;
  text-align: center; width: 100%;
}

/* ================================================================
   FOOTER
================================================================ */
.footer {
  background: var(--dark-2);
  text-align: center;
  padding: 28px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--gray);
  border-top: 1px solid #222;
}
.footer-sep { margin: 0 6px; }
.footer-edit {
  font-size: 0.78rem;
  font-family: var(--font-body);
  letter-spacing: 0.1em;
  padding: 4px 10px;
  width: auto;
  min-width: 180px;
  display: inline-block !important;
}

/* ================================================================
   TOAST NOTIFICACIÓN
================================================================ */
#toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #27ae60; color: #fff;
  padding: 12px 28px; border-radius: 30px;
  font-size: 0.9rem; font-weight: 700;
  z-index: 99999; transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0; pointer-events: none; white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 600px) {
  .photo-card, .video-card { width: 160px; }
  .edit-bar__logo { display: none; }
  #nav-dots { right: 10px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

.hidden { display: none !important; }
