/* 
   Nancy Joyas & Artesanías — Estilos Globales y Responsive
   Optimizado para Mobile-First y Desktop-Premium
*/

/* --- Variables y Configuración --- */
:root {
  --black: #0A0A0A;
  --gold: #D4AF37;
  --gold-hover: #B8962E;
  --cream: #F8F4EC;
  --white: #FFFFFF;
  --muted: #7A7A7A;
  --light-gray: #F0ECEA;
  --font-main: 'Lato', sans-serif;
  --font-title: 'Playfair Display', serif;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
  --container-width: 1200px;
  --header-height: 100px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  color: var(--black);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}

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

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

/* --- Botones --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(212, 175, 55, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--black);
}

.btn-sm {
  padding: 10px 24px;
  font-size: 13px;
}

/* --- Header --- */
.site-header {
  background: var(--white);
  min-height: var(--header-height);
  padding: 10px 0;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo img {
  height: 80px;
  width: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  padding: 2px;
  background: var(--white);
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: scale(1.05);
}

.main-nav {
  display: flex;
  gap: 30px;
}

.main-nav a {
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s ease;
  position: relative;
}

.main-nav a:hover {
  color: var(--gold);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--black);
  display: block;
  position: relative;
  transition: background 0.3s ease;
}

.hamburger::before, .hamburger::after {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--black);
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { transform: rotate(45deg) translateY(11px); }
.nav-toggle.open .hamburger::after { transform: rotate(-45deg) translateY(-11px); }

/* --- Hero --- */
.hero {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 700px;
  max-height: 850px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../assets/referencias/hero-original.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 850px;
  padding: 40px 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero .lead {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 40px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  opacity: 0.95;
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* --- Secciones --- */
.section {
  padding: 100px 0;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 50px;
  text-align: center;
  position: relative;
  padding-bottom: 20px;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold);
}

/* --- Grids --- */
.product-grid, .categories-grid {
  display: grid;
  gap: 30px;
}

.product-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-media {
  aspect-ratio: 1/1;
  background: var(--light-gray);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.product-card h3 {
  font-size: 1.2rem;
  padding: 20px 20px 10px;
}

.price {
  color: var(--gold);
  font-weight: 700;
  padding: 0 20px 10px;
}

.product-card p.muted {
  padding: 0 20px 20px;
  font-size: 0.9rem;
  color: var(--muted);
  flex-grow: 1;
}

.product-card .btn {
  margin: 0 20px 20px;
}

/* --- Footer --- */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 80px 0 30px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.footer-brand h3 {
  color: var(--gold);
  margin-bottom: 20px;
}

.footer-brand p {
  color: rgba(255,255,255,0.6);
  max-width: 300px;
}

.footer-links h4, .footer-actions h4 {
  color: var(--white);
  margin-bottom: 25px;
  font-size: 1.1rem;
}

.footer-links a, .footer-actions a {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.footer-links a:hover, .footer-actions a:hover {
  color: var(--gold);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* Payments Section */
.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.payment-card {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.payment-card:hover {
  transform: translateY(-5px);
}

.payment-icon {
  font-size: 40px;
  margin-bottom: 15px;
  color: var(--gold);
}

.payment-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.payment-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Category Page Specifics (Smooth Scroll Anchors) */
.catalog-section {
  padding-top: 100px;
  margin-top: -60px; /* Offset for sticky header */
}

/* --- Catalog Layout (Sidebar & Content) --- */
.catalog-layout {
  display: flex;
  gap: 50px;
  margin-top: 40px;
  align-items: flex-start;
}

.catalog-sidebar {
  width: 280px;
  position: sticky;
  top: 130px; /* Offset for header height + padding */
}

.catalog-content {
  flex: 1;
}

/* Filter Navigation Styles */
.filter-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--light-gray);
}

.filter-item {
  margin-bottom: 5px;
}

.filter-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  background: transparent;
  border: none;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.filter-btn:hover {
  color: var(--gold);
}

.filter-btn.active {
  color: var(--black);
  font-weight: 700;
}

.filter-btn.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--gold);
}

/* Mobile Filter Selector */
.mobile-filter-container {
  display: none;
  margin-bottom: 30px;
}

.mobile-filter-select {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--gold);
  background: var(--white);
  font-family: var(--font-main);
  font-size: 16px;
  border-radius: 8px;
  color: var(--black);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 15px;
}

/* --- Story Section (Sobre Nancy) --- */
.story-grid {
  display: flex;
  gap: 60px;
  align-items: center;
  justify-content: space-between;
}

.story-text {
  flex: 1;
}

.story-text h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 25px;
  text-align: left;
}

.story-text h2::after {
  left: 0;
  transform: none;
}

.story-text p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.story-image {
  flex: 0 0 45%;
  max-width: 45%;
}

.story-image img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  display: block;
}

@media (max-width: 900px) {
  .story-grid {
    flex-direction: column;
    gap: 50px; /* Mayor espacio entre imagen y título */
  }
  
  .story-image {
    flex: 0 0 100%;
    max-width: 100%;
    order: -1; /* Imagen primero en móvil */
    margin-top: 30px; /* Espacio extra respecto a la sección anterior/hero */
  }

  .story-image img {
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12); /* Sombra más suave y profesional */
  }

  .story-text {
    text-align: center;
  }

  .story-text h2 {
    text-align: center;
  }

  .story-text h2::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* --- Media Queries Profesionales --- */

/* 1. Escritorio Extra Grande (1200px +) */
@media (min-width: 1201px) {
  .product-grid, .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 2. Escritorio / Laptops (992px a 1200px) */
@media (max-width: 1200px) {
  .container { max-width: 960px; }
  .product-grid, .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3. Tablets / Ipads (768px a 991px) */
@media (max-width: 991px) {
  .container { max-width: 720px; }
  .product-grid, .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero { min-height: 600px; }
  
  .catalog-layout { flex-direction: column; }
  .catalog-sidebar { display: none; }
  .mobile-filter-container { display: block; }
}

/* 4. Móviles Grandes / Tablets pequeñas (Menos de 768px) */
@media (max-width: 767px) {
  .container { max-width: 540px; }
  
  /* Menú Móvil Mejorado */
  .nav-toggle { display: block; }
  
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--white);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
    gap: 40px;
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 999;
  }

  .main-nav a {
    font-size: 1.3rem;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
  }

  /* Centrar Logo */
  .header-inner {
    position: relative;
    justify-content: center;
  }
  
  .logo {
    position: relative;
    z-index: 1; /* Bajo el botón hamburguesa */
  }

  .nav-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100; /* Asegurar que esté sobre todo el header y menú */
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  /* Hero Mobile UX */
  .hero {
    height: 70vh;
    min-height: 500px;
    background-position: 75% center;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    margin-bottom: 15px;
  }

  .hero .lead {
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.4;
  }

  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }

  .hero-cta .btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
  }

  /* Grids de Catálogo */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card h3 {
    font-size: 0.9rem;
    padding: 12px 10px 4px;
  }

  .price {
    font-size: 0.8rem;
    padding: 0 10px 8px;
  }

  .product-card p.muted {
    font-size: 0.75rem;
    padding: 0 10px 10px;
  }

  .product-card .btn {
    margin: 0 10px 10px;
    padding: 10px 5px;
    font-size: 10px;
  }

  /* Formularios UX Táctil */
  input[type="text"],
  input[type="email"],
  textarea {
    padding: 14px !important;
    font-size: 16px !important; /* Evita zoom automático en iPhone */
    border-radius: 8px !important;
  }

  /* Footer Mobile */
  .footer-inner {
    text-align: center;
    gap: 30px;
  }

  .footer-brand p {
    margin: 0 auto;
  }

  .footer-links a, .footer-actions a {
    padding: 8px 0;
    font-size: 0.95rem;
  }

  .section {
    padding: 50px 0;
  }
}

/* 5. Móviles Pequeños (Menos de 576px) */
@media (max-width: 575px) {
  .hero h1 { font-size: 2.2rem; }
  .logo img { height: 50px; width: 50px; }
  .container { padding: 0 15px; }
}

/* 6. Pantallas extremadamente pequeñas */
@media (max-width: 350px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Utilidades --- */
.text-center { text-align: center; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }
