/* =========================================================================
   Cart Drawer — Premium Slide-Out
   ========================================================================= */

/* Overlay */
.ohcart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Drawer */
.ohcart {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100%;
    z-index: 99999;
    background: var(--bg-primary, #fff);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
}

.ohcart.is-open {
    transform: translateX(0);
}

/* Header */
.ohcart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--gold-500, #D4A843);
    flex-shrink: 0;
}

.ohcart-header__title {
    font-family: var(--font-heading, 'DM Serif Display', serif);
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary, #1A1A1A);
}

.ohcart-header__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary, #4A4A4A);
    transition: background 0.2s ease, color 0.2s ease;
}

.ohcart-header__close:hover {
    background: var(--bg-secondary, #FAF8F5);
    color: var(--text-primary, #1A1A1A);
}

/* S20: Min quantity info banner */
.ohcart-min-qty-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: rgba(201, 168, 76, 0.08);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    font-size: 0.8rem;
    color: #8b7340;
    flex-shrink: 0;
}

.ohcart-min-qty-banner svg {
    flex-shrink: 0;
    stroke: #c9a84c;
}

/* Progress Bar */
.ohcart-progress {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary, #FAF8F5);
    flex-shrink: 0;
}

.ohcart-progress__text {
    font-size: 0.82rem;
    color: var(--text-secondary, #4A4A4A);
    margin: 0 0 0.5rem;
    text-align: center;
}

.ohcart-progress__text--done {
    color: var(--accent-success, #43A047);
    font-weight: 600;
}

.ohcart-progress__bar {
    height: 6px;
    background: var(--border-default, rgba(0, 0, 0, 0.08));
    border-radius: 3px;
    overflow: hidden;
}

.ohcart-progress__fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--gold-400, #E8C547), var(--gold-600, #B8922F));
    transition: width 0.5s ease;
}

/* Scrollable Body */
.ohcart-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Empty State */
.ohcart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    gap: 1rem;
}

.ohcart-empty__text {
    font-size: 1rem;
    color: var(--text-muted, #888);
    margin: 0;
}

.ohcart-empty__btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--gold-500, #D4A843);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ohcart-empty__btn:hover {
    background: var(--gold-600, #B8922F);
    box-shadow: 0 4px 16px rgba(212, 168, 67, 0.3);
    color: #fff;
}

/* Product Item */
.ohcart-item {
    position: relative;
    display: flex;
    gap: 0.875rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    transition: opacity 0.3s ease;
}

.ohcart-item.is-removing {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ohcart-item.is-loading {
    pointer-events: none;
}

.ohcart-item.is-loading .ohcart-item__spinner {
    display: flex;
}

/* Remove button */
.ohcart-item__remove {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted, #888);
    border-radius: 4px;
    padding: 0;
    transition: color 0.2s ease, background 0.2s ease;
}

.ohcart-item__remove:hover {
    color: var(--accent-danger, #C0392B);
    background: rgba(192, 57, 43, 0.08);
}

/* Thumbnail */
.ohcart-item__thumb {
    flex-shrink: 0;
    display: block;
}

.ohcart-item__thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-secondary, #FAF8F5);
}

/* Info */
.ohcart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1.5rem;
}

.ohcart-item__name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #1A1A1A);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
}

.ohcart-item__name:hover {
    color: var(--gold-500, #D4A843);
}

.ohcart-item__variant {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.3;
}

/* Color swatch dot */
.ohcart-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* Bottom row: qty + price */
.ohcart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
}

/* Quantity controls */
.ohcart-item__qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    border-radius: 6px;
    overflow: hidden;
}

.ohcart-item__qty-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary, #4A4A4A);
    transition: background 0.15s ease;
    padding: 0;
    line-height: 1;
}

.ohcart-item__qty-btn:hover {
    background: var(--bg-secondary, #FAF8F5);
}

.ohcart-item__qty-val {
    width: 32px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A);
    border-left: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    border-right: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    line-height: 30px;
}

.ohcart-item__qty-static {
    font-size: 0.82rem;
    color: var(--text-muted, #888);
}

/* Price */
.ohcart-item__price {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary, #1A1A1A);
    white-space: nowrap;
}

/* Loading spinner */
.ohcart-item__spinner {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0;
    z-index: 2;
}

.ohcart-item__spinner svg {
    animation: ohcart-spin 0.8s linear infinite;
}

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

/* Footer (fixed bottom) */
.ohcart-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    background: var(--bg-primary, #fff);
}

/* Coupon Section */
.ohcart-coupon {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
}

.ohcart-coupon__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary, #4A4A4A);
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.ohcart-coupon__toggle:hover {
    color: var(--gold-500, #D4A843);
}

.ohcart-coupon__toggle svg {
    transition: transform 0.2s ease;
}

.ohcart-coupon__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.ohcart-coupon__form {
    display: none;
    margin-top: 0.75rem;
}

.ohcart-coupon__form.is-open {
    display: block;
}

.ohcart-coupon__input-wrap {
    display: flex;
    gap: 0.5rem;
}

.ohcart-coupon__input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1A1A1A);
    outline: none;
    transition: border-color 0.2s ease;
}

.ohcart-coupon__input:focus {
    border-color: var(--gold-500, #D4A843);
}

.ohcart-coupon__apply {
    padding: 0.5rem 1rem;
    background: var(--text-primary, #1A1A1A);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.ohcart-coupon__apply:hover {
    background: var(--text-secondary, #4A4A4A);
}

.ohcart-coupon__msg {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.ohcart-coupon__msg.is-success {
    color: var(--accent-success, #43A047);
}

.ohcart-coupon__msg.is-error {
    color: var(--accent-danger, #C0392B);
}

/* Applied coupons */
.ohcart-coupons-applied {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ohcart-coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.25);
    border-radius: 4px;
    font-size: 0.78rem;
}

.ohcart-coupon-tag__code {
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gold-600, #B8922F);
}

.ohcart-coupon-tag__discount {
    color: var(--accent-success, #43A047);
    font-weight: 600;
}

.ohcart-coupon-tag__remove {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted, #888);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.15rem;
    transition: color 0.15s ease;
}

.ohcart-coupon-tag__remove:hover {
    color: var(--accent-danger, #C0392B);
}

/* Summary */
.ohcart-summary {
    padding: 0.75rem 1.5rem;
}

.ohcart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.88rem;
    color: var(--text-secondary, #4A4A4A);
}

.ohcart-summary__row:first-child {
    padding-top: 0;
}

.ohcart-summary__row strong {
    color: var(--text-primary, #1A1A1A);
}

.ohcart-summary__netto {
    font-size: 1.05rem;
}

.ohcart-summary__row--brutto {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.ohcart-summary__row--discount {
    color: var(--accent-success, #43A047);
}

.ohcart-summary__row--shipping {
    font-size: 0.82rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    margin-top: 0.35rem;
}

/* Trust Signals */
.ohcart-trust {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border-default, rgba(0, 0, 0, 0.08));
    overflow: hidden;
}

.ohcart-trust__item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    color: var(--text-muted, #888);
}

.ohcart-trust__item svg {
    flex-shrink: 0;
}

/* CTA Buttons */
.ohcart-cta {
    padding: 0.75rem 1.5rem 1rem;
}

.ohcart-cta__primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: var(--gold-500, #D4A843);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ohcart-cta__primary:hover {
    background: var(--gold-600, #B8922F);
    box-shadow: 0 4px 16px rgba(212, 168, 67, 0.35);
    color: #fff;
}

.ohcart-cta__secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A);
    text-decoration: none;
    border: 2px solid var(--text-primary, #1A1A1A);
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ohcart-cta__secondary:hover {
    background: var(--text-primary, #1A1A1A);
    color: #fff;
}

/* =========================================================================
   Mobile (< 768px)
   ========================================================================= */

@media (max-width: 767px) {
    .ohcart {
        width: 100vw;
    }

    .ohcart-header {
        padding: 1rem 1rem;
    }

    .ohcart-progress {
        padding: 0.6rem 1rem;
    }

    .ohcart-item {
        padding: 0.875rem 1rem;
    }

    .ohcart-item__qty-btn {
        width: 36px;
        height: 36px;
    }

    .ohcart-item__qty-val {
        width: 36px;
        line-height: 36px;
    }

    .ohcart-coupon,
    .ohcart-summary,
    .ohcart-cta {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .ohcart-trust {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .ohcart-trust__item {
        font-size: 0.6rem;
    }

    .ohcart-cta__primary {
        height: 52px;
        font-size: 0.95rem;
    }
}

/* =========================================================================
   Scrollbar Styling
   ========================================================================= */

.ohcart-body::-webkit-scrollbar {
    width: 4px;
}

.ohcart-body::-webkit-scrollbar-track {
    background: transparent;
}

.ohcart-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}

.ohcart-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* =========================================================================
   Hide old mini-cart elements
   ========================================================================= */

.mini-cart-dropdown,
.mini-cart-overlay,
.mini-cart-panel {
    display: none !important;
}
