/* =========================================================
   Catálogo público — estilo tipo "app de tienda"
   Acento de marca: esmeralda (botones, precios)
   Acento de filtro activo: ámbar (para igualar la referencia)
   ========================================================= */

:root {
    --ambar: #FDB913;
    --ambar-texto: #7A4E00;
    --rojo-agotado: #D64545;
    --verde-abierto: #1E9E52;
}

/* ---------- Página del catálogo a todo el ancho de la pantalla ---------- */
.tienda-header .container,
main.container {
    max-width: 100%;
}

/* ---------- Aviso del catálogo ---------- */
.aviso-banner {
    background: var(--azul-oscuro); color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 12px 44px; text-align: center; font-size: 13.5px; font-weight: 600;
    position: relative; border-radius: var(--radio); margin-bottom: 20px;
}
.aviso-banner-cerrar {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: rgba(255,255,255,.7); font-size: 13px; padding: 4px;
}
.aviso-banner-cerrar:hover { color: #fff; }

/* ---------- Header general ---------- */
.tienda-header {
    background: var(--blanco);
}

.tienda-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--blanco);
    border-bottom: 1px solid var(--gris-borde);
}

.tienda-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 78px 14px 20px;
}

.tienda-marca { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tienda-logo-wrap {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: transparent; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--gris-borde); align-self: center;
}
.tienda-logo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tienda-logo-inicial { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--acento-oscuro); font-size: 17px; }
.tienda-marca h1 { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 19px; line-height: 1.2; }
.tienda-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--texto-secundario); }

/* ---------- Buscador ---------- */
.tienda-buscador {
    display: flex; align-items: center; gap: 8px;
    background: var(--gris-fondo); border: 1px solid var(--gris-borde);
    border-radius: 999px; padding: 10px 16px;
}
.tienda-buscador input {
    border: none; background: transparent; padding: 0; font-size: 14.5px;
}
.tienda-buscador input:focus { box-shadow: none; }
.buscador-icono { font-size: 14px; opacity: .6; }

.tienda-buscador-desktop { flex: 1; max-width: 380px; margin: 0 auto; }
.tienda-buscador-mobile { margin: 6px 20px 0; }

/* ---------- Botón carrito: flotante, fijo en la esquina superior derecha ---------- */
.carrito-btn {
    position: fixed; top: 16px; right: 20px; z-index: 50;
    background: var(--blanco); border: 1.5px solid var(--azul-oscuro);
    width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(27,36,48,.22);
    transition: box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.carrito-btn svg { width: 21px; height: 21px; color: var(--azul-oscuro); }
.carrito-btn:hover { box-shadow: 0 6px 18px rgba(27,36,48,.18); transform: translateY(-1px); background: var(--acento-suave); }
.carrito-btn:hover svg { color: var(--acento-oscuro); }
.carrito-contador {
    position: absolute; top: -4px; right: -4px; background: var(--rojo-agotado); color: #fff;
    border-radius: 999px; min-width: 19px; height: 19px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff;
}

@media (max-width: 780px) {
    .carrito-btn { top: 12px; right: 14px; width: 42px; height: 42px; }
    .carrito-btn svg { width: 19px; height: 19px; }
    .whatsapp-flotante { width: 46px; height: 46px; bottom: 16px; right: 14px; }
    .whatsapp-flotante svg { width: 22px; height: 22px; }
}

/* ---------- Estado / ubicación ---------- */
.tienda-status-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 4px 78px 0 20px; font-size: 13px;
}
.tienda-estado { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--verde-abierto); }
.tienda-estado.cerrado { color: var(--rojo-agotado); }
.tienda-estado-punto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.tienda-ubicacion { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Filtros de categoría + controles ---------- */
.tienda-controles-row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 78px 0 20px; flex-wrap: wrap;
}

.categorias-pills {
    display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden;
    padding-bottom: 4px; flex: 1; min-width: 0; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.categorias-pills::-webkit-scrollbar { display: none; }

.pill {
    flex-shrink: 0; background: var(--blanco); border: 1px solid var(--gris-borde);
    color: var(--texto-principal); padding: 9px 16px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: all .15s ease;
}
.pill:hover { border-color: var(--ambar); }
.pill.activo { background: var(--ambar); border-color: var(--ambar); color: var(--ambar-texto); }

.controles-derecha { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.select-orden {
    width: auto; border-radius: 999px; padding: 9px 14px; font-size: 13.5px; font-weight: 600;
    border: 1px solid var(--gris-borde); background: var(--blanco);
}

.vista-toggle {
    display: flex; background: var(--azul-oscuro); border-radius: 10px; padding: 3px; gap: 2px; flex-shrink: 0;
}
.vista-toggle button {
    background: transparent; border: none; color: rgba(255,255,255,.6);
    width: 34px; height: 32px; border-radius: 7px; font-size: 15px;
}
.vista-toggle button.activo { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- Grilla / lista de productos ---------- */
.productos-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px;
}

/* ---------- Botón flotante de WhatsApp: esquina inferior derecha ---------- */
.whatsapp-flotante {
    position: fixed; bottom: 20px; right: 20px; z-index: 50;
    width: 54px; height: 54px; border-radius: 50%; background: #25D366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(37,211,102,.4); transition: transform .15s ease, box-shadow .15s ease;
}
.whatsapp-flotante svg { width: 27px; height: 27px; }
.whatsapp-flotante:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 22px rgba(37,211,102,.5); }

/* Mientras el panel del carrito está abierto, los íconos flotantes se ocultan para no superponerse */
.carrito-btn.oculto-por-panel, .whatsapp-flotante.oculto-por-panel { display: none; }

#productos-contenedor.vista-lista .productos-grid { display: flex; flex-direction: column; gap: 10px; }

.producto-card {
    position: relative;
    background: var(--blanco); border: 1px solid var(--gris-borde); border-radius: var(--radio);
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease;
}
.producto-card-destacado { border-color: var(--ambar); box-shadow: 0 0 0 1px var(--ambar); }
.producto-destacado-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    background: var(--ambar); color: var(--ambar-texto); font-size: 11px; font-weight: 700;
    padding: 4px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.producto-card:hover { box-shadow: var(--sombra-hover); }

.producto-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: transparent; cursor: pointer; }
.producto-img-placeholder {
    width: 100%; aspect-ratio: 1/1; background: transparent;
    display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--gris-borde);
    cursor: pointer;
}
.producto-info { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.producto-nombre { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.producto-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.producto-precio { font-weight: 700; color: var(--texto-principal); font-size: 15px; }
.producto-agotado { color: var(--rojo-agotado); font-weight: 700; font-size: 13.5px; }

.btn-agregar {
    position: relative; background: #fff; color: #000; border: 1.5px solid #000;
    border-radius: 50%; width: 32px; height: 32px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.btn-agregar svg { width: 15px; height: 15px; }
.btn-agregar:hover { background: #000; color: #fff; }
.btn-agregar:active { transform: scale(0.92); }
.btn-agregar .badge-cantidad {
    position: absolute; top: -6px; right: -6px; background: var(--rojo-agotado); color: #fff;
    border-radius: 999px; min-width: 17px; height: 17px; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid #fff;
}

/* ---------- Vista en lista ---------- */
#productos-contenedor.vista-lista .producto-card { flex-direction: row; align-items: center; }
#productos-contenedor.vista-lista .producto-img,
#productos-contenedor.vista-lista .producto-img-placeholder { width: 76px; height: 76px; aspect-ratio: unset; flex-shrink: 0; }
#productos-contenedor.vista-lista .producto-info { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 10px; }
#productos-contenedor.vista-lista .producto-nombre { flex: 1; }
#productos-contenedor.vista-lista .producto-footer { margin-top: 0; flex-shrink: 0; }

/* ---------- Panel de carrito / checkout (dos pantallas) ---------- */
.carrito-fondo { position: fixed; inset: 0; background: rgba(27,36,48,.45); z-index: 40; }
.carrito-panel {
    position: fixed; top: 0; right: 0; width: 100%; max-width: 420px; height: 100%;
    background: var(--blanco); z-index: 41; display: flex; flex-direction: column;
    box-shadow: -12px 0 30px rgba(0,0,0,.15); transition: transform .25s ease;
    transform: translateX(100%);
}
.carrito-panel.abierto { transform: translateX(0); }

.panel-vista { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.panel-vista-header {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px;
    border-bottom: 1px solid var(--gris-borde); flex-shrink: 0;
}
.panel-vista-header h3 { font-size: 17px; flex: 1; }
.btn-flecha {
    background: #fff; border: 1.5px solid #000; font-size: 19px; font-weight: 700;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    color: #000; line-height: 1; border-radius: 50%; transition: background .15s ease, color .15s ease;
}
.btn-flecha:hover { background: #000; color: #fff; }
.btn-vaciar { background: none; border: none; color: var(--alerta); font-size: 13px; font-weight: 600; text-decoration: underline; }

/* ---------- Ítems del carrito (tarjetas con borde) ---------- */
.carrito-items { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.carrito-item {
    display: flex; gap: 12px; align-items: center; padding: 12px;
    border: 1px solid var(--gris-borde); border-radius: var(--radio);
}
.carrito-item img, .carrito-item-placeholder {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: transparent;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; color: var(--gris-borde);
}
.carrito-item-info { flex: 1; min-width: 0; }
.carrito-item-nombre { font-size: 13.5px; color: var(--texto-secundario); margin-bottom: 8px; }
.carrito-item-precio-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.carrito-item-precio { font-size: 15px; font-weight: 700; }
.carrito-vacio { text-align: center; padding: 80px 20px; color: var(--texto-secundario); }

.selector-cantidad {
    display: flex; align-items: center; gap: 12px; border: 1px solid var(--gris-borde);
    border-radius: 999px; padding: 5px 10px;
}
.selector-cantidad button { background: none; border: none; width: 20px; height: 20px; font-size: 15px; font-weight: 700; color: var(--texto-principal); line-height: 1; }
.selector-cantidad span { font-weight: 700; min-width: 14px; text-align: center; font-size: 14px; }

/* ---------- Barra inferior fija (oscura) ---------- */
.panel-barra-inferior {
    flex-shrink: 0; margin: 14px 20px 20px; background: var(--azul-oscuro); color: #fff;
    border-radius: var(--radio); padding: 13px 16px; display: flex; align-items: center; gap: 12px;
    cursor: pointer; transition: background .15s ease;
}
.panel-barra-inferior:hover { background: #10171F; }
.barra-badge {
    background: rgba(255,255,255,.15); color: #fff; width: 26px; height: 26px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.barra-texto { font-weight: 600; font-size: 14.5px; flex: 1; }
.barra-total { font-weight: 700; font-size: 14.5px; }
.barra-flecha {
    font-size: 20px; font-weight: 700; color: #fff; opacity: 1; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.18); flex-shrink: 0;
}

/* ---------- Pantalla "Datos de contacto" ---------- */
.panel-vista-contenido { flex: 1; overflow-y: auto; padding: 18px 20px 0; }
.checkout-subtitulo { font-size: 13.5px; font-weight: 600; color: var(--azul-medio); margin: 0 0 12px; }

.metodo-entrega { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.metodo-card {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    border: 1.5px solid var(--gris-borde); border-radius: var(--radio); padding: 15px 16px; background: var(--blanco);
}
.metodo-card.activo { border-color: var(--acento); background: var(--acento-suave); }
.metodo-card.deshabilitado { background: var(--gris-fondo); cursor: not-allowed; }
.metodo-icono { font-size: 19px; flex-shrink: 0; }
.metodo-texto { font-weight: 600; font-size: 14.5px; }
.metodo-card.deshabilitado .metodo-texto { color: var(--texto-secundario); }
.metodo-texto-wrap { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.metodo-no-disponible { font-size: 12px; color: var(--alerta); font-weight: 600; }
.metodo-radio {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gris-borde);
    margin-left: auto; flex-shrink: 0;
}
.metodo-radio.activo { border-color: var(--acento); background: var(--acento); box-shadow: inset 0 0 0 3px #fff; }

.requerido { color: var(--alerta); margin-left: 2px; }

.input-telefono {
    display: flex; align-items: center; gap: 0; border: 1px solid var(--gris-borde);
    border-radius: var(--radio-sm); overflow: hidden;
}
.input-telefono-select {
    border: none; border-right: 1px solid var(--gris-borde); background: var(--gris-fondo);
    padding: 10px 8px; font-size: 13.5px; font-weight: 600; flex-shrink: 0;
    width: auto; max-width: 92px; border-radius: 0; -webkit-appearance: menulist;
}
.input-telefono-select:focus { box-shadow: none; }
.input-telefono input { border: none; padding: 10px 12px; }
.input-telefono input:focus { box-shadow: none; }
.input-telefono:focus-within { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }

.staff-login-link { text-align: center; padding: 20px; font-size: 12.5px; }
.staff-login-link a { color: var(--texto-secundario); }
.staff-login-link a:hover { color: var(--acento); }

/* ---------- Modal de detalle de producto ---------- */
.modal-producto { max-width: 420px; }
#detalle-producto-img-wrap { width: 100%; }
#detalle-producto-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: transparent; }
#detalle-producto-img-placeholder { width: 100%; aspect-ratio: 1/1; font-size: 44px; background: transparent; }
.detalle-producto-precio { font-size: 20px; font-weight: 700; color: var(--texto-principal); margin-bottom: 8px; }
.detalle-producto-descripcion { font-size: 14px; color: var(--texto-secundario); line-height: 1.5; margin: 0; }

.detalle-producto-footer { justify-content: space-between; align-items: center; }
.selector-cantidad-detalle { padding: 7px 10px; gap: 16px; }
.selector-cantidad-detalle button { width: 24px; height: 24px; font-size: 17px; }
.selector-cantidad-detalle span { font-size: 15px; }

@media (max-width: 480px) {
    .carrito-panel { max-width: 100%; }
}

/* ---------- Responsivo ---------- */
.tienda-buscador-desktop { display: flex; }
.tienda-buscador-mobile { display: none; }

@media (min-width: 781px) and (max-width: 1080px) {
    .productos-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 780px) {
    .tienda-buscador-desktop { display: none; }
    .tienda-buscador-mobile { display: flex; }
    .tienda-topbar { padding: 14px 64px 0 16px; }
    .tienda-status-row { padding: 2px 62px 0 16px; row-gap: 2px; column-gap: 14px; }
    .tienda-header { padding-bottom: 6px; }
    .tienda-controles-row { padding: 10px 16px 0; flex-direction: column; align-items: stretch; }
    .categorias-pills { width: 100%; max-width: 100%; flex: none; }
    .controles-derecha { width: 100%; }
    .select-orden { flex: 1; }
    main.container { padding-left: 16px !important; padding-right: 16px !important; padding-top: 6px !important; }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    #productos-contenedor.vista-lista .producto-info { padding: 8px 12px; }
}
