/* ── Mini-cart drawer (offcanvas right) ──────────────────── */

.mini-cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
    visibility: hidden;
}

.mini-cart-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.mini-cart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 28, 0.55);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.mini-cart-drawer.is-open .mini-cart-drawer__backdrop { opacity: 1; }

.mini-cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mini-cart-drawer.is-open .mini-cart-drawer__panel { transform: translateX(0); }

.mini-cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.mini-cart-drawer__head-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}
.mini-cart-drawer__head-text h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.2;
}

.mini-cart-drawer__check {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mini-cart-drawer__close {
    background: transparent;
    border: 0;
    color: #6b7280;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.18s, color 0.18s;
}
.mini-cart-drawer__close:hover { background: #f3f4f6; color: #1f1f1f; }

.mini-cart-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.mini-cart-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mini-cart-drawer__item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    background: #fff;
}
.mini-cart-drawer__item--new {
    border-color: #97865c;
    background: #fdfaf2;
}

.mini-cart-drawer__item-img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: contain;
    background: #f9fafb;
    padding: 4px;
    box-sizing: border-box;
}

.mini-cart-drawer__item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mini-cart-drawer__item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.mini-cart-drawer__item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.3;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.mini-cart-drawer__item-name:hover { color: #97865c; }
.mini-cart-drawer__item-variation {
    font-size: 0.8rem;
    color: #6b7280;
}
.mini-cart-drawer__item-unit-price {
    font-size: 0.8rem;
    color: #6b7280;
}
.mini-cart-drawer__item-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
}
.mini-cart-drawer__item-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.mini-cart-drawer__item-meta {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.mini-cart-drawer__qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.mini-cart-drawer__qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #1f1f1f;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}
.mini-cart-drawer__qty-btn:hover:not(:disabled) { background: #f3f4f6; }
.mini-cart-drawer__qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.mini-cart-drawer__qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f1f1f;
}
.mini-cart-drawer__item-price {
    font-weight: 700;
    color: #1f1f1f;
    font-size: 1rem;
}
.mini-cart-drawer__item.is-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}
.mini-cart-drawer__item.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: app-spin 0.7s linear infinite;
}

.mini-cart-drawer__empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
}

/* ── "Compre também" ──────────────────────────────────────── */

.mini-cart-drawer__suggestions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.mini-cart-drawer__suggestions-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mini-cart-drawer__suggestions-track {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.mini-cart-drawer__suggestions-track::-webkit-scrollbar { display: none; }

.mini-cart-drawer__sug-card {
    flex: 0 0 110px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 0.5rem;
    background: #fff;
}

.mini-cart-drawer__sug-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f9fafb;
}

.mini-cart-drawer__sug-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.mini-cart-drawer__sug-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-right: 26px;
}

.mini-cart-drawer__sug-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}
.mini-cart-drawer__sug-name:hover { color: #97865c; }

.mini-cart-drawer__sug-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1f1f1f;
}

.mini-cart-drawer__sug-add {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1f1f1f;
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    flex-shrink: 0;
}
.mini-cart-drawer__sug-add:hover { background: #97865c; }
.mini-cart-drawer__sug-add:disabled { opacity: 0.5; cursor: not-allowed; }

.mini-cart-drawer__footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.mini-cart-drawer__summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}
.mini-cart-drawer__summary-label {
    font-size: 0.9rem;
    color: #6b7280;
}
.mini-cart-drawer__summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f1f1f;
}

.mini-cart-drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mini-cart-drawer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    font-family: inherit;
}
.mini-cart-drawer__btn--primary {
    background: #1f1f1f;
    color: #fff;
    border-color: #1f1f1f;
}
.mini-cart-drawer__btn--primary:hover { background: #524f4f; border-color: #524f4f; color: #fff; }
.mini-cart-drawer__btn--ghost {
    background: #fff;
    color: #1f1f1f;
    border-color: #d1d5db;
}
.mini-cart-drawer__btn--ghost:hover { border-color: #97865c; color: #97865c; }

@media (prefers-reduced-motion: reduce) {
    .mini-cart-drawer__panel,
    .mini-cart-drawer__backdrop { transition: none; }
}

/* ── FAB (botão flutuante "Ver carrinho") ──────────────────── */

.cart-fab {
    position: fixed;
    /* Mais próximo da borda inferior: 0.5rem + safe-area (~42px total no iPhone).
       Pesquisa de UX mobile sugere 8-16px de margem inferior pra FABs — distante
       o suficiente do gesto de home indicator sem desperdiçar espaço útil. */
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    left: 0.75rem;
    z-index: 70;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1f1f1f;
    color: #fff;
    border: 0;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, transform 0.18s, opacity 0.18s;
}
.cart-fab:hover {
    background: #524f4f;
    transform: translateY(-2px);
}
.cart-fab:active { transform: translateY(0); }

.cart-fab__count {
    position: absolute;
    top: -4px;
    /* Badge no canto oposto ao corpo do FAB (direita do botão, na esquerda da tela). */
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #97865c;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-sizing: border-box;
}

/* Posicionamento dos elementos flutuantes:
   - FAB de carrinho: bottom-LEFT
   - WhatsApp: bottom-RIGHT
   Decisão UX: o sticky CTA bar (z-index 95) é prioridade quando visível e
   SOBREPÕE os FABs (z-index 70). Isso libera espaço pra ação principal
   (Finalizar compra etc.) sem competição visual. WhatsApp/FAB continuam
   acessíveis quando o usuário oculta o sticky ou em telas sem ele. */

.whatsapp-button {
    right: 0.75rem !important;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 70 !important;
    width: 52px !important;
    height: 52px !important;
}
