/* Shared cart overlay; loaded after the storefront styles. */
#cartDrawerBackdrop[hidden] { display: none !important; }
#cartDrawerBackdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 11000 !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
    background: rgba(27, 35, 55, .5);
}
#cartDrawer {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    left: auto !important;
    width: min(420px, calc(100% - 24px)) !important;
    height: auto !important;
    max-height: calc(100% - 24px) !important;
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
    box-sizing: border-box;
    border: 1px solid #e3e8f4;
    border-radius: 18px;
    background: white;
    transform: translateX(calc(100% + 24px));
    transition: transform .24s ease;
}
#cartDrawerBackdrop.open #cartDrawer { transform: translateX(0) !important; }
#cartDrawer .drawer-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px !important;
}
#cartDrawer .drawer-header > div { min-width: 0; }
#cartDrawer .drawer-header h3 { font-size: 22px; line-height: 1.3; }
#cartDrawer .drawer-close { flex: none; width: 42px; height: 42px; }
#cartDrawerContent {
    flex: 0 1 auto !important;
    display: block !important;
    min-height: 0 !important;
    min-width: 0;
    width: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
#cartDrawer .drawer-items { padding: 0 18px !important; overflow: visible !important; }
#cartDrawer .drawer-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 16px 0;
}
#cartDrawer .drawer-item-image { width: 54px; height: 54px; }
#cartDrawer .drawer-item-copy { min-width: 0; }
#cartDrawer .drawer-item-copy strong,
#cartDrawer .drawer-item-copy small { white-space: normal !important; overflow-wrap: anywhere; }
#cartDrawer .drawer-item-copy > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; justify-content: space-between; }
#cartDrawer .drawer-item-copy .link-danger { min-height: 40px; padding: 6px 0; }
#cartDrawer .drawer-summary {
    flex: none !important;
    position: static !important;
    margin-top: 0 !important;
    width: 100%;
    min-width: 0;
    padding: 18px !important;
    box-sizing: border-box;
    border-top: 1px solid #e8ecf5;
    background: #fafbff;
}
#cartDrawer .drawer-summary > div { min-width: 0; gap: 14px; }
#cartDrawer .drawer-summary strong { overflow-wrap: anywhere; text-align: right; }
#cartDrawer .drawer-summary .button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 12px !important;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
}
#cartDrawer .empty-state { min-width: 0; padding: 28px 18px; }
body.drawer-open .dexbelle-ai-container { visibility: hidden !important; pointer-events: none !important; }
@media (max-width: 820px) {
    #cartDrawer {
        top: max(12px, env(safe-area-inset-top)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
        width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        max-height: calc(100% - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    }
    #cartDrawer .drawer-summary { padding-bottom: max(18px, env(safe-area-inset-bottom)) !important; }
    .shop-home .commerce-home,
    .shop-home .premium-hero,
    .shop-home .premium-hero > *,
    .shop-home .commerce-products,
    .shop-home .commerce-catalog-grid,
    .shop-home .product-card { min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
    .shop-home .premium-hero::before { inset: 0 !important; transform: none !important; }
    .shop-home .premium-preview-row > span { min-width: 0; }
    .shop-home .premium-preview-row strong { overflow-wrap: anywhere; }
    .shop-home .commerce-heading { flex-wrap: wrap; gap: 12px; }
    .shop-home .filter-bar { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 8px; }
    .shop-home .filter-pill { flex: 0 0 auto; }
    .shop-home .product-content,
    .shop-home .product-price-row { min-width: 0; }
    .shop-home .product-price-row { flex-wrap: wrap; gap: 8px; }
    .shop-home .product-content h3,
    .shop-home .product-content p { overflow-wrap: anywhere; }
    .shop-home .product-actions { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
    .shop-home .product-actions form { min-width: 0; }
    .shop-home .product-actions .button { width: 100%; min-width: 0; padding-inline: 5px; white-space: normal; box-sizing: border-box; }
}
@media (max-width: 360px) {
    #cartDrawer .drawer-header,
    #cartDrawer .drawer-summary { padding: 14px !important; }
    #cartDrawer .drawer-items { padding: 0 14px !important; }
    #cartDrawer .drawer-header h3 { font-size: 20px; }
    .shop-home .commerce-products .product-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    #cartDrawer, #cartDrawerBackdrop { transition: none !important; }
}
