/* ==========================================================
   Quinoa – extras: carrito lateral, modal de WhatsApp, filtro
   ========================================================== */

/* ---------- Botón de carrito en el header ---------- */
button.header2-icon {
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.header2-cart span.is-empty { display: none; }

/* ---------- Filtro de categorías ---------- */
a.cat-btn { text-decoration: none; }
a.cat-btn:hover { text-decoration: none; }
.pc.pc-hidden { display: none !important; }
.shop-results {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}
.shop-results strong { color: var(--dark-color); }
.shop-empty {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border: 1.5px dashed rgba(94, 167, 103, .45);
    border-radius: 18px;
    color: var(--text-color);
}
.shop-empty i { font-size: 38px; color: var(--primary-color); margin-bottom: 14px; }
.shop-empty h3 { font-family: var(--heading-font); color: var(--dark-color); font-size: 24px; margin-bottom: 8px; }
.shop-empty p { margin: 0 0 18px; }
.shop-empty[hidden] { display: none; }

/* ---------- Carrito lateral ---------- */
.qcart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 100000;
}
.qcart-overlay.open { opacity: 1; visibility: visible; }

.qcart {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: min(430px, 100%);
    background: #fff;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .35s ease, visibility .35s ease;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .22);
}
.qcart.open { transform: none; visibility: visible; }

.qcart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    background: var(--dark-color);
    color: #fff;
}
.qcart-title {
    font-family: var(--heading-font);
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.qcart-title i { color: var(--primary-color); }
.qcart-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}
.qcart-close:hover { background: var(--primary-color); border-color: var(--primary-color); }

.qcart-body { flex: 1; overflow-y: auto; padding: 8px 22px; }

.qcart-empty {
    text-align: center;
    padding: 60px 10px;
    color: var(--text-color);
}
.qcart-empty i { font-size: 46px; color: rgba(94, 167, 103, .55); margin-bottom: 14px; }
.qcart-empty p { margin: 0 0 18px; font-weight: 600; }

.qcart-item {
    display: grid;
    grid-template-columns: 68px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}
.qcart-item:last-child { border-bottom: 0; }
.qcart-item img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--light-color);
}
.qcart-item-name {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    color: var(--dark-color);
    margin-bottom: 4px;
}
.qcart-item-price { font-size: 14px; color: var(--text-color); margin-bottom: 8px; }
.qcart-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e6e6e6;
    border-radius: 100px;
    overflow: hidden;
}
.qcart-qty button {
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    color: var(--dark-color);
    transition: var(--transition);
}
.qcart-qty button:hover { color: var(--primary-color); }
.qcart-qty span {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--dark-color);
}
.qcart-item-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.qcart-line-total { font-family: var(--heading-font); font-weight: 900; font-size: 17px; color: var(--dark-color); }
.qcart-remove {
    border: 0;
    background: none;
    color: #b5b5b5;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}
.qcart-remove:hover { color: #d9534f; }

.qcart-foot {
    padding: 18px 22px 22px;
    border-top: 1px solid #eee;
    background: var(--light-color);
}
.qcart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--text-color);
}
.qcart-total strong { font-family: var(--heading-font); font-size: 28px; font-weight: 900; color: var(--dark-color); }
.qcart-name {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1.5px solid #e2e2e2;
    border-radius: 12px;
    font-family: var(--body-font);
    font-size: 15px;
    background: #fff;
}
.qcart-name:focus { outline: 0; border-color: var(--primary-color); }
.qcart-checkout { width: 100%; text-align: center; cursor: pointer; }
.qcart-checkout i { margin-right: 8px; }
.qcart-clear {
    display: block;
    margin: 12px auto 0;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #8a8a8a;
    text-decoration: underline;
    cursor: pointer;
}
.qcart-clear:hover { color: #d9534f; }
.qcart-foot[hidden] { display: none; }

/* ---------- Modal de WhatsApp ---------- */
.qwa {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 100002;
}
.qwa.open { opacity: 1; visibility: visible; }
.qwa-dialog {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 94vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 32px 30px 28px;
    transform: translateY(24px);
    transition: transform .35s ease;
}
.qwa.open .qwa-dialog { transform: none; }
.qwa-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: var(--light-color);
    color: var(--dark-color);
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}
.qwa-close:hover { background: var(--primary-color); color: #fff; }
.qwa-head { margin-bottom: 20px; padding-right: 36px; }
.qwa-head h3 {
    font-family: var(--heading-font);
    font-size: 26px;
    font-weight: 800;
    color: var(--dark-color);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.qwa-head h3 i { color: #25d366; }
.qwa-head p { margin: 0; font-size: 15px; }
.js-wa-form .cp-field { margin-bottom: 16px; }
.js-wa-form .btn-default { width: 100%; text-align: center; cursor: pointer; }
.js-wa-form .btn-default i { margin-right: 8px; }
.cp-hint { display: block; margin-top: 12px; font-size: 13px; color: #8a8a8a; text-align: center; }

@media (max-width: 575px) {
    .qwa-dialog { padding: 28px 20px 22px; }
    .qcart-head, .qcart-body, .qcart-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Carrito visible también en móvil/tablet ---------- */
.qwa-head h3 i.fa-whatsapp { color: #25d366 !important; }
@media (max-width: 991px) {
    .header2-actions { display: flex; align-items: center; gap: 10px; }
    .header2-actions .header2-cart {
        display: inline-flex;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* ---------- Franja CTA ("Hablemos"): botones proporcionados ---------- */
.au2-cta-actions { align-items: center; }
.au2-cta-actions .btn-default { min-width: 210px; text-align: left; }
.au2-cta-actions .btn-default i { margin-right: 6px; }
.btn-default.btn-ghost {
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38);
}
.btn-default.btn-ghost::after { background: #fff; }
.btn-default.btn-ghost:hover { color: var(--dark-color) !important; }
.btn-default.btn-ghost:hover::before {
    background-color: var(--primary-color);
    background-image: url('../images/arrow-white.svg');
}
@media (max-width: 576px) {
    .au2-cta-actions .btn-default { width: 100%; min-width: 0; }
}

/* ---------- Filtros: rango de precios y tarjeta de categorías ---------- */
.range-slider {
    background: linear-gradient(to right, var(--primary-color) var(--pct, 100%), rgba(18, 18, 18, .12) var(--pct, 100%));
    cursor: pointer;
}
.range-slider::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(94, 167, 103, .45); cursor: pointer; }
.range-slider::-moz-range-thumb {
    width: 18px; height: 18px; border: 0; border-radius: 50%;
    background: var(--primary-color); box-shadow: 0 2px 8px rgba(94, 167, 103, .45); cursor: pointer;
}
.range-slider::-moz-range-track { background: transparent; }
.cat-btn:hover { background: rgba(94, 167, 103, .08); border-color: rgba(94, 167, 103, .25); }
.sb-head-icon { background: rgba(94, 167, 103, .15); border-color: rgba(94, 167, 103, .3); }
.sb-chevron, .sb-current { display: none; }
.shop-search-input::-webkit-search-cancel-button { cursor: pointer; }
.shop-empty .btn-default { cursor: pointer; }

@media (max-width: 991px) {
    .sb-cats .sb-head { cursor: pointer; }
    .sb-cats .sb-current {
        display: block;
        margin-left: auto;
        font-size: 13px;
        font-weight: 700;
        color: var(--primary-color);
        text-align: right;
    }
    .sb-cats .sb-chevron { display: block; margin-left: 6px; color: #fff; transition: transform .3s ease; }
    .sb-cats:not(.sb-open-init):not(.is-open) .sb-body { display: none; }
    .sb-cats.is-open .sb-chevron { transform: rotate(180deg); }
    .sb-cats:not(.is-open) .sb-head { border-radius: inherit; }
}

/* Flecha del selector de orden en el verde de la marca */
.sort-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235ea767' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}


/* ============================================================
   Grilla de 4 productos por fila + tarjeta que no corta el botón
   ============================================================ */
@media (min-width: 1200px) {
    .products-grid:not(.list-view) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}
.products-grid > .pc, .related-grid > .pc { min-width: 0; }

/* Precio arriba y botón a todo el ancho abajo: ningún precio/oferta lo deforma */
.products-grid:not(.list-view) .pc-footer,
.related-grid .pc-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.products-grid:not(.list-view) .pc-price,
.related-grid .pc-price { font-size: 28px; white-space: nowrap; }
.products-grid:not(.list-view) .pc-price s,
.related-grid .pc-price s { display: block; font-size: 14px; margin: 0 0 4px; }
.products-grid:not(.list-view) .pc-footer .btn-default,
.related-grid .pc-footer .btn-default {
    display: block;
    width: 100%;
    padding: 15px 52px 15px 20px;
    font-size: 17px;
    text-align: center;
    white-space: nowrap;
}
.products-grid:not(.list-view) .pc-name,
.related-grid .pc-name { font-size: 17px; line-height: 1.3; }

/* ---------- Modal WhatsApp: fondo más oscuro ---------- */
.qwa {
    background: rgba(8, 12, 9, .78);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.qwa-dialog { box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }

/* ============================================================
   Tarjetas alineadas: título / precio / botón siempre a la misma altura
   ============================================================ */
.products-grid:not(.list-view) .pc,
.related-grid .pc { height: 100%; }
.products-grid:not(.list-view) .pc-name,
.related-grid .pc-name { margin-bottom: 12px; }
.products-grid:not(.list-view) .pc-divider,
.related-grid .pc-divider { margin-top: auto; }
/* reserva siempre el lugar del precio anterior, con o sin oferta */
.products-grid:not(.list-view) .pc-price,
.related-grid .pc-price {
    min-height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.products-grid:not(.list-view) .pc-footer .btn-default,
.related-grid .pc-footer .btn-default { margin-top: 0; }

/* ============================================================
   Cantidad escrita con teclado
   ============================================================ */
input.qty-num {
    width: 64px;
    min-width: 0;
    height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
input.qty-num:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary-color); border-radius: 8px; }
.qcart-qty input.qcart-qty-input {
    width: 44px;
    height: 32px;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--dark-color);
}
.qcart-qty input.qcart-qty-input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary-color); border-radius: 6px; }

/* ============================================================
   Modal de producto
   ============================================================ */
.qpm {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 12, 9, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 100001;
}
.qpm.open { opacity: 1; visibility: visible; }
.qpm-dialog {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    transform: translateY(24px);
    transition: transform .35s ease;
}
.qpm.open .qpm-dialog { transform: none; }
.qpm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--light-color);
    color: var(--dark-color);
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}
.qpm-close:hover { background: var(--primary-color); color: #fff; }
.qpm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.qpm-main {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: var(--light-color);
}
.qpm-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qpm-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .92);
    color: var(--dark-color);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.qpm-arrow.prev { left: 10px; }
.qpm-arrow.next { right: 10px; }
.qpm-arrow:hover { background: var(--primary-color); color: #fff; }
.qpm-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qpm-thumbs[hidden], .qpm-arrow[hidden], .qpm-desc[hidden], .qpm-was[hidden], .qpm-incart[hidden], .qpm-viewcart[hidden] { display: none; }
.qpm-thumb {
    width: 62px;
    height: 62px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--light-color);
    cursor: pointer;
    opacity: .7;
    transition: var(--transition);
}
.qpm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qpm-thumb.active, .qpm-thumb:hover { border-color: var(--primary-color); opacity: 1; }
.qpm-info { padding-right: 36px; }
.qpm-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.qpm-cats span {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(94, 167, 103, .12);
    padding: 4px 12px;
    border-radius: 100px;
}
.qpm-name { font-family: var(--heading-font); font-size: 30px; font-weight: 800; color: var(--dark-color); margin: 0 0 12px; line-height: 1.15; }
.qpm-desc { white-space: pre-line; font-size: 15px; line-height: 1.7; margin: 0 0 18px; max-height: 190px; overflow-y: auto; }
.qpm-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.qpm-was { font-size: 18px; color: #bbb; }
.qpm-price { font-family: var(--heading-font); font-size: 40px; font-weight: 900; color: var(--dark-color); line-height: 1; }
.qpm-info .detail-qty-row { margin-bottom: 12px; }
.qpm-subtotal { font-size: 15px; margin-bottom: 16px; color: var(--text-color); }
.qpm-subtotal strong { color: var(--dark-color); font-family: var(--heading-font); font-size: 18px; }
.qpm-add { display: block; width: 100%; text-align: center; cursor: pointer; }
.qpm-add.is-done { background: #2f8f46; }
.qpm-incart { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--primary-color); text-align: center; }
.qpm-viewcart {
    display: block;
    margin: 6px auto 0;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 700;
    color: #8a8a8a;
    text-decoration: underline;
    cursor: pointer;
}
.qpm-viewcart:hover { color: var(--primary-color); }
@media (max-width: 767px) {
    .qpm { padding: 0; place-items: end center; }
    .qpm-dialog { max-height: 94vh; border-radius: 24px 24px 0 0; padding: 20px 18px 24px; }
    .qpm-grid { grid-template-columns: 1fr; gap: 18px; }
    .qpm-main { aspect-ratio: 4 / 3; }
    .qpm-info { padding-right: 0; }
    .qpm-name { font-size: 24px; padding-right: 40px; }
    .qpm-price { font-size: 34px; }
}

/* ============================================================
   Menú móvil: que el botón de WhatsApp no quede tapado por la barra del navegador
   ============================================================ */
.header2-mobile-menu {
    height: 100vh;
    height: 100dvh;          /* alto real visible en celulares */
    -webkit-overflow-scrolling: touch;
}
.header2-mobile-inner {
    height: auto;
    min-height: 100%;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
.header2-mobile-nav { flex: 1 1 auto; }
.header2-mobile-bottom { margin-top: 16px; flex: 0 0 auto; }
.header2-mobile-bottom .btn-default { display: block; width: 100%; text-align: center; }
@media (max-height: 760px) {
    .header2-mobile-top { padding-bottom: 14px; margin-bottom: 8px; }
}

/* ---------- Compartir (modal de producto) ---------- */
.qpm-share { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(18, 18, 18, .08); }
.qpm-share-label { font-size: 13px; font-weight: 700; color: var(--dark-color); margin-right: 2px; }
.qpm-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(18, 18, 18, .1);
    background: var(--light-color);
    color: var(--dark-color);
    display: grid;
    place-items: center;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.qpm-share-btn:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.qpm-share-btn.is-copied { background: #2f8f46; border-color: #2f8f46; color: #fff; }
.qpm-share-msg { font-size: 13px; font-weight: 700; color: #2f8f46; }
.qpm-share-msg[hidden] { display: none; }

/* ============================================================
   Aviso "¿Pudiste enviar tu pedido?" + toast
   ============================================================ */
.qord {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 12, 9, .78);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 100005;
}
.qord.open { opacity: 1; visibility: visible; }
.qord-box {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px 24px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    transform: translateY(20px);
    transition: transform .35s ease;
}
.qord.open .qord-box { transform: none; }
.qord-ico {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(37, 211, 102, .14);
    color: #25d366;
    font-size: 32px;
}
.qord-title { font-family: var(--heading-font); font-size: 24px; font-weight: 800; color: var(--dark-color); margin: 0 0 10px; }
.qord-text { font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
.qord-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.qord-yes { display: block; width: 100%; text-align: center; cursor: pointer; }
.qord-no {
    border: 0;
    background: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #6b6b6b;
    cursor: pointer;
}
.qord-no:hover { color: var(--primary-color); }
.qord-note { margin: 6px 0 0; font-size: 12.5px; color: #9a9a9a; }

.qtoast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 20px);
    max-width: calc(100% - 32px);
    background: #121212;
    color: #fff;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 100006;
}
.qtoast.show { opacity: 1; transform: translate(-50%, 0); }
.qtoast[hidden] { display: none; }
