/* ============================================================
   APREAS — Mini Carrinho Flutuante
   Versão: 1.0.0
   ============================================================ */

/* ── Botão gatilho (canto inferior direito) ── */
#apreas-minicart-trigger {
    position: fixed;
    bottom: 105px;
    right: 20px;
    z-index: 9999998; /* Maior que o do WhatsApp */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D90D28 0%, #b00b20 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(217, 13, 40, 0.45), 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.22s ease;
    outline: none;
}

#apreas-minicart-trigger:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 40px rgba(217, 13, 40, 0.55), 0 4px 15px rgba(0, 0, 0, 0.2);
}

#apreas-minicart-trigger:active {
    transform: scale(0.94);
}

#apreas-minicart-trigger svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ── Badge de quantidade ── */
#apreas-minicart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #fff;
    color: #D90D28;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    display: none;
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    letter-spacing: -0.3px;
}

#apreas-minicart-badge.apreas-minicart-badge--visible {
    display: block;
}

@keyframes apreas-badge-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.4);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

#apreas-minicart-badge.apreas-minicart-badge--pulse {
    animation: apreas-badge-pulse 0.55s cubic-bezier(.36, .07, .19, .97) both;
}

/* ── Overlay escurecido ── */
#apreas-minicart-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646 !important; /* Quase o limite máximo do navegador */
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    pointer-events: none;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

#apreas-minicart-overlay.apreas-minicart-overlay--visible {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(2px);
    pointer-events: all;
}

/* ── Painel lateral ── */
#apreas-minicart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647 !important; /* Limite máximo absoluto (32-bit int) */
    width: 360px;
    max-width: 95vw;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(.25, .46, .45, .94);
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

#apreas-minicart-panel.apreas-minicart--open {
    transform: translateX(0);
}

/* ── Cabeçalho ── */
.apreas-minicart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #D90D28 0%, #b00b20 100%);
    color: #f9fafb;
    flex-shrink: 0;
}

.apreas-minicart__header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.apreas-minicart__header-icon {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apreas-minicart__close {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.apreas-minicart__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.apreas-minicart__close svg {
    display: block;
    flex-shrink: 0;
}

/* ── Corpo ── */
.apreas-minicart__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.apreas-minicart__body::-webkit-scrollbar {
    width: 4px;
}

.apreas-minicart__body::-webkit-scrollbar-track {
    background: transparent;
}

.apreas-minicart__body::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}

/* ── Empty state ── */
#apreas-minicart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 24px 48px;
    gap: 0;
    text-align: center;
}

.apreas-minicart-empty__icon-wrap {
    width: 96px;
    height: 96px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.apreas-minicart-empty__title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.apreas-minicart-empty__text {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ── Lista de itens ── */
#apreas-minicart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apreas-minicart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 10px 12px;
    position: relative;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.apreas-minicart-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border-color: #e5e7eb;
}

.apreas-minicart-item__thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apreas-minicart-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apreas-minicart-item__no-img {
    font-size: 24px;
    opacity: 0.5;
}

.apreas-minicart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.apreas-minicart-item__name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apreas-minicart-item__meta {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.apreas-minicart-remove {
    flex-shrink: 0;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    padding: 0;
}

.apreas-minicart-remove:hover {
    background: #dc2626;
    color: #fff;
    transform: scale(1.1);
}

.apreas-minicart-remove:disabled {
    cursor: not-allowed;
}

/* ── Rodapé / Resumo ── */
.apreas-minicart__footer {
    padding: 20px;
    border-top: 1px solid #f3f4f6;
    background: #ffffff;
    flex-shrink: 0;
}

.apreas-minicart__summary {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.apreas-minicart__summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.apreas-minicart__summary-row:last-of-type {
    margin-bottom: 0;
}

.apreas-minicart__summary-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.apreas-minicart__summary-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.apreas-minicart__summary-row--fee .apreas-minicart__summary-label {
    color: #0891b2; /* Um azul/ciano suave para destacar a taxa de forma profissional */
}

.apreas-minicart__summary-row--fee .apreas-minicart__summary-value {
    color: #0891b2;
}

.apreas-minicart__summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed #e2e8f0;
}

.apreas-minicart__total-label {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.apreas-minicart__total-value {
    font-size: 22px;
    font-weight: 900;
    color: #D90D28;
}

.apreas-minicart__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apreas-minicart__btn-checkout {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #D90D28 0%, #b00b20 100%);
    color: #fff !important;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: opacity 0.2s ease, transform 0.18s ease;
    box-shadow: 0 4px 14px rgba(217, 13, 40, 0.35);
    letter-spacing: 0.3px;
}

.apreas-minicart__btn-checkout:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff !important;
}

.apreas-minicart__btn-cart {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: #202020;
    color: #ffffff !important;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.18s ease;
}

.apreas-minicart__btn-cart:hover {
    background: #333333;
    color: #ffffff !important;
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    #apreas-minicart-panel {
        width: 100%;
        max-width: 100%;
    }

    #apreas-minicart-trigger {
        bottom: 95px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}