/* ===================================================
   1. CONFIGURACIÓN BASE Y RESET
   =================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #f8f9fa;
  color: #333333;
  padding-bottom: 75px;
}

/* ===================================================
   2. ENCABEZADO Y NAVEGACIÓN SUPERIOR
   =================================================== */
.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.logo a {
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-bold { color: #1a3b70; }
.logo-red { color: #e62117; }

.icon-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #2b2b2b;
  cursor: pointer;
  position: relative;
  padding: 4px;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  background-color: #1a3b70;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: bold;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================================
   3. DROPDOWN DE USUARIO
   =================================================== */
.user-dropdown-container {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 35px;
  background: #ffffff;
  min-width: 170px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  z-index: 200;
}

.dropdown-menu.active {
  display: flex;
  flex-direction: column;
}

.dropdown-menu a {
  padding: 10px 14px;
  color: #444;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-menu a:hover {
  background-color: #f0f4f8;
}

/* ===================================================
   4. BARRA DE BÚSQUEDA
   =================================================== */
.search-bar-container {
  padding: 0 16px 12px 16px;
}

.search-bar {
  display: flex;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
}

.category-select {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #555;
  outline: none;
  border-right: 1px solid #e0e0e0;
  max-width: 115px;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 8px 10px;
  font-size: 0.82rem;
  outline: none;
  background: transparent;
}

.search-submit {
  border: none;
  background: #23272d;
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
}

/* ===================================================
   5. BANNER HERO Y PROMOCIONES
   =================================================== */
.hero-slider {
  margin: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5ecd5 0%, #fae1c3 100%);
  padding: 24px 18px;
  border: 1px solid #eed6b3;
}

.badge-promo {
  background: #ffcc00;
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.slide-content h2 {
  font-size: 1.25rem;
  margin: 8px 0;
  color: #1a1a1a;
}

.slide-content p {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 14px;
}

.btn-primary {
  display: inline-block;
  background-color: #1e4bb5;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* ===================================================
   6. SECCIONES Y CATEGORÍAS
   =================================================== */
.section {
  padding: 12px 16px;
}

.section-title {
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cat-card {
  background: #f1f3f5;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.cat-img-box img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
}

.cat-card h3 {
  font-size: 0.95rem;
  color: #222;
}

.cat-card span {
  font-size: 0.75rem;
  color: #777;
}

/* BANNER SECUNDARIO */
.promo-banner {
  margin: 12px 16px;
  background: #2a2a2a;
  color: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.promo-banner h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

/* ===================================================
   7. LISTADO DE PRODUCTOS
   =================================================== */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  display: flex;
  padding: 12px;
  gap: 12px;
  align-items: center;
}

.prod-img {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.prod-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prod-info {
  flex: 1;
}

.prod-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.2;
}

.prod-price {
  font-size: 1rem;
  font-weight: 800;
  color: #1a3b70;
  margin-bottom: 8px;
}

.prod-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control {
  display: flex;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  background: #f5f5f5;
  border: none;
  width: 26px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
}

.qty-input {
  width: 32px;
  text-align: center;
  border: none;
  outline: none;
  font-size: 0.8rem;
  font-weight: bold;
}

.btn-cart {
  background: #0099ff;
  color: #ffffff;
  border: none;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ===================================================
   8. MENÚ LATERAL DESLIZANTE (DRAWER) Y OVERLAY
   =================================================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background-color: #ffffff;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px;
}

.icon-btn-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #555;
  cursor: pointer;
}

.drawer-item {
  border-bottom: 1px solid #f0f0f0;
}

.drawer-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
}

.drawer-item-header .toggle-icon {
  font-size: 0.75rem;
  color: #888;
  transition: transform 0.25s ease;
}

.drawer-item.active .toggle-icon {
  transform: rotate(180deg);
}

.subcat-list {
  display: none;
  list-style: none;
  background: #fdfdfd;
  padding: 4px 0 8px 30px;
}

.drawer-item.active .subcat-list {
  display: block;
}

.subcat-list li {
  padding: 6px 0;
}

.subcat-list li a {
  text-decoration: none;
  color: #666;
  font-size: 0.88rem;
}

.drawer-cta {
  padding: 20px 18px 12px 18px;
}

.btn-zones {
  width: 100%;
  background-color: #1e3a8a;
  color: #ffffff;
  border: none;
  border-radius: 25px;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.drawer-footer-contact {
  padding: 16px 20px 24px 20px;
  font-size: 0.82rem;
  color: #666;
}

.drawer-footer-contact p {
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===================================================
   9. MODAL DE TARIFAS DE ENVÍO
   =================================================== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 450px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 1002;
  display: none;
  opacity: 0;
  transition: all 0.25s ease;
  overflow: hidden;
}

.modal.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 0.95rem;
  color: #222;
}

.modal-body {
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.zone-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.zone-badge {
  display: inline-block;
  background: #1e3a8a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.zone-desc {
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 8px;
}

.rate-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 4px 0;
  border-top: 1px dashed #eee;
}

.rate-row.highlight { font-weight: bold; }
.free-ship { color: #16a34a; }

/* ===================================================
   10. PIE DE PÁGINA (FOOTER) Y ACORDEÓN
   =================================================== */
.footer {
  background: #fbf7f0;
  padding: 24px 16px 12px 16px;
  border-top: 1px solid #ede7db;
  margin-top: 24px;
}

.footer-brand h3 {
  font-size: 1rem;
  color: #1a3b70;
  font-weight: 800;
}

.footer-brand .rif {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 16px;
}

.contact-block { margin-bottom: 18px; }
.contact-block h4 { font-size: 0.85rem; margin-bottom: 6px; }
.contact-block p { font-size: 0.95rem; font-weight: bold; margin: 4px 0; }
.contact-block small { font-size: 0.75rem; color: #666; }

.text-green { color: #25d366; }
.text-blue { color: #0066cc; }

.accordion-item { border-bottom: 1px solid #e0dbce; }

.accordion-header {
  width: 100%;
  background: none;
  border: none;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
  cursor: pointer;
}

.accordion-body {
  display: none;
  padding-bottom: 10px;
  flex-direction: column;
  gap: 8px;
}

.accordion-body.open { display: flex; }

.accordion-body a {
  text-decoration: none;
  color: #666;
  font-size: 0.8rem;
}

.footer-bottom {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  margin-top: 20px;
  border-top: 1px solid #ede7db;
  padding-top: 12px;
}

/* ===================================================
   11. BOTONES FLOTANTES
   =================================================== */
.back-to-top {
  position: fixed;
  bottom: 75px;
  right: 16px;
  background: #2b2b2b;
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
}

.floating-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 16px;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 95;
  font-size: 1rem;
  font-weight: bold;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  font-size: 0.75rem;
  color: #444;
}

.btn-cookie {
  align-self: flex-end;
  background: #1a3b70;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}
