/* =========================================================
   QAMPAC - MEJORAS VISUALES Y FUNCIONALES
   Basado en el proyecto original. No reemplaza la estructura.
   ========================================================= */

:root{
  --q-navy:#020F43;
  --q-yellow:#F9C94D;
  --q-red:#A51F28;
}

/* ---------- ICONOS DE LA BARRA SUPERIOR ---------- */
/* Se usan iconos CSS para no depender de Font Awesome. */

#deliveryTop .mode-icon,
#pickupTop .mode-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

#deliveryTop .mode-icon i,
#pickupTop .mode-icon i,
#cartTop > span:first-child i,
.header-links .simple-head:not(.cart) > span:first-child i{
  display:none !important;
}

#deliveryTop .mode-icon::before{
  content:"🚚";
  font-size:15px;
  line-height:1;
}

#pickupTop .mode-icon::before{
  content:"🏪";
  font-size:14px;
  line-height:1;
}

.header-links .simple-head:not(.cart) > span:first-child{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.header-links .simple-head:not(.cart) > span:first-child::before{
  content:"👤";
  font-size:14px;
  line-height:1;
}

#cartTop > span:first-child{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

#cartTop > span:first-child::before{
  content:"🛒";
  font-size:15px;
  line-height:1;
}

#deliveryTop,
#pickupTop,
.header-links .simple-head{
  align-items:center !important;
  justify-content:center;
  gap:5px !important;
}

#cartTop{
  position:relative !important;
}

#cartTop em{
  right:-4px !important;
  top:-4px !important;
}

/* ---------- BUSCADOR ---------- */
.search-box{
  align-items:center;
}

.search-box input{
  min-width:0;
}

.search-box button{
  display:flex;
  align-items:center;
  justify-content:center;
}

.search-box button i{
  display:none !important;
}

.search-box button::before{
  content:"⌕";
  font-family:Arial,sans-serif;
  font-size:23px;
  font-weight:700;
}

/* ---------- MENÚ TODAS LAS CATEGORÍAS ---------- */
/* Una sola ventana, sin crear menús adicionales. */
.mega-menu{
  overflow-x:hidden;
}

.category-menu-panel{
  width:min(1180px,92%);
}

.category-menu-list{
  width:100%;
}

.menu-category{
  min-height:42px;
  align-items:center;
}

.category-flyout{
  overflow:hidden;
}

.flyout-grid{
  width:100%;
}

/* Evita cualquier SVG/objeto accidental gigante dentro del menú */
.mega-menu svg{
  max-width:24px !important;
  max-height:24px !important;
}

@media(max-width:650px){
  .mega-menu{
    max-height:75vh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }

  .category-menu-panel{
    width:calc(100% - 24px);
    padding:10px 0 14px;
  }

  .category-menu-list{
    grid-template-columns:1fr 1fr !important;
    gap:7px;
  }

  .menu-category{
    min-height:44px;
    padding:10px 9px;
    font-size:9px;
  }

  .flyout-grid{
    grid-template-columns:1fr 1fr !important;
  }

  #deliveryTop .mode-icon,
  #pickupTop .mode-icon{
    width:18px;
    height:18px;
    flex-basis:18px;
  }

  .header-links .simple-head:not(.cart) > span:first-child,
  #cartTop > span:first-child{
    width:18px;
    height:18px;
    flex-basis:18px;
  }
}

/* ---------- FOOTER Y REDES ---------- */
.footer{
  overflow:hidden;
}

.footer-grid{
  align-items:start;
}

.footer .yellow-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:56px;
  width:min(100%,260px);
  padding:12px 18px;
  text-align:center;
  line-height:1.35;
  color:var(--q-navy);
  font-weight:900;
}

.footer .socials{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.footer .socials a{
  width:40px;
  height:40px;
  min-width:40px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--q-yellow);
  color:var(--q-navy);
  font-size:0;
}

.footer .socials a i{
  display:none !important;
}

.footer .socials a::before{
  font-family:Arial,Helvetica,sans-serif;
  font-weight:900;
  line-height:1;
}

.footer .socials a[aria-label="Facebook"]::before{
  content:"f";
  font-size:23px;
}

.footer .socials a[aria-label="TikTok"]::before{
  content:"♪";
  font-size:22px;
}

.footer .socials a[aria-label="WhatsApp"]::before{
  content:"W";
  font-size:17px;
}

.footer .socials a[aria-label="Instagram"]::before{
  content:"◎";
  font-size:26px;
}

@media(max-width:650px){
  .footer .socials{
    justify-content:center;
  }
  .footer .socials a{
    width:42px;
    height:42px;
    min-width:42px;
  }
}

/* ---------- MEDIOS DE PAGO ---------- */
.payment-methods{
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid #dfe4ee;
}

.payment-methods-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.payment-methods-title strong{
  font-size:14px;
  color:var(--q-navy);
}

.payment-methods-title span{
  font-size:9px;
  color:#707a90;
}

.payment-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:9px;
}

.payment-option{
  position:relative;
  border:1px solid #dfe4ee;
  background:#fff;
  border-radius:10px;
  padding:10px 7px;
  min-height:78px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  color:var(--q-navy);
  transition:.2s;
}

.payment-option:hover{
  border-color:var(--q-yellow);
  transform:translateY(-1px);
}

.payment-option.active{
  border-color:var(--q-yellow);
  box-shadow:0 0 0 2px rgba(249,201,77,.32);
  background:#fffaf0;
}

.payment-option img{
  display:block;
  width:auto;
  height:34px;
  max-width:90px;
  object-fit:contain;
}

.payment-option strong{
  font-size:8px;
  text-align:center;
}

.payment-option small{
  font-size:7px;
  color:#707a90;
  text-align:center;
  line-height:1.25;
}

.payment-note{
  margin-top:10px;
  padding:10px 12px;
  border-radius:8px;
  background:#f6f8fb;
  color:#707a90;
  font-size:9px;
  line-height:1.5;
}

@media(max-width:650px){
  .payment-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .payment-option{
    min-height:82px;
  }
}

/* ---------- LOGO EN BUSCADOR ---------- */
.search-box.has-qampac-logo{
  position:relative;
}

.search-box.has-qampac-logo::before{
  content:"";
  flex:0 0 48px;
  width:48px;
  height:28px;
  margin-left:9px;
  margin-right:2px;
  background:url("logo-qampac-search.png") center/contain no-repeat;
  pointer-events:none;
}

.search-box.has-qampac-logo input{
  padding-left:6px !important;
}

@media(max-width:650px){
  .search-box.has-qampac-logo::before{
    flex-basis:42px;
    width:42px;
    height:24px;
    margin-left:6px;
  }
}

/* =========================================================
   QAMPAC - DETALLES DE CARRITO Y CONFIRMACIÓN DE PAGO
   ========================================================= */

/* Vista lateral después de agregar un producto */
.qampac-cart-drawer{
  position:fixed;
  z-index:99990;
  top:0;
  right:0;
  width:min(390px,92vw);
  height:100vh;
  background:#fff;
  box-shadow:-12px 0 35px rgba(2,15,67,.18);
  transform:translateX(105%);
  transition:transform .25s ease;
  display:flex;
  flex-direction:column;
}
.qampac-cart-drawer.open{transform:translateX(0)}
.qcd-head{
  min-height:64px;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #e4e8ef;
  color:#020F43;
}
.qcd-head strong{font-size:15px}
.qcd-close{
  border:0;
  background:transparent;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  color:#020F43;
}
.qcd-body{
  padding:22px 18px;
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.qcd-body img{
  width:92px;
  height:92px;
  object-fit:contain;
  border:1px solid #e4e8ef;
  border-radius:10px;
  background:#fff;
}
.qcd-body small{
  display:block;
  color:#707a90;
  font-size:9px;
  text-transform:uppercase;
}
.qcd-body h3{
  margin:5px 0;
  color:#020F43;
  font-size:14px;
  line-height:1.25;
}
.qcd-body strong{color:#A51F28;font-size:15px}
.qcd-body p{margin:6px 0 0;color:#707a90;font-size:10px}
.qcd-actions{
  margin-top:auto;
  padding:16px 18px;
  border-top:1px solid #e4e8ef;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}
.qcd-actions button{
  min-height:44px;
  border-radius:8px;
  font-weight:800;
  font-size:10px;
  cursor:pointer;
}
.qcd-continue{
  background:#fff;
  border:1px solid #020F43;
  color:#020F43;
}
.qcd-cart{
  background:#F9C94D;
  border:1px solid #F9C94D;
  color:#020F43;
}

/* Confirmación de pago dentro de la página */
.qampac-payment-modal{
  position:fixed;
  z-index:99999;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(2,15,67,.58);
}
.qampac-payment-modal.open{display:flex}
.qpm-card{
  position:relative;
  width:min(500px,100%);
  max-height:90vh;
  overflow:auto;
  padding:28px;
  border-radius:14px;
  background:#fff;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.qpm-close{
  position:absolute;
  top:10px;
  right:13px;
  border:0;
  background:transparent;
  color:#020F43;
  font-size:27px;
  cursor:pointer;
}
.qpm-icon{
  width:42px;
  height:42px;
  border-radius:50%;
  display:grid;
  place-items:center;
  margin-bottom:10px;
  background:#F9C94D;
  color:#020F43;
  font-size:20px;
  font-weight:900;
}
.qpm-card h2{
  margin:0 0 10px;
  color:#020F43;
  font-size:20px;
}
.qpm-summary{
  padding:12px;
  border-radius:8px;
  background:#f6f8fb;
  color:#020F43;
  font-size:11px;
  line-height:1.7;
}
.qpm-instructions p{
  color:#4f596b;
  font-size:10px;
  line-height:1.55;
}
.qpm-warning{
  padding:9px;
  border-radius:7px;
  background:#fff8e6;
  color:#7a5b00!important;
}
.qpm-instructions label{
  display:block;
  margin-top:12px;
  color:#020F43;
  font-size:10px;
  font-weight:800;
}
.qpm-instructions input{
  display:block;
  width:100%;
  margin-top:6px;
  box-sizing:border-box;
  padding:11px;
  border:1px solid #d8dde6;
  border-radius:7px;
  font-size:11px;
}
.qpm-check{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:14px;
  color:#020F43;
  font-size:10px;
  line-height:1.4;
}
.qpm-check input{
  margin-top:2px;
}
.qpm-actions{
  display:flex;
  gap:9px;
  margin-top:18px;
}
.qpm-actions button{
  flex:1;
  min-height:44px;
  border-radius:8px;
  cursor:pointer;
  font-size:10px;
  font-weight:800;
}
.qpm-cancel{
  border:1px solid #020F43;
  background:#fff;
  color:#020F43;
}
.qpm-confirm{
  border:1px solid #F9C94D;
  background:#F9C94D;
  color:#020F43;
}
.qpm-success{
  margin-top:18px;
  padding:14px;
  border-radius:8px;
  background:#f6f8fb;
  color:#020F43;
  font-size:10px;
  line-height:1.5;
}
.qpm-whatsapp{
  width:100%;
  margin-top:10px;
  min-height:42px;
  border:0;
  border-radius:8px;
  background:#19a974;
  color:#fff;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
@media(max-width:650px){
  .qampac-cart-drawer{width:94vw}
  .qpm-card{padding:22px}
}

/* =========================================================
   QAMPAC — CORRECCIÓN DEFINITIVA DE ICONOS Y ENCABEZADO
   Los iconos son SVG inline. No se usa Font Awesome, emoji
   ni recursos externos para estos elementos.
   ========================================================= */

.q-svg,
.q-social-svg{
  display:block !important;
  width:18px;
  height:18px;
  flex:0 0 18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.q-social-svg{
  width:22px;
  height:22px;
  flex:0 0 22px;
  stroke:none;
  fill:currentColor;
}

.search-box button{
  display:flex !important;
  align-items:center;
  justify-content:center;
}

.search-box button .q-svg{
  width:22px;
  height:22px;
}

#deliveryTop .mode-icon,
#pickupTop .mode-icon,
.header-links .simple-head > span:first-child{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  position:relative;
}

#cartTop{
  position:relative !important;
}

#cartTop > span:first-child{
  position:relative;
}

#cartTop em{
  position:absolute !important;
  right:-5px !important;
  top:-5px !important;
  width:16px !important;
  height:16px !important;
  min-width:16px !important;
  padding:0 !important;
  margin:0 !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  text-indent:0 !important;
  border-radius:50%;
  display:grid !important;
  place-items:center !important;
  background:#A51F28 !important;
  color:#fff !important;
  font:800 8px/16px Arial,Helvetica,sans-serif !important;
  z-index:5;
}

/* Redes sociales: SVG real, no pseudo-elementos */
.footer .socials{
  display:flex !important;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.footer .socials a{
  width:40px !important;
  height:40px !important;
  min-width:40px !important;
  min-height:40px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:50%;
  display:flex !important;
  align-items:center;
  justify-content:center;
  background:#F9C94D !important;
  color:#020F43 !important;
  font-size:0 !important;
  line-height:0 !important;
  overflow:hidden;
}

.footer .socials a::before{
  content:none !important;
  display:none !important;
}

.footer .socials a i{
  display:none !important;
}

.footer .socials a .q-social-svg{
  color:#020F43 !important;
}

@media(max-width:650px){
  .header-main{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    gap:8px !important;
    padding:8px 0 !important;
  }

  .header-main .brand{
    flex:0 0 120px !important;
    width:120px !important;
  }

  .header-main .search-box{
    order:3 !important;
    flex:1 1 100% !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }

  .header-main .header-links{
    order:2 !important;
    flex:1 1 0 !important;
    width:auto !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:1px !important;
    margin-left:0 !important;
  }

  .header-main .header-links button{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    padding:5px 1px !important;
    margin:0 !important;
    gap:2px !important;
    font-size:7px !important;
    line-height:1.05 !important;
    overflow:visible !important;
  }

  .header-main .header-links button > span:last-child{
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  #deliveryTop .mode-icon,
  #pickupTop .mode-icon,
  .header-links .simple-head > span:first-child{
    width:16px !important;
    height:16px !important;
    flex-basis:16px !important;
  }

  #deliveryTop .q-svg,
  #pickupTop .q-svg,
  .header-links .simple-head .q-svg{
    width:15px !important;
    height:15px !important;
  }

  #cartTop em{
    right:0 !important;
    top:0 !important;
  }

  .footer .socials{
    justify-content:center !important;
  }

  .footer .socials a{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
  }
}


/* =========================================================
   QAMPAC V3 — ENCABEZADO RESPONSIVE REAL
   En móvil:
   fila 1: logo + buscador
   fila 2: Delivery + Recojo + Mi cuenta + Carrito
   ========================================================= */

@media (max-width: 700px){
  .header-main{
    width:92% !important;
    margin-left:auto !important;
    margin-right:auto !important;
    display:grid !important;
    grid-template-columns:120px minmax(0,1fr) !important;
    grid-template-rows:auto auto !important;
    align-items:center !important;
    column-gap:8px !important;
    row-gap:8px !important;
    padding:8px 0 !important;
    min-height:0 !important;
    box-sizing:border-box !important;
  }

  .header-main .brand{
    grid-column:1 !important;
    grid-row:1 !important;
    display:block !important;
    width:120px !important;
    max-width:120px !important;
    flex:none !important;
    min-width:0 !important;
  }

  .header-main .brand img{
    width:100% !important;
    height:auto !important;
    display:block !important;
  }

  .header-main .search-box{
    grid-column:2 !important;
    grid-row:1 !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    height:42px !important;
    flex:none !important;
    order:initial !important;
  }

  .header-main .search-box input{
    min-width:0 !important;
    width:100% !important;
    font-size:11px !important;
    padding:0 10px !important;
  }

  .header-main .search-box button{
    width:46px !important;
    min-width:46px !important;
  }

  .header-main .header-links{
    grid-column:1 / -1 !important;
    grid-row:2 !important;
    width:100% !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    align-items:stretch !important;
    gap:4px !important;
    margin:0 !important;
    flex:none !important;
  }

  .header-main .header-links button{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    height:44px !important;
    padding:4px 2px !important;
    margin:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:3px !important;
    font-size:8px !important;
    line-height:1 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
  }

  .header-main .header-links button > span:last-child{
    min-width:0 !important;
    max-width:calc(100% - 20px) !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .header-main .header-links .mode{
    border-radius:8px !important;
  }

  .header-main .header-links .mode small{
    font-size:6px !important;
    line-height:1 !important;
  }

  #deliveryTop .mode-icon,
  #pickupTop .mode-icon,
  .header-links .simple-head > span:first-child{
    width:17px !important;
    height:17px !important;
    flex:0 0 17px !important;
  }

  #deliveryTop .q-svg,
  #pickupTop .q-svg,
  .header-links .simple-head .q-svg{
    width:16px !important;
    height:16px !important;
  }

  #cartTop{
    padding-right:5px !important;
  }

  #cartTop em{
    right:2px !important;
    top:1px !important;
    width:15px !important;
    height:15px !important;
    min-width:15px !important;
    font-size:7px !important;
    line-height:15px !important;
  }
}

/* Very narrow phones: reduce only the logo/search row and typography. */
@media (max-width:430px){
  .header-main{
    grid-template-columns:96px minmax(0,1fr) !important;
    column-gap:6px !important;
  }

  .header-main .brand{
    width:96px !important;
    max-width:96px !important;
  }

  .header-main .search-box{
    height:38px !important;
  }

  .header-main .search-box button{
    width:42px !important;
    min-width:42px !important;
  }

  .header-main .header-links{
    gap:2px !important;
  }

  .header-main .header-links button{
    height:40px !important;
    font-size:7px !important;
  }

  #deliveryTop .mode-icon,
  #pickupTop .mode-icon,
  .header-links .simple-head > span:first-child{
    width:15px !important;
    height:15px !important;
    flex-basis:15px !important;
  }

  #deliveryTop .q-svg,
  #pickupTop .q-svg,
  .header-links .simple-head .q-svg{
    width:14px !important;
    height:14px !important;
  }
}

/* ===== Modal de detalle de producto ===== */
.qpd-overlay{
  position:fixed;inset:0;background:#020f43b3;display:none;
  align-items:center;justify-content:center;padding:20px;z-index:1000;
}
.qpd-overlay.open{display:flex}
.qpd-card{
  background:#fff;border-radius:14px;max-width:820px;width:100%;max-height:90vh;overflow:auto;
  display:grid;grid-template-columns:1fr 1fr;position:relative;box-shadow:0 20px 60px #020f4340;
}
.qpd-close{
  position:absolute;top:10px;right:10px;width:34px;height:34px;border:0;border-radius:50%;
  background:#fff;color:var(--navy);font-size:20px;line-height:1;cursor:pointer;z-index:2;box-shadow:0 2px 8px #0000002a;
}
.qpd-img{background:#edf0f5;min-height:260px}
.qpd-img img{width:100%;height:100%;object-fit:contain;display:block}
.qpd-info{padding:26px 28px;display:flex;flex-direction:column;gap:8px}
.qpd-cat{font-size:9px;color:var(--red);font-weight:800;letter-spacing:.6px}
.qpd-name{font-size:22px;color:var(--navy);margin:0}
.qpd-price{font-size:24px;color:var(--red);font-weight:800}
.qpd-desc{font-size:13px;line-height:1.6;color:#4a5468;white-space:pre-line;margin:0}
.qpd-add{width:100%;margin-top:auto;border:0;background:var(--navy);color:#fff;border-radius:8px;padding:14px;font-size:11px;font-weight:800;cursor:pointer}
.qpd-add:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:650px){
  .qpd-card{grid-template-columns:1fr;max-height:92vh}
  .qpd-img{min-height:220px}
  .qpd-info{padding:18px 18px 22px}
}
