/* ============================================
   Showroom Fashion Bar - Shared Styles
   CSS Variables for theming (no hardcoded colors)
   ============================================ */

/* --- Theme Variables --- */
:root {
  /* Primary accent - RGB values for Tailwind alpha support */
  --color-primary-rgb: 255 255 255;
  /* Background dark */
  --color-bg-dark-rgb: 10 10 10;
  /* Surface dark (cards, panels) */
  --color-surface-dark-rgb: 22 22 22;
  /* Border color */
  --color-border-rgb: 42 42 42;
  /* Accent/secondary */
  --color-accent-rgb: 58 58 58;
  /* Text muted */
  --color-text-muted-rgb: 153 153 153;

  /* Font families */
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Auto-contrast: text color on primary backgrounds (black text on white primary) */
  --color-on-primary-rgb: 0 0 0;
}

/* --- Base Styles --- */
body {
  font-family: var(--font-body);
  background-color: rgb(var(--color-bg-dark-rgb));
  color: white;
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

::selection {
  background-color: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-on-primary-rgb));
}

/* --- Auto-contrast on primary backgrounds ---
   !important needed because Tailwind CDN injects its styles
   dynamically (after link CSS), so same-specificity rules lose. */
.bg-primary,
.bg-primary:hover,
.hover\:bg-primary:hover {
  color: rgb(var(--color-on-primary-rgb)) !important;
}
.bg-primary a,
.bg-primary span,
.bg-primary .material-symbols-outlined {
  color: inherit !important;
}
/* Border-only buttons that fill on hover */
.hover\:bg-primary:hover span,
.hover\:bg-primary:hover .material-symbols-outlined {
  color: inherit !important;
}

/* --- Neon Glow Effects --- */
.text-glow {
  text-shadow: 0 0 10px rgb(var(--color-primary-rgb) / 0.5),
               0 0 30px rgb(var(--color-primary-rgb) / 0.2);
}

.border-glow {
  box-shadow: 0 0 10px rgb(var(--color-primary-rgb) / 0.2),
              0 0 20px rgb(var(--color-primary-rgb) / 0.1);
}

.neon-glow {
  box-shadow: 0 0 5px rgb(var(--color-primary-rgb)),
              0 0 20px rgb(var(--color-primary-rgb) / 0.5);
}

.neon-glow-sm {
  box-shadow: 0 0 2px rgb(var(--color-primary-rgb)),
              0 0 10px rgb(var(--color-primary-rgb) / 0.4);
}

.neon-glow-hover:hover {
  box-shadow: 0 0 10px rgb(var(--color-primary-rgb)),
              0 0 30px rgb(var(--color-primary-rgb) / 0.6);
}

/* --- Geometric Decorations --- */
.geo-triangle {
  clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.dot-pattern {
  background-image: radial-gradient(rgb(var(--color-primary-rgb)) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgb(var(--color-bg-dark-rgb));
}
::-webkit-scrollbar-thumb {
  background: rgb(var(--color-accent-rgb));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--color-primary-rgb));
}

/* --- Scroll Video Section --- */
.scroll-video-container {
  position: relative;
  width: 100%;
}

.scroll-video-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.scroll-video-sticky video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scroll-video-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgb(var(--color-primary-rgb));
  transition: width 0.1s linear;
  z-index: 10;
}

/* --- Map Container Filter --- */
.map-container {
  filter: grayscale(100%) invert(92%) contrast(83%);
}

/* --- Smart Header: se oculta al hacer scroll abajo, aparece al subir --- */
header {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
header.header-hidden {
  transform: translateY(-100%);
}

/* --- Mobile Menu: slide-down suave con grid trick --- */
#mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-menu.is-open {
  grid-template-rows: 1fr;
}
#mobile-menu > nav {
  overflow: hidden;
}

/* Stagger fade-in para cada item del menu movil */
#mobile-menu.is-open > nav > div > * {
  animation: mobileNavItem 0.35s ease both;
  opacity: 0;
}
#mobile-menu.is-open > nav > div > *:nth-child(1) { animation-delay: 0.07s; }
#mobile-menu.is-open > nav > div > *:nth-child(2) { animation-delay: 0.13s; }
#mobile-menu.is-open > nav > div > *:nth-child(3) { animation-delay: 0.19s; }
#mobile-menu.is-open > nav > div > *:nth-child(4) { animation-delay: 0.25s; }
#mobile-menu.is-open > nav > div > *:nth-child(5) { animation-delay: 0.31s; }
#mobile-menu.is-open > nav > div > *:nth-child(6) { animation-delay: 0.37s; }

@keyframes mobileNavItem {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Icono del boton hamburguesa: rota al abrir */
#mobile-menu-btn .material-symbols-outlined {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-menu-btn.is-open .material-symbols-outlined {
  transform: rotate(90deg);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgb(var(--color-primary-rgb) / 0.5); }
  50% { box-shadow: 0 0 20px rgb(var(--color-primary-rgb) / 0.8); }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* --- Theme Customizer Widget --- */
#theme-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-on-primary-rgb));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgb(var(--color-primary-rgb) / 0.4);
  transition: all 0.3s ease;
}
#theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 25px rgb(var(--color-primary-rgb) / 0.6);
}
#theme-toggle-btn.hidden-btn {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

#theme-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 9998;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgb(var(--color-surface-dark-rgb));
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#theme-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
#theme-panel h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#theme-panel .theme-group {
  margin-bottom: 16px;
}
#theme-panel .theme-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(var(--color-text-muted-rgb));
  margin-bottom: 6px;
}
#theme-panel .theme-group input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: 8px;
  background: rgb(var(--color-bg-dark-rgb));
  cursor: pointer;
  padding: 2px;
}
#theme-panel .theme-group select {
  width: 100%;
  height: 40px;
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: 8px;
  background: rgb(var(--color-bg-dark-rgb));
  color: white;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
#theme-panel .theme-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
#theme-panel .theme-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-display);
}
#theme-panel .btn-reset {
  background: rgb(var(--color-bg-dark-rgb));
  color: white;
  border: 1px solid rgb(var(--color-border-rgb));
}
#theme-panel .btn-reset:hover {
  border-color: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-primary-rgb));
}
#theme-panel .btn-close {
  background: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-on-primary-rgb));
}
#theme-panel .btn-close:hover {
  opacity: 0.9;
}

/* --- Theme Presets --- */
.theme-presets-section {
  margin-bottom: 16px;
}
.theme-presets-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(var(--color-text-muted-rgb));
  margin-bottom: 10px;
}
.theme-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-bg-dark-rgb));
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
}
.theme-preset-btn:hover {
  border-color: rgb(var(--color-primary-rgb) / 0.6);
  background: rgb(var(--color-surface-dark-rgb));
}
.theme-preset-btn.active {
  border-color: rgb(var(--color-primary-rgb));
  box-shadow: 0 0 8px rgb(var(--color-primary-rgb) / 0.3);
}
.preset-color {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.preset-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-separator {
  height: 1px;
  background: rgb(var(--color-border-rgb));
  margin: 16px 0;
}

/* Scrollbar for theme panel */
#theme-panel::-webkit-scrollbar {
  width: 4px;
}
#theme-panel::-webkit-scrollbar-thumb {
  background: rgb(var(--color-accent-rgb));
  border-radius: 2px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  #theme-panel {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* --- Post Content Typography --- */
.post-content {
  color: rgb(209 213 219);
  font-size: 1.0625rem;
  line-height: 1.85;
}
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.post-content h2 { font-size: 1.875rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }
.post-content p  { margin-bottom: 1.5rem; }
.post-content a  { color: rgb(var(--color-primary-rgb)); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.8; }
.post-content strong { color: white; font-weight: 600; }
.post-content em { font-style: italic; }

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.5rem; }

.post-content blockquote {
  border-left: 3px solid rgb(var(--color-primary-rgb));
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgb(var(--color-surface-dark-rgb));
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: rgb(209 213 219);
}
.post-content blockquote p { margin-bottom: 0; }

.post-content img,
.post-content figure img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}
.post-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: rgb(var(--color-text-muted-rgb));
  margin-top: 0.5rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid rgb(var(--color-border-rgb));
  margin: 2.5rem 0;
}

.post-content pre {
  background: rgb(var(--color-surface-dark-rgb));
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.875rem;
}
.post-content code {
  background: rgb(var(--color-surface-dark-rgb));
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}
.post-content pre code {
  background: none;
  padding: 0;
}

/* --- Paginación del Blog --- */
.posts-pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.posts-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-surface-dark-rgb));
  color: rgb(209 213 219);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}
.posts-pagination .page-numbers:hover {
  border-color: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-primary-rgb));
}
.posts-pagination .page-numbers.current {
  background: rgb(var(--color-primary-rgb));
  border-color: rgb(var(--color-primary-rgb));
  color: rgb(var(--color-on-primary-rgb));
}
.posts-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: rgb(var(--color-text-muted-rgb));
}

/* --- WordPress FullWidth Helper --- */
/* Forces full width on common WordPress containers if the theme constrains them */
/* NOTE: overflow-x uses `clip` instead of `hidden` to avoid breaking position:sticky.
   `clip` trims overflow visually without creating a new scroll container. */
body .entry-content,
body .site-content,
body .site-main,
body .wp-site-blocks,
body .alignfull {
  max-width: 100vw !important;
  width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 0 !important;
  overflow-x: clip !important;
}

/* Ensure the scroll-video container works correctly */
.scroll-video-sticky {
  max-width: 100vw;
  overflow: hidden;
}

/* Mobile: canvas mantiene proporción de aspecto en lugar de 100vh */
@media (max-width: 767px) {
  .scroll-video-sticky {
    height: auto !important;
  }
  #scroll-video-canvas {
    width: 100% !important;
    height: auto !important;
  }
}
