/* ============================================================
   ALFREDO MINIATURAS 3D - CSS Principal
   Tema: Dark + Dorado mejorado
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@700;800&display=swap');

:root {
  --gold: #facc15;
  --gold-dim: #d4a017;
  --orange: #ff8c00;
  --orange-glow: rgba(205, 92, 0, 0.5);
  --bg-body: #0a0a0a;
  --bg-card: #111;
  --bg-card-hover: #1a1a1a;
  --bg-navbar: rgba(10, 10, 10, 0.95);
  --text-main: #eee;
  --text-muted: #999;
  --text-dim: #bbb;
  --border-glow: rgba(205, 92, 0, 0.4);
  --border-glow-strong: rgba(205, 92, 0, 0.7);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px var(--border-glow);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--border-glow-strong);
  --transition: 0.3s ease;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
}

a { transition: color var(--transition); }
img { max-width: 100%; height: auto; }

/* === Animaciones === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes badgeFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 12px var(--border-glow); }
  50% { box-shadow: 0 0 24px var(--border-glow-strong); }
}

/* === Navbar === */
.navbar {
  background-color: var(--bg-navbar);
  border-bottom: 1px solid rgba(255, 140, 0, 0.3);
  backdrop-filter: blur(12px);
  padding: 0.6rem 0;
  z-index: 1050;
}

.logo {
  height: 42px;
  width: auto;
  margin-right: 12px;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 4px;
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav-link {
  color: var(--gold) !important;
  font-weight: 500;
  font-size: 0.9rem;
  margin: 0 4px;
  padding: 6px 12px !important;
  border-radius: 4px;
  transition: all var(--transition);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--gold);
  color: #000 !important;
}

.btn-warning {
  background-color: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-warning:hover {
  background-color: var(--gold-dim);
  border-color: var(--gold-dim);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.3);
}

.btn-outline-warning {
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-outline-warning:hover {
  background-color: var(--gold);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.3);
}

/* === Hero === */
.hero {
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(10,10,10,0.85)),
              url('https://www.ludusbelli.com/wp-content/uploads/2022/07/legiones-de-nagash.jpg') center/cover no-repeat;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding-top: 80px;
}

.hero h1 {
  font-size: 3.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 0.8s ease;
}

.hero .lead {
  font-size: 1.25rem;
  color: var(--text-dim);
  animation: fadeInUp 1s ease 0.2s both;
}

/* === Section Titles === */
.section-title {
  font-family: var(--font-heading);
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
  letter-spacing: 0.04em;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* === Cards genericas === */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

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

.card-body {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 1.25rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-img-top {
  object-fit: contain;
  height: 320px;
  width: 100%;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1510 100%);
  padding: 0.5rem;
  transition: transform 0.4s ease;
}

.card:hover .card-img-top {
  transform: scale(1.03);
}

/* === Productos - Badges === */
.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-15px);
  animation: badgeFadeIn 0.8s ease 0.3s forwards;
  z-index: 2;
}

.badge-new { background-color: var(--gold); color: #000; }
.badge-limited { background-color: #dc2626; color: #fff; }
.badge-offer { background-color: #16a34a; color: #fff; }

/* === Precio === */
.price {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  margin: 0.75rem 0;
  text-align: center;
}

/* === Artesano (Sobre mi) === */
#artesano img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px var(--border-glow);
}

#artesano .lead {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-dim);
}

/* === Mi Trabajo (Knights) === */
.knight-section-title {
  font-family: var(--font-heading);
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
}

.knight-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.knight-card {
  padding: 1rem;
  transition: transform var(--transition);
}

.knight-card:hover {
  transform: translateY(-4px);
}

.knight-card img {
  max-width: 160px;
  height: 160px;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px var(--border-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.knight-card:hover img {
  transform: scale(1.08);
  box-shadow: 0 0 25px var(--border-glow-strong);
}

.knight-card h5 {
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.knight-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === Proceso === */
.process-step {
  background-color: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.process-step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.process-step img {
  max-height: 200px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* === CTA Banner === */
.cta-banner {
  background: linear-gradient(135deg, #111 0%, #1a1510 50%, #111 100%);
  border-top: 1px solid rgba(255, 140, 0, 0.3);
  border-bottom: 1px solid rgba(255, 140, 0, 0.3);
  position: relative;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(250, 204, 21, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* === Galeria Masonry === */
.gallery-grid {
  column-count: 4;
  column-gap: 1rem;
}

.gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease;
  cursor: pointer;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item.hide {
  display: none;
}

.lazy {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.lazy.loaded {
  opacity: 1;
  transform: scale(1);
}

/* === Formulario contacto === */
.contact-form {
  background-color: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.contact-form .form-control,
.contact-form .form-select {
  background-color: #1a1a1a;
  border: 1px solid #333;
  color: var(--text-main);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15);
  background-color: #1a1a1a;
  color: var(--text-main);
}

.contact-form .form-control::placeholder {
  color: #666;
}

.contact-form label {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

/* === Filtros (galeria/tienda) === */
.filter-btn {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 20px;
  padding: 0.4rem 1.2rem;
  transition: all var(--transition);
}

/* === Footer === */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid rgba(255, 140, 0, 0.3);
  padding: 3rem 0 1.5rem;
  color: var(--text-muted);
}

.footer h5 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.footer small {
  color: #555;
}

/* === Toast de contacto === */
.toast-success {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--gold);
  color: #000;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  animation: fadeInUp 0.4s ease;
}

/* === Responsive === */
@media (max-width: 1200px) {
  .hero h1 { font-size: 3rem; }
}

@media (max-width: 992px) {
  .gallery-grid { column-count: 3; }
  .hero { min-height: 70vh; }
  .hero h1 { font-size: 2.5rem; }
  .section-title { font-size: 1.75rem; }
}

@media (max-width: 768px) {
  .gallery-grid { column-count: 2; }
  .hero { min-height: 60vh; padding-top: 70px; }
  .hero h1 { font-size: 2rem; }
  .hero .lead { font-size: 1rem; }
  .section-title { font-size: 1.5rem; }
  .contact-form { padding: 1.5rem; }
  .price { font-size: 1.5rem; }
  .card-img-top { height: 260px; }
  .knight-card img { max-width: 120px; height: 120px; }
}

@media (max-width: 576px) {
  .brand-text { font-size: 0.9rem; }
  .logo { height: 34px; }
  .gallery-grid { column-count: 1; }
  .hero h1 { font-size: 1.75rem; }
  .section-title { font-size: 1.3rem; }
  .knight-card img { max-width: 100px; height: 100px; }
  .knight-card p { font-size: 0.75rem; }
}

/* === Carrito navbar === */
.cart-btn-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cart-badge {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  line-height: 1;
}

/* === Carrito pagina === */
.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-glow);
  text-align: left;
}

.cart-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border-glow);
}

.cart-name {
  color: var(--text-main);
  font-weight: 600;
}

.cart-price {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.05rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-control button {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background var(--transition);
}

.qty-control button:hover {
  background: rgba(250, 204, 21, 0.1);
}

.qty-control span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  color: var(--text-main);
}

.btn-remove {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition);
}

.btn-remove:hover {
  background: rgba(220, 38, 38, 0.15);
}

.cart-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  border-top: 2px solid var(--border-glow);
  margin-top: 0.5rem;
}

.cart-total span:first-child {
  font-size: 1.1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-amount {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

/* === Payment buttons === */
.payment-methods {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.payment-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 2rem;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.payment-btn:hover {
  background: var(--gold);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.3);
}

.payment-btn.paypal {
  border-color: #0070ba;
  color: #0070ba;
}

.payment-btn.paypal:hover {
  background: #0070ba;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 112, 186, 0.3);
}

/* Responsive carrito */
@media (max-width: 768px) {
  .cart-table th:nth-child(1), .cart-table td:nth-child(1) { display: none; }
  .cart-table th, .cart-table td { padding: 0.5rem; font-size: 0.85rem; }
  .cart-thumb { width: 40px; height: 40px; }
  .payment-methods { flex-direction: column; }
  .payment-btn { width: 100%; justify-content: center; }
  .total-amount { font-size: 1.5rem; }
}

/* === Lightbox galeria === */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.lightbox-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-content {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-content img {
  max-width: 92vw;
  max-height: 92vh;
  min-width: 60vw;
  min-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.8);
  background: #000;
  cursor: zoom-in;
}

.lightbox-content img.zoomed {
  min-width: auto;
  min-height: auto;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
}

.lightbox-content.zoom-active {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  cursor: grab;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lightbox-close:hover {
  background: var(--gold);
  color: #000;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lightbox-nav:hover {
  background: var(--gold);
  color: #000;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

@media (max-width: 768px) {
  .lightbox-nav { width: 36px; height: 36px; font-size: 1.2rem; }
  .gallery-item img { height: 200px; }
}

/* === Lupa navbar === */
.nav-search-btn {
  background: transparent;
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: var(--gold);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all var(--transition);
}

.nav-search-btn:hover {
  background: var(--gold);
  color: #000;
}

/* Overlay busqueda desde navbar */
.nav-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}

.nav-search-overlay.show { display: flex; }

.nav-search-overlay form {
  width: 90%;
  max-width: 600px;
  position: relative;
}

.nav-search-overlay input {
  width: 100%;
  padding: 1rem 3rem 1rem 3rem;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 30px;
  color: var(--text-main);
  font-size: 1.1rem;
  outline: none;
  box-shadow: 0 8px 40px rgba(250, 204, 21, 0.2);
}

.nav-search-overlay .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
}

.nav-search-overlay .close-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
}

.nav-search-overlay .hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 1rem;
}

/* === Buscador tienda === */
.search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-wrap input[type="search"] {
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 30px;
  color: var(--text-main);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all var(--transition);
  outline: none;
}

.search-wrap input[type="search"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15);
  background: var(--bg-card-hover);
}

.search-wrap input[type="search"]::placeholder {
  color: var(--text-muted);
}

.search-wrap input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-wrap .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
}

.search-wrap .search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  transition: color var(--transition);
}

.search-wrap .search-clear:hover {
  color: var(--gold);
}

/* Resaltar coincidencias */
.search-hit {
  background: rgba(250, 204, 21, 0.25);
  color: var(--gold);
  padding: 0 2px;
  border-radius: 2px;
}

/* === Tracker pixel === */
.trk-pixel { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
