/* =========================
   🌞 SMCREACIONES FRONTEND CLARO
   ========================= */

:root {
  --bg-main: #f5f7fa;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-2: #38bdf8;
  --success: #16a34a;
  --danger: #dc2626;
  --border-soft: rgba(0,0,0,0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

/* =========================
   HEADER
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  transition: 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

/* =========================
   LAYOUT
   ========================= */

.container {
  max-width: 1200px;
  margin: auto;
  padding: 30px 20px;
}

/* =========================
   GRID PRODUCTOS
   ========================= */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 26px;
}

.product-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  transition: 0.25s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f1f5f9;
}

.product-body {
  padding: 14px;
}

.product-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

/* =========================
   BADGES
   ========================= */

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: 600;
  color: white;
}

.badge.new { background: var(--accent); }
.badge.sale { background: var(--danger); }
.badge.low { background: #f59e0b; }

/* =========================
   PRODUCT PAGE
   ========================= */

.product-page {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

.product-gallery {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-soft);
}

.main-image {
  width: 100%;
  border-radius: 14px;
}

.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.thumb {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
}

.thumb:hover {
  border-color: var(--accent);
}

.product-info h1 {
  margin-top: 0;
  font-size: 26px;
}

.price-big {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin: 10px 0;
}

.stock-ok { color: var(--success); font-weight: 600; }
.stock-low { color: #f59e0b; font-weight: 600; }
.stock-out { color: var(--danger); font-weight: 600; }

.description {
  color: var(--text-muted);
  line-height: 1.6;
}

/* =========================
   BOTÓN WHATSAPP
   ========================= */

.btn-whatsapp {
  display: inline-block;
  margin-top: 18px;
  background: #25d366;
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.25s;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37,211,102,0.35);
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {
  .product-page {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 14px;
  }
}

.thumb.active {
  border-color: var(--accent);
  transform: scale(1.05);
}

/* =========================
   🔍 ZOOM PRO
========================= */

.product-gallery {
  overflow: hidden;
  border-radius: 18px;
}

.main-image {
  width: 100%;
  border-radius: 18px;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

/* Hover elegante */
.main-image:hover {
  transform: scale(1.08);
}

.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  cursor: zoom-out;
}

.zoom-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 16px;
  animation: zoomIn 0.25s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.main-image:hover {
  transform: scale(1.05);
}

h2 {
  font-size: 20px;
  font-weight: 700;
}

/* =========================
   🎠 RELACIONADOS PRO
========================= */

.related-section {
  margin-top: 55px;
}

.related-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.related-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.related-carousel::-webkit-scrollbar {
  height: 6px;
}

.related-carousel::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 20px;
}

/* CARD */
.related-card {
  min-width: 190px;
  background: white;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-soft);
  scroll-snap-align: start;
  transition: 0.25s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.related-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

/* INFO */
.related-info {
  padding: 10px;
}

.related-title {
  font-size: 13px;
  margin-bottom: 4px;
}

.related-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* =========================
   🏷 BADGES PRO
========================= */

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.badge {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 20px;
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}

/* Variantes */
.badge.featured {
  background: linear-gradient(135deg,#f59e0b,#f97316);
}

.badge.sale {
  background: linear-gradient(135deg,#ef4444,#dc2626);
}

.badge.new {
  background: linear-gradient(135deg,#2563eb,#38bdf8);
}

.badge.lowstock {
  background: linear-gradient(135deg,#0ea5e9,#0284c7);
}

/* =========================
   💰 PRECIO OFERTA PRO
========================= */

.price-box {
  margin-top: 6px;
}

.old-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-offer {
  font-size: 18px;
  font-weight: 800;
  color: #dc2626;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.product-body {
  padding: 12px;
}

.product-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.price-box {
  margin-top: 4px;
}

.old-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-offer {
  font-size: 17px;
  font-weight: 800;
  color: #dc2626;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}


/* =========================
   😈 HOVER PREMIUM PRO
========================= */

.product-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  transition: 
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

/* Elevación suave */
.product-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Zoom suave */
.product-card:hover .product-image {
  transform: scale(1.08);
}

.badge {
  transition: 
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Badge vivo */
.product-card:hover .badge {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.product-card:hover .price-offer,
.product-card:hover .product-price {
  transform: scale(1.05);
}

.price-offer,
.product-price {
  transition: transform 0.25s ease;
}

.product-card:hover {
  box-shadow: 
    0 18px 40px rgba(0,0,0,0.10),
    0 0 0 1px rgba(37,99,235,0.15);
}

/* =========================
   ✨ ENTRADA PREMIUM PRO
========================= */

.product-card {
  opacity: 1;
  transform: none;
  will-change: transform, opacity;
}

/* Solo cuando animamos */
.products-grid.animate .product-card {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: cardIn 0.5s cubic-bezier(.22,.61,.36,1) forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}



.products-grid.animate .product-card:nth-child(1) { animation-delay: 0.05s; }
.products-grid.animate .product-card:nth-child(2) { animation-delay: 0.1s; }
.products-grid.animate .product-card:nth-child(3) { animation-delay: 0.15s; }



.product-card {
  will-change: transform, opacity;
}

/* =========================
   🧊 SKELETON LOADING PRO
========================= */

.skeleton-card {
  background: white;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f1f5f9 37%,
    #e5e7eb 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-text {
  height: 12px;
  margin-top: 10px;
  border-radius: 6px;
  background: #e5e7eb;
}

.skeleton-price {
  height: 14px;
  width: 60%;
  margin-top: 8px;
  border-radius: 6px;
  background: #cbd5f5;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

#realGrid {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* =========================
   🎬 PAGE TRANSITION PRO
========================= */

body {
  opacity: 1;
  transition: opacity 0.35s ease;
}

body.fade-out {
  opacity: 0;
}


body {
  opacity: 1;
  transform: translateY(0);
  transition: 
    opacity 0.35s ease,
    transform 0.35s ease;
}

body.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.category-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0 25px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  font-size: 13px;
  color: var(--text-muted);
  transition: 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* =========================
   🔎 LIVE SEARCH PRO
========================= */

.search-box {
  margin: 10px 0 20px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.product-card {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* =========================
   🧊 SKELETON LOADING PRO
========================= */

.skeleton-card {
  background: white;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f1f5f9 37%,
    #e5e7eb 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.skeleton-line {
  height: 12px;
  margin-top: 10px;
  border-radius: 6px;
  background: #e5e7eb;
}

.skeleton-price {
  height: 14px;
  width: 60%;
  margin-top: 8px;
  border-radius: 6px;
  background: #cbd5f5;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Grid real oculto inicialmente */
#realGrid {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* =========================
   💬 CONTACTO PRO
========================= */

.contact-card {
  max-width: 520px;
  margin: auto;
  background: white;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.contact-card h1 {
  margin-top: 0;
}

.contact-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Botón principal */
.btn-primary {
  width: 100%;
  margin-top: 6px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

.contact-alt {
  margin: 18px 0 10px;
  font-size: 13px;
  text-align: center;
  color: var(--text-muted);
}

/* =========================
   💬 WHATSAPP FLOAT PRO
========================= */

.wa-float {
  position: fixed;
  bottom: 22px;
  right: 22px;

  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;
  text-decoration: none;

  background: #25d366;
  color: white;

  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(37,211,102,0.35);

  z-index: 999;
  transition: 0.3s ease;
}

/* Hover premium */
.wa-float:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 14px 35px rgba(37,211,102,0.55);
}

.wa-float {
  animation: waPulse 2.8s infinite;
}

@keyframes waPulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.45); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

.wa-float span {
  font-size: 12px;
  margin-left: 6px;
}

/* =========================
   💬 WHATSAPP FLOAT PRO
========================= */

.wa-float {
  position: fixed;
  bottom: 22px;
  right: 22px;

  width: 60px;
  height: 60px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #25d366;
  color: white;

  border-radius: 50%;
  text-decoration: none;

  box-shadow: 0 10px 25px rgba(37,211,102,0.35);
  z-index: 999;

  transition: 0.3s ease;
}

/* Ícono */
.wa-icon {
  width: 28px;
  height: 28px;
}

/* Hover */
.wa-float:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 14px 35px rgba(37,211,102,0.55);
}

/* Pulso suave */
.wa-float {
  animation: waPulse 2.8s infinite;
}

@keyframes waPulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.45); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* =========================
   🛒 CART BUTTON
========================= */

.cart-button {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 30px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s;
}

.cart-button:hover {
  background: var(--accent);
  color: white;
}

/* =========================
   🛒 DRAWER
========================= */

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  height: 100%;
  background: white;
  box-shadow: -10px 0 35px rgba(0,0,0,0.12);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: 0.35s ease;
}

.cart-drawer.open {
  right: 0;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: none;
}

.cart-overlay.show {
  display: block;
}

/* Header */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
}

/* Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.cart-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 13px;
  font-weight: 600;
}

.cart-item-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

/* Footer */
.cart-footer {
  padding: 18px;
  border-top: 1px solid var(--border-soft);
}

.btn-whatsapp-cart {
  display: block;
  margin-top: 10px;
  background: #25d366;
  color: white;
  text-align: center;
  padding: 12px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
}

/* =========================
   🛒 BOTÓN CARRITO PRO
========================= */

.btn-cart {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  padding: 14px 26px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px rgba(37,99,235,0.25);
}

/* Hover elegante */
.btn-cart:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px rgba(37,99,235,0.35);
}

/* Click */
.btn-cart:active {
  transform: scale(0.97);
}

.btn-cart {
  position: relative;
  overflow: hidden;
}

.btn-cart::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.35),
    transparent 70%
  );
  transform: translateX(-100%);
  transition: 0.6s;
}

.btn-cart:hover::after {
  transform: translateX(100%);
}

.btn-checkout {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(34,197,94,0.35);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cart-qty button {
  border: none;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.cart-qty span {
  font-size: 13px;
  font-weight: 600;
}

.cart-qty .remove {
  background: #fee2e2;
  color: #dc2626;
}

.cart-footer {
  padding: 18px;
  border-top: 1px solid var(--border-soft);
  background: white;
  position: sticky;
  bottom: 0;
}

.cart-shipping {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.cart-shipping input {
  margin-right: 6px;
}

.cart-shipping-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-shipping-box label {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-shipping-box .input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}