/* ═══════════════════════════════════════
   CART.CSS — Sacola Flutuante Elena Store
   ═══════════════════════════════════════ */

/* ── Overlay ──────────────────────────────────────────── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(2px);
}
.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Drawer ───────────────────────────────────────────── */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -460px;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 1200;
    transition: right 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.14);
}
.cart-drawer.open { right: 0; }

/* ── Header ───────────────────────────────────────────── */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 18px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.cart-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1c1c1c;
    letter-spacing: 0.2px;
}
.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    padding: 7px;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.cart-close-btn:hover { background: #f5f5f5; color: #1c1c1c; }

/* ── Body (scrollable) ────────────────────────────────── */
.cart-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e8e8e8 transparent;
}
.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: #e8e8e8; border-radius: 4px; }

/* ── Empty State ──────────────────────────────────────── */
.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 72px 24px;
    text-align: center;
}
.cart-empty-state svg { opacity: 0.25; }
.cart-empty-state p {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #aaa;
    margin: 0;
}
.cart-empty-cta {
    display: inline-block;
    margin-top: 6px;
    background: #1c1c1c;
    color: #fff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background 0.2s;
}
.cart-empty-cta:hover { background: #333; }

/* ── Cart Items ───────────────────────────────────────── */
.cart-items-list { padding: 8px 20px 0; }

.ci {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    animation: ciFadeIn 0.25s ease both;
}
@keyframes ciFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.ci-img {
    width: 76px;
    height: 95px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f3f3f3;
}
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ci-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1c1c1c;
    line-height: 1.4;
}
.ci-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #bbb;
}
.ci-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}
.ci-qty {
    display: flex;
    align-items: center;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}
.ci-qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    color: #1c1c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: 'Inter', sans-serif;
}
.ci-qty-btn:hover { background: #f5f5f5; }
.ci-qty-num {
    width: 30px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1c1c1c;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
    line-height: 30px;
}
.ci-price {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1c1c1c;
}
.ci-remove {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #ccc;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s;
    align-self: flex-start;
}
.ci-remove:hover { color: #e53935; }

/* ── Related Products ─────────────────────────────────── */
.cart-related-section {
    padding: 22px 20px 4px;
    border-top: 6px solid #f5f5f5;
    margin-top: 8px;
}
.cart-related-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 16px;
}
.cart-related-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    user-select: none;
}
.cart-related-grid::-webkit-scrollbar { display: none; }

.cr-card {
    min-width: 128px;
    max-width: 128px;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cr-img-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f3f3f3;
}
.cr-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.cr-card:hover .cr-img-wrap img { transform: scale(1.05); }
.cr-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    background: #e3f5ec;
    color: #1e7a4a;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}
.cr-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #1c1c1c;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-price {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1c1c1c;
}
.cr-add-btn {
    width: 100%;
    background: none;
    border: 1.5px solid #1c1c1c;
    border-radius: 8px;
    padding: 7px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1c1c1c;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 2px;
}
.cr-add-btn:hover { background: #1c1c1c; color: #fff; }

/* ── Footer ───────────────────────────────────────────── */
.cart-drawer-footer {
    padding: 18px 20px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fff;
}
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    color: #707070;
    margin-bottom: 8px;
}
.cart-row-frete span:last-child {
    color: #1e7a4a;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.cart-row-total {
    font-size: 1rem;
    font-weight: 700;
    color: #1c1c1c;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 18px;
}
.cart-checkout-btn {
    width: 100%;
    background: #1c1c1c;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cart-checkout-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.cart-continue-btn {
    width: 100%;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: #bbb;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px;
    transition: color 0.2s;
}
.cart-continue-btn:hover { color: #555; }

/* ── Nav Badge ────────────────────────────────────────── */
.cart-nav-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    background: #198e35;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    pointer-events: none;
    line-height: 1;
}

/* ── Quick Add Modal ──────────────────────────────────── */
.cart-qa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(2px);
}
.cart-qa-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-quick-add {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 1500;
    transform: translateY(110%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    max-height: 90vh;
    overflow-y: auto;
}
.cart-quick-add.open { transform: translateY(0); }

@media (min-width: 600px) {
    .cart-quick-add {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(110%);
        width: 420px;
        border-radius: 20px 20px 0 0;
    }
    .cart-quick-add.open {
        transform: translateX(-50%) translateY(0);
    }
}

.qa-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 4px;
    margin: 14px auto 0;
}
.qa-inner { padding: 18px 22px 28px; }
.qa-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    color: #999;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}
.qa-close:hover { color: #1c1c1c; }
.qa-product {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}
.qa-product img {
    width: 56px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f3f3;
    flex-shrink: 0;
}
.qa-pname {
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    color: #1c1c1c;
    line-height: 1.4;
    margin-bottom: 4px;
}
.qa-pprice {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1c1c1c;
}
.qa-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
.qa-label span {
    color: #1c1c1c;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.78rem;
}
.qa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.qa-chip {
    padding: 8px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 50px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
}
.qa-chip:hover {
    border-color: #1c1c1c;
    color: #1c1c1c;
}
.qa-chip.active {
    background: #1c1c1c;
    border-color: #1c1c1c;
    color: #fff;
}
.qa-confirm-btn {
    width: 100%;
    background: #198e35;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, transform 0.15s;
}
.qa-confirm-btn:hover { background: #157a2c; transform: translateY(-1px); }
.qa-confirm-btn:active { transform: scale(0.98); }

/* ── Toast notification ───────────────────────────────── */
.cart-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1c1c1c;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    pointer-events: none;
}
.cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
