/* ================================================================
   Tolbod — Cart Panel
   child-theme/cart-panel/cart-panel.css
   ================================================================ */

:root {
    --tb-cp-width: 440px;
}

/* ── OVERLAY ── */
.tb-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 31, 20, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 360ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tb-cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── PANEL ── */
.tb-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--tb-cp-width);
    max-width: 100vw;
    background: #F9F5F0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 420ms cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: -8px 0 40px rgba(44, 31, 20, 0.12), -2px 0 8px rgba(44, 31, 20, 0.06);
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
    color: #2C1F14;
}
.tb-cart-panel.open {
    transform: translateX(0);
}

/* ── HEADER ── */
.tb-cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.6rem 1.2rem;
    border-bottom: 1px solid rgba(44, 31, 20, 0.08);
    flex-shrink: 0;
    background: #F9F5F0;
}
.tb-cp-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}
.tb-cp-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #2C1F14;
}
.tb-cp-count {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(44, 31, 20, 0.4);
    letter-spacing: 0.02em;
}
.tb-cp-close {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    background: rgba(44, 31, 20, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(44, 31, 20, 0.55);
    transition: background 180ms ease, color 180ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
    flex-shrink: 0;
	padding:0;
}
.tb-cp-close svg { width: 16px !important; height: 16px !important; }
@media (hover: hover) and (pointer: fine) {
    .tb-cp-close:hover {
        background: rgba(44, 31, 20, 0.12);
        color: #2C1F14;
    }
    .tb-cp-close:active { transform: scale(0.9); }
}

/* ── SHIPPING PROGRESS BAR ── */
.tb-cp-shipping-bar {
    padding: 0.9rem 1.6rem;
    border-bottom: 1px solid rgba(44, 31, 20, 0.06);
    flex-shrink: 0;
    background: white;
}
.tb-cp-shipping-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: rgba(44, 31, 20, 0.6);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}
.tb-cp-shipping-text svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: #A07850;
}
.tb-cp-shipping-text strong { color: #2C1F14; font-weight: 600; }
.tb-cp-shipping-text.done { color: #5a9c5a; }
.tb-cp-shipping-text.done svg { stroke: #5a9c5a; }
.tb-cp-shipping-track {
    height: 3px;
    border-radius: 100px;
    background: rgba(44, 31, 20, 0.1);
    overflow: hidden;
}
.tb-cp-shipping-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, #C9A882, #D4875A);
    transition: width 600ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tb-cp-shipping-fill.done {
    background: linear-gradient(90deg, #7BC47B, #5a9c5a);
}

/* ── ITEMS SCROLL AREA ── */
.tb-cp-items {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0.8rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(44, 31, 20, 0.15) transparent;
}
.tb-cp-items::-webkit-scrollbar { width: 4px; }
.tb-cp-items::-webkit-scrollbar-track { background: transparent; }
.tb-cp-items::-webkit-scrollbar-thumb { background: rgba(44, 31, 20, 0.15); border-radius: 2px; }

/* ── SINGLE ITEM ── */
.tb-cp-item {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(44, 31, 20, 0.07);
    align-items: flex-start;
    animation: tb-cp-item-in 320ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.tb-cp-item:last-child { border-bottom: none; }

@keyframes tb-cp-item-in {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.tb-cp-item-removing {
    animation: tb-cp-item-out 280ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
    pointer-events: none;
}
@keyframes tb-cp-item-out {
    to { opacity: 0; transform: translateX(16px); max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Billede */
.tb-cp-item-img-wrap {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: #EDE5D8;
    display: block;
}
.tb-cp-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
    .tb-cp-item-img-wrap:hover .tb-cp-item-img { transform: scale(1.06); }
}

/* Item body */
.tb-cp-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.tb-cp-item-brand {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(44, 31, 20, 0.38);
}
.tb-cp-item-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: #2C1F14;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .tb-cp-item-name:hover { color: #D4875A; }
}
.tb-cp-item-sku {
    font-size: 0.68rem;
    color: rgba(44, 31, 20, 0.3);
}

/* ── GP BEREGNER CHIPS ── */
.tb-cp-gp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.4rem 0 0.25rem;
}
.tb-cp-gp-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 0.28rem 0.6rem;
    background: #F5EFE6;
    border: 1px solid rgba(44, 31, 20, 0.08);
    border-radius: 8px;
    gap: 0.05rem;
}
.tb-cp-gp-chip-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(44, 31, 20, 0.35);
    line-height: 1;
}
.tb-cp-gp-chip-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2C1F14;
    line-height: 1.2;
}

/* Footer row: pris + slet */
.tb-cp-item-footer {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.5rem;
}

/* Pris */
.tb-cp-item-price {
    flex: 1;
    font-family: 'Playfair Display', serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #2C1F14;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.tb-cp-item-price del {
    font-size: 0.72rem;
    color: rgba(44, 31, 20, 0.35);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    margin-right: 0.2rem;
    text-decoration: line-through;
}
.tb-cp-item-price ins {
    text-decoration: none;
    color: #D4875A;
}

/* X fjern-knap */
.tb-cp-remove {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    border: none;
    background: rgba(44, 31, 20, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(44, 31, 20, 0.35);
    flex-shrink: 0;
	padding:0;
    transition: background 160ms ease, color 160ms ease, transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tb-cp-remove svg { width: 12px; height: 12px; }
@media (hover: hover) and (pointer: fine) {
    .tb-cp-remove:hover {
        background: rgba(200, 60, 60, 0.12);
        color: #c44;
    }
    .tb-cp-remove:active { transform: scale(0.88); }
}

/* ── TOM KURV ── */
.tb-cp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    flex: 1;
    animation: tb-cp-item-in 340ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.tb-cp-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: #EDE5D8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
}
.tb-cp-empty-icon svg {
    width: 30px;
    height: 30px;
    stroke: #A07850;
}
.tb-cp-empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #2C1F14;
    margin-bottom: 0.4rem;
}
.tb-cp-empty-sub {
    font-size: 0.85rem;
    color: rgba(44, 31, 20, 0.45);
    line-height: 1.6;
    margin-bottom: 1.8rem;
}
.tb-cp-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    background: #2C1F14;
    color: white;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 200ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tb-cp-empty-btn svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
    .tb-cp-empty-btn:hover { background: #D4875A; }
    .tb-cp-empty-btn:active { transform: scale(0.96); }
}

/* ── FOOTER ── */
.tb-cp-footer {
    flex-shrink: 0;
    padding: 1.2rem 1.6rem 1.6rem;
    border-top: 1px solid rgba(44, 31, 20, 0.08);
    background: white;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tb-cp-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}
.tb-cp-subtotal-label {
    font-size: 0.82rem;
    color: rgba(44, 31, 20, 0.5);
    font-weight: 400;
}
.tb-cp-subtotal-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #2C1F14;
    letter-spacing: -0.02em;
}
.tb-cp-subtotal-note {
    font-size: 0.7rem;
    color: rgba(44, 31, 20, 0.35);
    margin-bottom: 0.6rem;
}
.tb-cp-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.6rem;
    background: linear-gradient(135deg, #2C1F14 0%, #4A3020 100%);
    color: white;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 220ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 220ms ease;
    box-shadow: 0 4px 16px rgba(44, 31, 20, 0.2), 0 1px 3px rgba(44, 31, 20, 0.12);
}
.tb-cp-btn-checkout svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
    .tb-cp-btn-checkout:hover {
        background: linear-gradient(135deg, #D4875A 0%, #B86E3E 100%);
        box-shadow: 0 8px 24px rgba(212, 135, 90, 0.35), 0 2px 6px rgba(44, 31, 20, 0.12);
        transform: translateY(-1px);
    }
    .tb-cp-btn-checkout:active { transform: scale(0.97); }
}
.tb-cp-btn-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.6rem;
    background: transparent;
    color: rgba(44, 31, 20, 0.55);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 180ms ease, background 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .tb-cp-btn-cart:hover {
        color: #2C1F14;
        background: rgba(44, 31, 20, 0.04);
    }
}

/* ── LOADING OVERLAY ── */
.tb-cp-loading {
    position: absolute;
    inset: 0;
    background: rgba(249, 245, 240, 0.75);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}
.tb-cp-loading.active {
    opacity: 1;
    pointer-events: auto;
}
.tb-cp-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(44, 31, 20, 0.12);
    border-top-color: #D4875A;
    border-radius: 50%;
    animation: tb-cp-spin 700ms linear infinite;
}
@keyframes tb-cp-spin { to { transform: rotate(360deg); } }

/* ── REDUCE MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .tb-cart-panel,
    .tb-cart-overlay,
    .tb-cp-item,
    .tb-cp-shipping-fill {
        transition: none !important;
        animation: none !important;
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    :root { --tb-cp-width: 100vw; }
    .tb-cart-panel { border-radius: 0; }
}