/* ══════════════════════════════════════
   CART DRAWER — Luna y el Tarot
   MGWeb 2026
   Archivo: assets/css/cart-drawer.css
══════════════════════════════════════ */

/* ── Overlay ── */
.luna-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,22,37,0.5);
    z-index: 198;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.luna-drawer-overlay.is-open {
    display: block;
    opacity: 1;
}

/* ── Drawer ── */
.luna-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: white;
    z-index: 199;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(26,22,37,0.15);
}

.luna-cart-drawer.is-open {
    transform: translateX(0);
}

/* ── Header ── */
.luna-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 0.5px solid rgba(149,123,234,0.15);
    flex-shrink: 0;
}

.luna-drawer-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1625;
    display: flex;
    align-items: center;
    gap: 8px;
}

.luna-drawer-count {
    background: #957bea;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.luna-drawer-close {
    background: none;
    border: none;
    color: #8b82a0;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.luna-drawer-close:hover {
    color: #1a1625;
    background: #f0ecfd;
}

/* ── Body (items) ── */
.luna-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    overscroll-behavior: contain;
}

/* Item del carrito */
.luna-drawer-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 0.5px solid rgba(149,123,234,0.1);
}

.luna-drawer-item:last-child {
    border-bottom: none;
}

.luna-drawer-item-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0ecfd;
    flex-shrink: 0;
}

.luna-drawer-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.luna-drawer-item-name {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a1625;
    line-height: 1.3;
    text-decoration: none;
}

.luna-drawer-item-name:hover {
    color: #957bea;
}

.luna-drawer-item-meta {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    color: #8b82a0;
    line-height: 1.4;
}

.luna-drawer-item-price {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1a1625;
}

.luna-drawer-item-remove {
    background: none;
    border: none;
    color: #c9bcf5;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.luna-drawer-item-remove:hover {
    color: #957bea;
}

/* Estado vacío */
.luna-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    gap: 16px;
    padding: 40px 0;
}

.luna-drawer-empty-icon {
    font-size: 48px;
    opacity: 0.4;
}

.luna-drawer-empty-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1625;
}

.luna-drawer-empty-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #8b82a0;
}

.luna-drawer-empty-cta {
    background: #957bea;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    transition: background 0.2s;
    margin-top: 8px;
}

.luna-drawer-empty-cta:hover {
    background: #7d60d4;
    color: white;
}

/* Loading */
.luna-drawer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b82a0;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    gap: 10px;
}

.luna-drawer-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(149,123,234,0.2);
    border-top-color: #957bea;
    border-radius: 50%;
    animation: luna-spin 0.7s linear infinite;
}

@keyframes luna-spin {
    to { transform: rotate(360deg); }
}

/* ── Footer ── */
.luna-drawer-foot {
    padding: 16px 24px 24px;
    border-top: 0.5px solid rgba(149,123,234,0.15);
    flex-shrink: 0;
    background: white;
}

.luna-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.luna-drawer-subtotal span:first-child {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    color: #8b82a0;
    font-weight: 600;
}

.luna-drawer-subtotal-amount {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1625;
}

.luna-drawer-checkout-btn {
    display: block;
    width: 100%;
    background: #957bea;
    color: white;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    padding: 14px;
    border-radius: 10px;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.luna-drawer-checkout-btn:hover {
    background: #7d60d4;
    color: white;
}

.luna-drawer-cart-link {
    display: block;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #957bea;
    text-decoration: none;
    transition: opacity 0.2s;
}

.luna-drawer-cart-link:hover {
    opacity: 0.75;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .luna-cart-drawer {
        max-width: 100%;
    }
}

/* ── Acordeón "Tus respuestas" ── */
.luna-drawer-meta {
    margin-top: 6px;
}

.luna-drawer-meta-toggle {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #957bea;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.luna-drawer-meta-toggle::-webkit-details-marker { display: none; }

.luna-drawer-meta-toggle::before {
    content: '›';
    font-size: 14px;
    transition: transform 0.2s;
    display: inline-block;
}

.luna-drawer-meta[open] .luna-drawer-meta-toggle::before {
    transform: rotate(90deg);
}

.luna-drawer-meta-content {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f0ecfd;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    color: #4a4458;
    line-height: 1.6;
}

.luna-drawer-meta-content dl,
.luna-drawer-meta-content table {
    margin: 0;
}

.luna-drawer-meta-content dt,
.luna-drawer-meta-content th {
    font-weight: 700;
    color: #7d60d4;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.luna-drawer-meta-content dd,
.luna-drawer-meta-content td {
    margin: 0 0 4px;
    padding-left: 0;
}
