/* =============================================
   Cart Dropdown — Estilos modernos/minimalistas
   ============================================= */

.cart-dropdown-modern {
    width: clamp(18rem, 28vw, 22rem);
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.12) !important;
    padding: 0 !important;
    min-width: min(18rem, calc(100vw - 1.5rem)) !important;
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 6rem);
    overflow: hidden;
    flex-direction: column;
}
.cart-dropdown-modern.show {
    display: flex;
    animation: cart-dropdown-enter .16s ease-out both;
}
@keyframes cart-dropdown-enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.cart-dropdown-modern .cart-dd-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f1f3;
    background: #fafafa;
}
.cart-dropdown-modern .cart-dd-body {
    max-height: min(42vh, 20rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}
.cart-dropdown-modern .cart-dd-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .15s;
}
.cart-dropdown-modern .cart-dd-item:not(:last-child) {
    border-bottom: 1px solid #f5f5f7;
}
.cart-dropdown-modern .cart-dd-item:hover {
    background: #f8f9fb;
}
.cart-dropdown-modern .cart-dd-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #ebebeb;
}
.cart-dropdown-modern .cart-dd-name {
    font-size: .83rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    margin: 0 0 2px;
    line-height: 1.3;
}
.cart-dropdown-modern .cart-dd-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.cart-dropdown-modern .cart-dd-qty {
    font-size: .69rem;
    background: #ededef;
    color: #666;
    padding: 1px 8px;
    border-radius: 20px;
    letter-spacing: .02em;
}
.cart-dropdown-modern .cart-dd-price {
    font-size: .78rem;
    color: #888;
}
.cart-dropdown-modern .cart-dd-remove {
    margin-left: auto;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    transition: background .15s, color .15s;
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
}
.cart-dropdown-modern .cart-dd-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}
.cart-dropdown-modern .cart-dd-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f1f3;
}

/* Dark mode */
.dark-layout .cart-dropdown-modern { background: #283046 !important; }
.dark-layout .cart-dropdown-modern .cart-dd-header { background: #242b3d; border-bottom-color: #3b4253; }
.dark-layout .cart-dropdown-modern .cart-dd-name { color: #d0d2d6; }
.dark-layout .cart-dropdown-modern .cart-dd-item:not(:last-child) { border-bottom-color: #3b4253; }
.dark-layout .cart-dropdown-modern .cart-dd-item:hover { background: #242b3d; }
.dark-layout .cart-dropdown-modern .cart-dd-footer { border-top-color: #3b4253; }
.dark-layout .cart-dropdown-modern .cart-dd-qty { background: #3b4253; color: #aaa; }

/* Empty state */
.cart-dd-empty {
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.cart-dd-empty svg {
    opacity: .25;
    margin-bottom: 4px;
}
.cart-dd-empty-title {
    font-size: .85rem;
    font-weight: 600;
    color: #555;
    margin: 0;
}
.cart-dd-empty-sub {
    font-size: .75rem;
    color: #aaa;
    margin: 0;
}
.dark-layout .cart-dd-empty-title { color: #b4b7bd; }
.dark-layout .cart-dd-empty svg { opacity: .18; }

@media (max-width: 575.98px) {
    .cart-dropdown-modern {
        position: fixed !important;
        left: max(.5rem, env(safe-area-inset-left)) !important;
        right: max(.5rem, env(safe-area-inset-right)) !important;
        top: auto !important;
        bottom: calc(.5rem + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: min(72vh, 36rem);
        transform: none !important;
        border-radius: 18px !important;
    }

    .cart-dropdown-modern .cart-dd-body {
        max-height: min(52vh, 26rem);
    }

    .cart-dropdown-modern .cart-dd-item {
        padding: 10px 12px;
    }

    .cart-dropdown-modern .cart-dd-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-dropdown-modern.show {
        animation: none;
    }
}
