/* ===========================================================
   AUDITORY LAB — Shopping Cart styles
   Matches the site: dark navy, blue→purple gradient,
   Montserrat headings, Roboto text, Font Awesome icons.
   =========================================================== */

:root {
    --al-blue: #4a6cf7;
    --al-purple: #a855f7;
    --al-grad: linear-gradient(90deg, #4a6cf7, #a855f7);
    --al-bg-1: #1a1a2e;
    --al-bg-2: #0d0d1a;
    --al-line: #2a2a40;
    --al-text: #d0d0e0;
    --al-muted: #8a8aa3;
    --al-cart-grad: linear-gradient(90deg, #4a6cf7, #a855f7);
    --al-cart-grad-hover: linear-gradient(90deg, #a855f7, #4a6cf7);
    --al-buy-grad: linear-gradient(90deg, #2c3474, #47297a);
    --al-buy-grad-hover: linear-gradient(90deg, #353f8f, #573296);
    --al-buy-ring: inset 0 0 0 1px rgba(139, 124, 255, 0.55);
}

html.al-cart-lock,
html.al-cart-lock body {
    overflow: hidden;
}

/* ---------- Menu link ---------- */
.nav-links li.al-cart-nav a {
    gap: 0;
}

.al-cart-nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
    color: #c4c4d4;
    transition: color 0.4s ease;
}

.nav-links li.al-cart-nav a:hover .al-cart-nav-icon {
    color: var(--al-blue);
}

.al-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--al-grad);
    color: #fff;
    font: 700 11px/18px 'Roboto', sans-serif;
    text-align: center;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.5);
}

.al-cart-badge.is-empty {
    display: none;
}

.al-cart-badge.al-bump {
    animation: al-bump 0.45s ease;
}

@keyframes al-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* Floating cart button (pages without the menu) */
.al-cart-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    width: 52px;
    height: 52px;
    border: 1px solid var(--al-line);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--al-bg-1), var(--al-bg-2));
    color: var(--al-text);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.al-cart-fab .al-cart-badge {
    top: -4px;
    right: -4px;
}

/* ---------- Add to Cart buttons ----------
   ADD TO CART uses the bright blue→purple gradient;
   BUY NOW (below) uses a darker indigo→violet */
.al-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--al-cart-grad);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s ease;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(74, 108, 247, 0.3);
}

.al-add-cart:hover {
    background: var(--al-cart-grad-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(74, 108, 247, 0.4);
    color: #fff;
}

/* Already in the cart: dark with a blue outline and a check (click opens the cart) */
.al-add-cart.is-in-cart {
    background: rgba(30, 30, 50, 0.9);
    box-shadow: inset 0 0 0 2px #4a6cf7;
    color: #8fa4ff;
}

.al-add-cart.is-in-cart:hover {
    background: rgba(74, 108, 247, 0.15);
    color: #b3c2ff;
}

/* Above the big BUY NOW */
.al-add-cart--large {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin: 20px 0 -8px;
}

/* Bottom buttons: Add to Cart + Buy Now side by side, right-aligned */
.al-small-row {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.al-small-row .btn-buy-small {
    margin: 0;
}

.al-add-cart--small {
    max-width: 230px;
    padding: 12px 30px;
    font-size: 1rem;
    margin: 0;
}

/* Bundle pages (CompleteKontakt, VST-AU-Plugins): two smaller, identical buttons */
.purchase-box {
    height: auto;
    min-height: 250px;
}

.purchase-box .al-add-cart--large,
.purchase-box .btn-buy-large:not(.open-modal-btn) {
    width: 100%;
    max-width: 260px;
    box-sizing: border-box;
    padding: 11px 15px;
    font-size: 0.98rem;
    gap: 8px;
}

.purchase-box .al-add-cart--large {
    margin: 12px 0 0;
}

.purchase-box .btn-buy-large:not(.open-modal-btn) {
    margin: 10px 0 12px;
}

/* Plan boxes */
.al-add-cart--plan {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* Home page cards: square icon button */
.al-add-cart--icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 5px;
    font-size: 1rem;
    vertical-align: middle;
}

/* Floating Add to Cart (sits above the floating BUY NOW) */
.al-add-cart--float {
    position: fixed;
    right: 30px;
    bottom: 195px;
    z-index: 1000;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: bold;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(74, 108, 247, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.al-add-cart--float.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.al-add-cart--float.visible:hover {
    transform: translateY(-3px);
}

.al-add-cart--float.is-in-cart {
    background: #1a1a2e;
}

/* ---------- BUY NOW: darker indigo→violet ----------
   (Buttons that open the plan chooser keep their original bright look) */
.btn-buy-large:not(.open-modal-btn),
.btn-buy-small:not(.open-modal-btn),
.floating-buy-btn:not(.open-modal-btn),
.btn-plan,
.product-buttons .btn-buy {
    background: var(--al-buy-grad);
    box-shadow: var(--al-buy-ring);
}

.btn-buy-large:not(.open-modal-btn):hover,
.btn-buy-small:not(.open-modal-btn):hover,
.floating-buy-btn:not(.open-modal-btn):hover,
.btn-plan:hover,
.product-buttons .btn-buy:hover {
    background: var(--al-buy-grad-hover);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.8), 0 10px 25px rgba(74, 108, 247, 0.3);
}

/* ---------- Home page cards: Add to Cart replaces Buy Now ---------- */
.product-buttons .btn-buy.al-replaced {
    display: none !important;
}

.al-add-cart--card {
    display: inline-flex;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    gap: 8px;
    white-space: nowrap;
}

.al-add-cart--card:hover {
    transform: translateY(-3px);
}

/* ---------- Cart reminder: animates while the cart has items ---------- */
.al-cart-nav.has-items .al-cart-nav-icon i,
.al-cart-fab.has-items > i {
    color: #fff;
    animation: al-cart-wiggle 4s ease-in-out infinite;
    transform-origin: 50% 80%;
}

.al-cart-nav.has-items .al-cart-badge::after,
.al-cart-fab.has-items .al-cart-badge::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    border: 2px solid #a855f7;
    animation: al-cart-ring 2s ease-out infinite;
    pointer-events: none;
}

.al-cart-nav.has-items > a {
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.55);
}

@keyframes al-cart-wiggle {
    0%, 70%, 100% { transform: rotate(0) scale(1); }
    74% { transform: rotate(-14deg) scale(1.15); }
    78% { transform: rotate(12deg) scale(1.15); }
    82% { transform: rotate(-9deg) scale(1.1); }
    86% { transform: rotate(6deg) scale(1.05); }
    90% { transform: rotate(0) scale(1); }
}

@keyframes al-cart-ring {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Cart panel ---------- */
.al-cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 5, 15, 0.65);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.al-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.al-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    width: 400px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--al-bg-1) 0%, var(--al-bg-2) 100%);
    border-left: 1px solid var(--al-line);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    color: var(--al-text);
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    outline: none;
}

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

.al-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--al-line);
}

.al-cart-head h2 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.al-cart-head h2 i {
    background: var(--al-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.al-cart-count {
    font-size: 0.9rem;
    color: var(--al-muted);
    font-weight: 600;
}

.al-cart-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--al-line);
    border-radius: 8px;
    background: rgba(30, 30, 50, 0.7);
    color: var(--al-text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.al-cart-close:hover {
    color: var(--al-blue);
    border-color: var(--al-blue);
}

.al-cart-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.al-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(30, 30, 50, 0.7);
    border: 1px solid var(--al-line);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.al-cart-item:hover {
    border-color: rgba(74, 108, 247, 0.5);
}

.al-cart-item img {
    width: 84px;
    height: 56px;
    object-fit: contain;   /* show the whole interface */
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--al-bg-2);
}

.al-cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.al-cart-item-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #fff;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.al-cart-item-price {
    font-weight: 700;
    color: var(--al-blue);
}

.al-cart-remove {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--al-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.al-cart-remove:hover {
    color: #ff5c7a;
    background: rgba(255, 92, 122, 0.1);
}

.al-cart-empty {
    text-align: center;
    padding: 60px 10px;
    color: var(--al-muted);
}

.al-cart-empty i {
    font-size: 2.6rem;
    opacity: 0.4;
    margin-bottom: 14px;
}

.al-cart-empty p {
    margin: 0 0 18px;
    font-size: 1.05rem;
}

.al-cart-browse {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--al-blue);
    border-radius: 5px;
    color: var(--al-blue);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.al-cart-browse:hover {
    background: rgba(74, 108, 247, 0.1);
    transform: translateY(-3px);
}

.al-cart-foot {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--al-line);
    background: rgba(13, 13, 26, 0.6);
}

.al-cart-drawer.is-empty .al-cart-foot {
    display: none;
}

.al-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    color: #fff;
}

.al-cart-total {
    font-size: 1.4rem;
}

.al-cart-note {
    margin: 8px 0 14px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--al-muted);
}

.al-cart-error {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #ff5c7a;
}

.al-cart-error:empty {
    display: none;
}

.al-cart-checkout {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: var(--al-grad);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s ease;
}

.al-cart-checkout:hover:not(:disabled) {
    background: linear-gradient(90deg, #a855f7, #4a6cf7);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 108, 247, 0.4);
}

.al-cart-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.al-cart-checkout.is-loading {
    cursor: progress;
}

.al-cart-continue {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--al-muted);
    font-size: 0.92rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.al-cart-continue:hover {
    color: var(--al-blue);
}

/* ---------- Toast ---------- */
.al-cart-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 10002;
    transform: translate(-50%, 30px);
    opacity: 0;
    visibility: hidden;
    padding: 14px 22px;
    border: 1px solid var(--al-line);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--al-bg-1), var(--al-bg-2));
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.al-cart-toast.is-show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.al-cart-toast .fa-check {
    color: #2ecc71;
    margin-right: 6px;
}

.al-cart-toast-link {
    margin-left: 12px;
    font-weight: 700;
    background: var(--al-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .al-cart-nav-icon {
        width: 18px;
        height: 18px;
        margin-right: 8px;
        font-size: 0.95rem;
    }

    .al-small-row {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    /* matches the floating BUY NOW on mobile */
    .al-add-cart--float {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Bottom buttons stay side by side on phones */
    .al-small-row {
        flex-wrap: nowrap;
        gap: 10px;
    }
    .al-small-row > .al-add-cart--small,
    .al-small-row > .btn-buy-small {
        flex: 1 1 0;
        max-width: none;
        padding: 12px 8px;
        font-size: 0.9rem;
        gap: 6px;
        white-space: nowrap;
    }

    .al-cart-drawer {
        width: 100vw;
        border-left: none;
    }

    .al-cart-head,
    .al-cart-list,
    .al-cart-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .al-cart-toast {
        white-space: normal;
        width: calc(100vw - 32px);
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .al-cart-nav.has-items .al-cart-nav-icon i,
    .al-cart-fab.has-items > i,
    .al-cart-nav.has-items .al-cart-badge::after,
    .al-cart-fab.has-items .al-cart-badge::after {
        animation: none;
    }
    .al-cart-drawer,
    .al-cart-overlay,
    .al-cart-toast,
    .al-add-cart {
        transition: none;
    }
}
