/* AMC Secure — premium glossy service cart drawer */

body:not(.admin-body) .cart-drawer {
    position: fixed !important;
    top: clamp(72px, 11vh, 92px) !important;
    right: 16px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9900 !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(392px, calc(100vw - 24px)) !important;
    max-height: min(520px, calc(100vh - 100px)) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(22px, 0, 0) scale(0.965) !important;
    transition:
        opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 240ms ease !important;
}

body:not(.admin-body) .cart-drawer::before {
    position: fixed !important;
    inset: 0 !important;
    z-index: -1 !important;
    background:
        radial-gradient(circle at 82% 12%, rgba(18, 168, 107, 0.16), transparent 34%),
        radial-gradient(circle at 70% 88%, rgba(11, 78, 162, 0.14), transparent 38%),
        rgba(7, 17, 37, 0.34) !important;
    backdrop-filter: blur(8px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(8px) saturate(1.2) !important;
    content: "" !important;
    opacity: 0 !important;
    transition: opacity 240ms ease !important;
}

body:not(.admin-body) .cart-drawer.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

body:not(.admin-body) .cart-drawer.is-open::before {
    opacity: 1 !important;
}

body:not(.admin-body) .cart-drawer[hidden] {
    display: flex !important;
}

.cart-drawer-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
    padding: 14px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.74) 42%, rgba(247, 250, 252, 0.68) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 -1px 0 rgba(255, 255, 255, 0.35) inset,
        0 28px 70px rgba(15, 23, 42, 0.2),
        0 8px 24px rgba(11, 78, 162, 0.08);
    backdrop-filter: blur(28px) saturate(1.55) brightness(1.04);
    -webkit-backdrop-filter: blur(28px) saturate(1.55) brightness(1.04);
    overflow: hidden;
}

.cart-drawer-shell::before {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(18, 168, 107, 0.1), transparent 38%),
        linear-gradient(315deg, rgba(11, 78, 162, 0.1), transparent 42%);
    pointer-events: none;
    content: "";
}

.cart-drawer-shell::after {
    position: absolute;
    top: 0;
    right: 18px;
    left: 18px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    pointer-events: none;
    content: "";
}

.cart-drawer-head,
.cart-drawer-hint,
.cart-drawer-body,
.cart-drawer-foot {
    position: relative;
    z-index: 1;
}

.cart-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 12px;
}

.cart-drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cart-drawer-icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: linear-gradient(145deg, rgba(11, 78, 162, 0.16), rgba(18, 168, 107, 0.18));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 10px 22px rgba(11, 78, 162, 0.14);
    color: var(--amc-blue-700);
}

.cart-drawer-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-drawer-title p {
    margin: 0;
    color: var(--amc-green-700);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cart-drawer-title strong {
    display: block;
    margin-top: 3px;
    color: var(--amc-ink);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.cart-drawer-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: var(--amc-ink);
    cursor: pointer;
    transition:
        transform 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.cart-drawer-close:hover {
    transform: scale(1.04);
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.cart-drawer-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.cart-drawer-hint {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.46);
    color: var(--amc-muted);
    font-size: 12px;
    line-height: 1.45;
}

.cart-drawer-hint.is-active {
    color: var(--amc-text);
    border-color: rgba(18, 168, 107, 0.22);
    background: linear-gradient(135deg, rgba(18, 168, 107, 0.08), rgba(11, 78, 162, 0.06));
}

.cart-drawer-body {
    display: grid;
    gap: 10px;
    min-height: 88px;
    max-height: min(300px, 44vh);
    margin-bottom: 12px;
    padding-right: 4px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 78, 162, 0.28) transparent;
}

.cart-drawer-body::-webkit-scrollbar {
    width: 6px;
}

.cart-drawer-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(11, 78, 162, 0.28);
}

.cart-drawer-empty {
    display: grid;
    gap: 10px;
    place-items: center;
    min-height: 148px;
    padding: 22px 18px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.34);
    background:
        radial-gradient(circle at 50% 0%, rgba(18, 168, 107, 0.08), transparent 58%),
        rgba(255, 255, 255, 0.42);
    color: var(--amc-muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.55;
}

.cart-drawer-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.72);
    color: var(--amc-blue-700);
    box-shadow: 0 12px 28px rgba(11, 78, 162, 0.1);
}

.cart-drawer-empty-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-drawer-empty strong {
    color: var(--amc-ink);
    font-size: 14px;
}

.cart-drawer-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 10px 24px rgba(15, 23, 42, 0.06);
    animation: cartDrawerItemIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cart-drawer-avatar {
    grid-row: span 2;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    border: 1px solid var(--cart-avatar-ring, rgba(11, 78, 162, 0.22));
    background: var(--cart-avatar-bg, rgba(11, 78, 162, 0.12));
    color: var(--cart-avatar-fg, #0b4ea2);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.cart-drawer-item-copy {
    min-width: 0;
}

.cart-drawer-item-copy strong {
    display: block;
    color: var(--amc-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.cart-drawer-item-copy span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.62);
    color: var(--amc-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-drawer-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cart-drawer-qty {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cart-drawer-qty button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(11, 78, 162, 0.08);
    color: var(--amc-blue-700);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.cart-drawer-qty button:hover {
    background: rgba(11, 78, 162, 0.14);
    transform: scale(1.04);
}

.cart-drawer-qty span {
    min-width: 22px;
    color: var(--amc-ink);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.cart-drawer-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.cart-drawer-remove:hover {
    background: rgba(220, 38, 38, 0.14);
    transform: translateY(-1px);
}

.cart-drawer-remove svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.cart-drawer-foot {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.cart-drawer-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.cart-drawer-clear {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--amc-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.cart-drawer-clear:hover {
    background: #fff;
    color: var(--amc-ink);
}

.cart-drawer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid rgba(11, 78, 162, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--amc-blue-700);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.cart-drawer-link:hover {
    background: #fff;
    transform: translateY(-1px);
}

.cart-drawer-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0b4ea2 0%, #0d5f8f 42%, #12a86b 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow:
        0 14px 30px rgba(18, 168, 107, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.cart-drawer-checkout:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 36px rgba(18, 168, 107, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.cart-drawer-checkout svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

body:not(.admin-body) .cart-button span[data-cart-count] {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0b4ea2, #12a86b);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    box-shadow: 0 6px 14px rgba(18, 168, 107, 0.28);
}

body.cart-open {
    overflow: hidden;
}

@keyframes cartDrawerItemIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    body:not(.admin-body) .cart-drawer {
        top: auto !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 12px !important;
        width: auto !important;
        max-height: min(58vh, 460px) !important;
        transform: translate3d(0, 24px, 0) scale(0.97) !important;
    }

    body:not(.admin-body) .cart-drawer.is-open {
        transform: translate3d(0, 0, 0) scale(1) !important;
    }

    .cart-drawer-shell {
        border-radius: 24px;
    }
}

body:not(.admin-body) .cart-drawer > .cart-drawer-shell {
    border-bottom: 0 !important;
    padding-bottom: 14px !important;
}

body:not(.admin-body) .cart-drawer .checkout-link {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.admin-body) .cart-drawer,
    body:not(.admin-body) .cart-drawer::before,
    .cart-drawer-item,
    .cart-drawer-close,
    .cart-drawer-checkout,
    .cart-drawer-link,
    .cart-drawer-qty button,
    .cart-drawer-remove {
        transition: none !important;
        animation: none !important;
    }
}
