/* ==========================================================================
   SANTERÍA EL MILAGRO - ESTILOS OFICIALES TIENDA ONLINE
   Paleta: Primario #ffe164 | Texto #000000 | Fondo #ffffff & #f5f5f5
   Tipografía: Kanit (Headings/Buttons) | Rubik (Body/Inputs)
   ========================================================================== */

:root {
  --primary: #ffe164;
  --primary-hover: #ffd933;
  --primary-contrast: #000000;
  --text-dark: #111111;
  --text-muted: #666666;
  --bg-light: #f8f9fa;
  --bg-card: #ffffff;
  --border-color: #e5e5e5;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 30px;
  --radius-large: 40px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: all 0.25s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rubik', sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading, .btn {
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-dark);
}

/* ==========================================================================
   UTILIDADES & BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background-color: transparent;
  border-color: #000000;
  color: #000000;
}

.btn-outline:hover {
  background-color: #000000;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-contrast);
}

.badge-dark {
  background-color: #000000;
  color: #ffffff;
}

.badge-danger {
  background-color: #e63946;
  color: #ffffff;
}

/* ==========================================================================
   BARRA SUPERIOR DE ANUNCIOS
   ========================================================================== */
.top-bar {
  background-color: #000000;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: var(--primary);
}

/* ==========================================================================
   ENCABEZADO / HEADER
   ========================================================================== */
.main-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-logo img {
  height: 52px;
  display: block;
  object-fit: contain;
}

.header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 18px 10px 42px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-family: 'Rubik', sans-serif;
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(255, 225, 100, 0.5);
}

.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.header-action-btn:hover {
  background-color: var(--bg-light);
}

.cart-btn {
  position: relative;
  background-color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.cart-qty {
  background-color: #000000;
  color: #ffffff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ==========================================================================
   NAVEGACIÓN POR CATEGORÍAS
   ========================================================================== */
.categories-nav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
}

.categories-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  gap: 8px;
  list-style: none;
}

.category-nav-item a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: #333333;
  transition: var(--transition);
  background-color: #f5f5f5;
}

.category-nav-item a:hover,
.category-nav-item.active a {
  background-color: var(--primary);
  color: #000000;
}

/* ==========================================================================
   HERO / BANNER CAROUSEL
   ========================================================================== */
.hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: #000000;
}

.hero-slide {
  display: none;
  width: 100%;
  position: relative;
}

.hero-slide.active {
  display: block;
  animation: fadeIn 0.6s ease-in-out;
}

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

.hero-slide img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--primary);
  width: 28px;
  border-radius: 8px;
}

/* ==========================================================================
   BARRAS INFORMATIVAS DE CONFIANZA
   ========================================================================== */
.trust-bar {
  background-color: #f7f7f7;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 20px;
}

.trust-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  text-align: center;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.trust-icon {
  font-size: 1.8rem;
  color: #000000;
  margin-bottom: 4px;
}

.trust-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.trust-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   GRILLAS DE CATEGORÍAS DESTACADAS
   ========================================================================== */
.category-pills-section {
  background-color: var(--primary);
  padding: 30px 20px;
  text-align: center;
}

.category-pills-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  color: #000000;
}

.category-pills-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.category-pill-btn {
  background-color: #ffffff;
  color: #000000;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: var(--transition);
}

.category-pill-btn:hover {
  background-color: #000000;
  color: #ffffff;
  transform: translateY(-2px);
}

/* ==========================================================================
   SECCIONES Y TARJETAS DE PRODUCTOS
   ========================================================================== */
.products-section {
  padding: 50px 20px;
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cccccc;
}

.product-card-media {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background-color: #fdfdfd;
  overflow: hidden;
}

.product-card-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}

.product-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 12px;
}

.price-current {
  font-size: 1.35rem;
  font-weight: 700;
  color: #000000;
}

.price-compare {
  font-size: 0.9rem;
  text-decoration: line-through;
  color: #999999;
}

.product-card-actions {
  display: flex;
  gap: 8px;
}

.product-card-actions .btn {
  flex: 1;
}

/* ==========================================================================
   CARRITO OFFCANVAS LATERAL
   ========================================================================== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: #ffffff;
  z-index: 2001;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f8f8f8;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #000000;
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.qty-val {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background-color: #fafafa;
}

.cart-promos-banner {
  background-color: #fff9db;
  border: 1px solid #ffe164;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 14px;
}

.cart-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
}

.cart-total-final {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000000;
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}

/* ==========================================
   MODALES (CHECKOUT, LOGIN, REGISTRO, ETC.)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-family: 'Rubik', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.form-control:focus {
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(255, 225, 100, 0.5);
}

/* ==========================================================================
   BOTÓN FLOTANTE DE WHATSAPP
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #25d366;
  color: #ffffff;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: var(--transition);
}

.whatsapp-float:hover {
  transform: scale(1.1);
  color: #ffffff;
}

/* ==========================================================================
   PIE DE PÁGINA / FOOTER
   ========================================================================== */
.main-footer {
  background-color: #000000;
  color: #ffffff;
  padding: 50px 20px 20px 20px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 36px;
  margin-bottom: 40px;
}

.footer-col h5 {
  color: var(--primary);
  font-size: 1.15rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

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

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid #222222;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #888888;
}

/* Responsive */
@media (max-width: 768px) {
  .header-search {
    display: none;
  }
  .top-bar {
    text-align: center;
    justify-content: center;
  }
  .top-bar .top-bar-right {
    display: none;
  }
  .hero-slide img {
    max-height: 260px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card-body {
    padding: 10px;
  }
  .product-card-title {
    font-size: 0.88rem;
    min-height: 36px;
  }
  .price-current {
    font-size: 1.1rem;
  }
}
