:root {
  --azul-marino: #0b2545;
  --azul-claro: #133c6b;
  --naranja: #f47c20;
  --naranja-oscuro: #d1620b;
  --gris-fondo: #f8f9fa;
  --blanco: #ffffff;
  --texto-oscuro: #2c3e50;
  --sombra: 0 8px 30px rgba(0, 0, 0, 0.08);
  --header-h: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--texto-oscuro);
  background: var(--gris-fondo);
  line-height: 1.6;
  overflow-x: hidden;
}

/*  REDES SOCIALES FLOTANTES*/
.social-sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 0 15px rgba(0,0,0,0.1);
  overflow: hidden;
}

.social-icon {
  padding: 14px 16px;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--azul-marino);
  text-align: center;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  border-bottom: 1px solid #eee;
}

.social-icon:last-child { border-bottom: none; }
.social-icon:hover { background: var(--azul-marino); color: var(--blanco); }

/* ===== BOTÓN FLOTANTE WHATSAPP ===== */
.floating-whatsapp {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #25d366;
  color: var(--blanco);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 250;
  transition: transform 0.3s, background 0.3s;
}

.floating-whatsapp:hover {
  transform: scale(1.1) translateY(-5px);
  background: #1eb955;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  background: var(--azul-marino);
  color: var(--blanco);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-height: var(--header-h);
}


.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  max-height: 80px; 
  width: auto;
  object-fit: contain;
}

.logo-fallback {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-tfdigital {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  font-style: italic;
  color: var(--blanco);
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--naranja);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--blanco);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--naranja); }

.cart-btn {
  background: var(--naranja);
  color: var(--blanco);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.2s;
}

.cart-btn:hover { background: var(--naranja-oscuro); transform: translateY(-2px); }

.badge {
  background: var(--blanco);
  color: var(--naranja);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== HERO ANIMADO ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 6rem 1.5rem;
  background: linear-gradient(135deg, var(--azul-marino) 0%, var(--azul-claro) 100%);
  color: var(--blanco);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(244, 124, 32, 0.15) 0%, transparent 60%);
  animation: rotateBg 20s linear infinite;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 1.2rem;
  line-height: 1.1;
  font-weight: 800;
}

.highlight { color: var(--naranja); }

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 2rem;
  color: #d1d9e6;
}

.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rotateBg {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-primary {
  display: inline-block;
  background: var(--naranja);
  color: var(--blanco);
  padding: 0.9rem 2.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 15px rgba(244, 124, 32, 0.4);
}

.btn-primary:hover {
  background: var(--naranja-oscuro);
  transform: translateY(-3px);
}

/* ===== CATÁLOGO ===== */
.catalogo {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.catalogo h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  text-align: center;
  color: var(--azul-marino);
}

/* ===== FILTROS ===== */
.filtros {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.buscador {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.buscador input {
  width: 100%;
  padding: 1rem 3rem;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 1rem;
  background: var(--blanco);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--sombra);
}

.buscador input:focus {
  border-color: var(--naranja);
  box-shadow: 0 0 0 4px rgba(244, 124, 32, 0.15);
}

.icono-buscar { 
  position: absolute; 
  left: 1.2rem; 
  font-size: 1.1rem; 
  color: #999;
}

.limpiar {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  display: none;
  padding: 0.5rem;
  transition: color 0.2s;
}
.limpiar:hover { color: var(--naranja); }
.limpiar.visible { display: block; }

.categorias {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.cat-btn {
  background: var(--blanco);
  border: 2px solid #e0e0e0;
  color: var(--texto-oscuro);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-btn:hover { border-color: var(--naranja); color: var(--naranja); }

.cat-btn.activo {
  background: var(--azul-marino);
  border-color: var(--azul-marino);
  color: var(--blanco);
}

.resultados {
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 2rem;
}

/* ===== GRID & CARDS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--blanco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  animation: aparecer 0.4s ease;
}

.card:hover { transform: translateY(-6px); }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--gris-fondo);
}

.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.card-categoria {
  display: inline-block;
  background: #fff3e0;
  color: var(--naranja-oscuro);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.card-body h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--azul-marino);
}

.detalles-lista {
  list-style: none;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.detalles-lista li { margin-bottom: 0.2rem; }
.detalles-lista strong { color: var(--texto-oscuro); }

.card-body .price {
  color: var(--azul-marino);
  font-weight: 800;
  font-size: 1.2rem;
  margin-top: auto;
}

.add-btn {
  background: var(--naranja);
  color: var(--blanco);
  border: none;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.add-btn:hover { background: var(--naranja-oscuro); }

/* ===== SIN RESULTADOS ===== */
.sin-resultados { text-align: center; padding: 4rem 1rem; }
.sin-resultados p { font-size: 1.2rem; color: #888; margin-bottom: 1.5rem; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--blanco);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 2px solid var(--gris-fondo);
  background: var(--azul-marino);
  color: var(--blanco);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--blanco);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.close-btn:hover { background: rgba(255,255,255,0.1); }

.modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info h4 { font-size: 0.95rem; color: var(--azul-marino); }
.cart-item .info p { font-size: 0.8rem; color: #777; }

.qty-controls { display: flex; align-items: center; gap: 0.5rem; }

.qty-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: var(--blanco);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  color: var(--azul-marino);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.qty-controls button:hover { border-color: var(--naranja); color: var(--naranja); }
.qty-controls span { font-weight: 700; min-width: 30px; text-align: center; }

.remove-btn {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  transition: color 0.2s;
}
.remove-btn:hover { color: #c0392b; }

.empty-cart { text-align: center; color: #888; padding: 3rem 0; font-size: 1.1rem; }

.modal-footer {
  padding: 1.2rem 1.5rem;
  border-top: 2px solid var(--gris-fondo);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fafafa;
}

.total { font-weight: 800; font-size: 1.2rem; text-align: right; color: var(--azul-marino); }

.btn-whatsapp {
  background: #25d366;
  color: var(--blanco);
  border: none;
  padding: 1rem;
  border-radius: 30px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
}
.btn-whatsapp:hover { background: #1eb955; }

/* ===== FOOTER ===== */
.footer {
  background: var(--azul-marino);
  color: #a0b2c6;
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
}

.footer-col h3, .footer-col h4 {
  color: var(--blanco);
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 1.2rem;
}

.footer-col h3 { font-size: 1.5rem; font-weight: 800; }
.footer-col h4 { font-size: 1.1rem; font-weight: 600; }

.footer-col p { font-size: 0.95rem; line-height: 1.6; }

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.footer-col ul li i {
  color: var(--naranja);
  font-size: 1.1rem;
  margin-top: 3px;
}

/* Iconos de Redes Sociales en el Footer */
.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--blanco);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.3rem;
  transition: all 0.3s;
}

.footer-socials a:hover {
  background: var(--naranja);
  color: var(--blanco);
  transform: translateY(-3px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--azul-marino);
  color: var(--blanco);
  padding: 1rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-left: 5px solid var(--naranja);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
}

.toast.toast-out { animation: toastOut 0.3s ease forwards; }
.toast-icono { font-size: 1.4rem; }
.toast-texto strong { display: block; font-size: 1rem; }
.toast-texto small { color: #cbd5e1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  
  .header { padding: 0.5rem 1rem; }
  .logo-img { max-height: 50px; }
  .logo-nikmat { font-size: 1.3rem; }
  .logo-sub { font-size: 0.6rem; }
  
  .nav { gap: 0.8rem; }
  .nav-link { display: none; }
  .cart-label { display: none; }
  .cart-btn { padding: 0.5rem 0.8rem; }

  /* Ajuste del botón flotante en móviles */
  .floating-whatsapp {
    bottom: 1.5rem; /* Lo mantenemos abajo, pero no tapa el footer */
    right: 1rem;
    width: 55px;
    height: 55px;
    font-size: 1.8rem;
  }
  
  .hero { padding: 4rem 1rem 6rem 1rem; }
  
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .card img { height: 160px; }
  .card-body { padding: 0.8rem; gap: 0.4rem; }
  .card-body h3 { font-size: 0.9rem; }
  .detalles-lista { font-size: 0.75rem; }
  .add-btn { padding: 0.6rem; font-size: 0.8rem; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 90vh; padding-bottom: env(safe-area-inset-bottom); }
  
  .toast-container { bottom: 80px; right: 1rem; left: 1rem; }
  .toast { width: 100%; }

  /* Ajustes del Footer en Móviles */
  .footer { padding: 3rem 1.5rem 6rem; /* Espacio extra abajo para que el botón de WhatsApp no tape texto */ }
  .footer-container { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .footer-col ul li { justify-content: center; }
  .footer-socials { justify-content: center; }
}