/* =============================================
   WEP World Electronic's Perú — style.css
   ============================================= */

/* BARRA DE ENVÍOS */
.barra-envios {
  background: #e8edf5;
  border-bottom: 1px solid #c8d3e3;
  padding: 7px 0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.barra-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.barra-frase { color: #5a7a9e; font-style: italic; white-space: nowrap; }
.barra-pill  { border-radius: 20px; padding: 3px 14px; white-space: nowrap; }
.barra-sep   { color: #c8d3e3; }
.barra-verde { background: #a8d5b8; color: #2d5a3d; }
.barra-azul  { background: #b8cce8; color: #2f3f55; }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.barra-track {
  display: none;
  white-space: nowrap;
  animation: ticker 22s linear infinite;
}

.barra-track span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-right: 48px;
}

@media (max-width: 768px) {
  .barra-inner { display: none; }
  .barra-track { display: inline-block; }
}

@media (max-width: 768px) {
  .barra-envios {
    font-size: 11px;
    gap: 6px;
    padding: 6px 8px;
  }
  .barra-frase {
    white-space: normal;
    text-align: center;
  }
}

/* BASE */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: relative;
  height: 260px;
  overflow: visible;
}

.banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-content {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
}

.logo img {
  width: 110px;
  background: white;
  padding: 6px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s ease, filter .35s ease;
}

.logo img:hover {
  transform: scale(1.12) rotate(-4deg);
  box-shadow: 0 8px 24px rgba(26,79,163,.35);
  filter: brightness(1.08);
}

.logo img:active {
  transform: scale(.92) rotate(0deg);
  box-shadow: 0 2px 8px rgba(26,79,163,.2);
  filter: brightness(.96);
}

.titulo-logo {
  text-align: center;
  flex: 1;
}

.titulo-principal {
  font-size: 34px;
  font-weight: 900;
  color: #1a4fa3;
}

.titulo-sub {
  letter-spacing: 6px;
  color: #1a4fa3;
}

.info {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

.info a {
  color: #3ded97;
  text-decoration: none;
}

/* =============================================
   BUSCADOR
   ============================================= */
.buscador-container {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  max-width: 650px;
  z-index: 9999;
}

.buscador-fondo {
  position: relative;
  background: #c7c9cc;
  border-radius: 50px;
  box-shadow: 0 6px 15px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

#buscar {
  width: 100%;
  padding: 10px 35px 10px 16px;
  border: none;
  outline: none;
  border-radius: 40px;
  background: #fff;
  font-size: 14px;
  display: block;
  box-sizing: border-box;
}

#clearBtn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: none;
  font-weight: bold;
}

/* =============================================
   SUGERENCIAS
   ============================================= */
#sugerencias {
  position: absolute;
  top: 65px;
  width: 100%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
  display: none;
  z-index: 999999;
  overflow: hidden;
}

.sugerencia {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  cursor: pointer;
  transition: .25s;
  border-bottom: 1px solid #f1f5f9;
}

.sugerencia:last-child {
  border-bottom: none;
}

.sugerencia img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #f8fafc;
  padding: 6px;
  border-radius: 12px;
}

.sugerencia:hover {
  background: #f1f5f9;
  transform: scale(1.01);
}

/* =============================================
   MARCAS
   ============================================= */
.marcas-wrapper,
.categorias-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  color: #1f2937;
  line-height: 1;
}

.scroll-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.12);
}

.scroll-arrow.left  { left: 6px; }
.scroll-arrow.right { right: 6px; }

.scroll-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.marcas {
  background: #a9b8c7;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 14px 44px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}

.marcas::-webkit-scrollbar {
  display: none;
}

.marca-card {
  background: #fff;
  border-radius: 16px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: .25s;
  font-weight: bold;
  flex: 0 0 auto;
}

.marca-card img {
  height: 26px;
  object-fit: contain;
}

.marca-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  background: #e2e8f0;
}

.marca-card.activa {
  background: #2f3f55;
  color: white;
}

/* =============================================
   CATEGORÍAS
   ============================================= */
.categorias {
  background: #6f9ec0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 12px 44px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}

.categorias::-webkit-scrollbar {
  display: none;
}

.categorias button {
  background: #fff;
  border: 2px solid #1f2937;
  border-radius: 25px;
  padding: 8px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: .25s;
  flex: 0 0 auto;
  white-space: nowrap;
}

.categorias button:hover,
.categorias button.activo {
  background: #1f2937;
  color: #fff;
  transform: scale(1.05);
}

/* =============================================
   GRID DE PRODUCTOS
   ============================================= */
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  padding: 20px;
}

/* =============================================
   CARD
   ============================================= */
.card {
  background: white;
  padding: 15px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  transition: all .25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(0,0,0,.15);
}

.card-img img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  transition: transform .3s ease;
}

.card:hover img {
  transform: scale(1.08);
}

.precio {
  color: #007BFF;
  font-weight: bold;
  margin: 10px 0;
}

/* =============================================
   BOTONES
   ============================================= */
.btn-detalle {
  width: 100%;
  background: #1e3a8a;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform .2s;
}

.btn-wsp {
  width: 100%;
  background: #25D366;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.btn-detalle:hover {
  transform: scale(1.05);
}

.btn-wsp:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

/* =============================================
   PAGINACIÓN — grupos de 5 con flechas
   ============================================= */
#paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  margin: 4px 0 10px;
  flex-wrap: nowrap;
}

#paginacion button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 20px;
  background: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}

#paginacion button:hover {
  background: #cbd5e1;
  transform: scale(1.08);
}

#paginacion button.activo {
  background: #25D366;
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 4px 10px rgba(37,211,102,.35);
}

#paginacion button.flecha {
  background: #1e3a8a;
  color: #fff;
  font-size: 16px;
  min-width: 36px;
}

#paginacion button.flecha:disabled {
  background: #cbd5e1;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* =============================================
   MAPA Y FOOTER
   ============================================= */
.mapa-footer {
  margin-top: 20px;
}

.mapa-footer iframe {
  width: 96%;
  margin: auto;
  display: block;
  height: 220px;
  border-radius: 20px;
  border: none;
}

.footer {
  background: #111;
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 20px;
}

.footer a {
  color: #3ded97;
  text-decoration: none;
  font-weight: bold;
}

/* =============================================
   WHATSAPP FLOTANTE
   ============================================= */
.wsp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  padding: 12px 18px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  z-index: 999999;
}

/* =============================================
   MODAL
   ============================================= */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.6);
  z-index: 999999;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.modal-inner {
  min-height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 20px;
  width: 100%;
  max-width: 860px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fadeIn .3s ease;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.modal-content h3 {
  margin-top: 10px;
  margin-bottom: 5px;
  color: #111827;
}

.modal-content ul {
  margin-bottom: 12px;
}

.modal-content li {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.precio-modal {
  font-size: 30px;
  font-weight: 900;
  color: #16a34a;
}

.precio-modal small {
  font-size: 16px;
  color: #6b7280;
  margin-right: 4px;
}

/* =============================================
   MODAL GRID (interior)
   ============================================= */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 25px;
  align-items: start;
}

.modal-img-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-img-principal {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: auto;
}

.modal-miniaturas {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-miniatura {
  width: 55px;
  height: 55px;
  object-fit: contain;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  padding: 4px;
  background: #fff;
}

.modal-info-col {
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.modal-codigo {
  font-size: 12px;
  color: #6b7280;
}

.modal-acciones {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* =============================================
   RESPONSIVE — MÓVIL
   ============================================= */
@media (max-width: 768px) {

  .header {
    height: 320px;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    gap: 6px;
    text-align: center;
  }

  .logo img {
    width: 78px;
    padding: 4px;
  }

  .titulo-logo {
    flex: none;
  }

  .titulo-principal {
    font-size: 22px;
    line-height: 1.1;
  }

  .titulo-sub {
    font-size: 12px;
    letter-spacing: 3px;
  }

  .info {
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
  }

  .buscador-container {
    width: 92%;
    bottom: 18px;
  }

  .scroll-arrow {
    display: none;
  }

  .marcas {
    gap: 5px;
    padding: 8px 5px;
  }

  .marca-card {
    padding: 8px 12px;
    border-radius: 12px;
  }

  .marca-card img {
    height: 18px;
  }

  .categorias {
    gap: 5px;
    padding: 8px 5px;
  }

  .categorias button {
    padding: 7px 12px;
    font-size: 11px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .card {
    padding: 10px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
  }

  .card-img img {
    height: 95px;
  }

  .card p {
    font-size: 12px;
    line-height: 1.3;
  }

  .precio {
    font-size: 15px;
    margin: 6px 0;
  }

  .btn-detalle,
  .btn-wsp {
    font-size: 12px;
    padding: 8px;
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
  }

  .wsp-float {
    bottom: 14px;
    right: 14px;
    padding: 12px 14px;
    font-size: 13px;
  }

  .modal-content {
    width: 94% !important;
    max-width: 94% !important;
    padding: 16px !important;
    border-radius: 18px;
  }

  .modal-content h2 {
    font-size: 15px !important;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .modal-inner {
    padding: 15px 10px;
    align-items: flex-start;
  }

  /* Nuevo modal responsive — columna única en móvil */
  .modal-content > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}
