/* ── Sliding Cart Panel ─────────────────────────────────────────────────────── */
.sliding-cart-trigger { cursor: pointer; padding: 0 12px; }

.sliding-cart-panel {
    position: fixed; top: 0; right: -400px; width: 400px; height: 100vh;
    background: #fff; box-shadow: -5px 0 15px rgba(0,0,0,.1); z-index: 1000;
    transition: right .3s ease; display: flex; flex-direction: column;
}
.sliding-cart-panel.active { right: 0; }

.sliding-cart-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
    opacity: 0; visibility: hidden; transition: all .3s ease;
}
.sliding-cart-overlay.active { opacity: 1; visibility: visible; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.cart-header {
    padding: 8px 20px; border-bottom: 1px solid #eee; display: flex;
    justify-content: space-between; align-items: center; flex-shrink: 0;
}
.cart-header-content { display: flex; align-items: center; }
.cart-header h3      { margin: 0; font-size: 18px; font-weight: 600; }

.close-cart {
    background: none; border: none; font-size: 24px; cursor: pointer; padding: 5px; color: #666;
}
.close-cart:hover { color: #000; }

/* ── Cart items ─────────────────────────────────────────────────────────────── */
.cart-items { flex: 1; overflow: hidden; padding: 20px; min-height: 300px; }
.cart-items.scrollable  { overflow-y: auto; }
.cart-items:has(.empty-cart) { display: flex; align-items: center; justify-content: center; }

.cart-item {
    display: flex; align-items: flex-start; gap: 15px; padding: 15px 0;
    border-bottom: 1px solid #eee; position: relative;
}
.cart-item:last-child { border-bottom: none; }

.item-image { flex-shrink: 0; }
.item-image img { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; }

.item-details   { flex: 1; }
.item-details h4 { margin: 0 0 5px; font-size: 16px; font-weight: 400; }

.item-attributes .attribute { display: block; font-size: 12px; color: #666; margin: 2px 0; }

/* NATIVE WOOCOMMERCE VARIATIONS + 3RD PARTY PLUGIN METADATA FIX */
.item-attributes dl.variation { 
    display: flex; flex-direction: column; gap: 4px; border: none;
    margin: 5px 0 10px 0; padding: 0; font-size: 12px; color: #666; 
}
.item-attributes dl.variation p { margin: 0; display: inline-block; }
.item-attributes dl.variation img { max-width: 65px !important; height: auto !important; border: 1px solid #ddd; border-radius: 4px; margin-top: 4px; display: block;}
.item-attributes dl.variation dt { font-weight: 600; color: #444; margin: 0; padding: 0;}
.item-attributes dl.variation dd { margin: 0 0 4px 0; padding: 0;}

.item-price { font-weight: 700; color: #710014; font-size: 18px; margin-top: 5px; }

.remove-item {
    position: absolute; top: 15px; right: 0; background: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0; transition: opacity .2s;
}
.remove-item:hover { opacity: .6; }

/* ── Quantity controls ──────────────────────────────────────────────────────── */
.quantity-controls { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.quantity-btn { background: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: opacity .2s;}
.quantity-btn:hover { opacity: .6; }
.quantity-display { min-width: 20px; text-align: center; font-weight: 600; font-size: 18px; color: #000; }

/* ── Footer / Order Collapsible Summary ──────────────────────────────────────── */
.cart-footer { padding: 16px 20px 20px; border-top: 1px solid #eee; flex-shrink: 0; background: #fff;}

.cart-collapsible-summary {
    border: 1px solid #eaeaea; border-radius: 8px; background: #fff; margin-bottom: 12px;
}
.summary-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; cursor: pointer; background: #fafafa; border-radius: 8px; transition: background 0.2s;
    user-select: none;
}
.summary-header:hover { background: #f0f0f0; }

.summary-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: #000; }
.summary-title .title-icon { stroke: #000; fill: none; pointer-events: none;}
.summary-title .chevron-icon { transition: transform 0.3s ease; stroke: #000; pointer-events: none;}
.summary-header.open .summary-title .chevron-icon { transform: rotate(180deg); }

.summary-header-rt { text-align: right; line-height: 1.2; pointer-events: none;}

/* THEME PRICE COLOR OVERRIDES (Fix for white text) */
.cart-collapsible-summary .woocommerce-Price-amount { color: #000 !important; }
.cart-collapsible-summary .woocommerce-Price-currencySymbol { color: inherit !important; }

.summary-header-rt .old-price,
.summary-header-rt .old-price .woocommerce-Price-amount { font-size: 12px; color: #999 !important; text-decoration: line-through; margin-right: 4px; }

.summary-header-rt .final-price { font-weight: 700; font-size: 16px; color: #000; }
.summary-header-rt .saving-badge { font-size: 11px; color: #00a859; font-weight: 700; display: block;}

.summary-details-content { padding: 15px; border-top: 1px solid #eaeaea; background: #fafafa; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: #555; }
.summary-row .label { color: #666; }
.summary-row .value { color: #000; font-weight: 500; }

.summary-row.title-row { margin-bottom: 12px; color: #000; align-items: center;}
.summary-row.title-row strong { font-size: 15px; font-weight: 700; }

.saved-so-far { background: #e6f6ec; color: #00a859; font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 600; }

.summary-row.type-discount .label { color: #00a859; }
.summary-row.type-discount .value,
.summary-row.type-discount .value .woocommerce-Price-amount { color: #00a859 !important; font-weight: 600;}

.summary-row .label.bold { font-weight: 700; color: #000; }
.summary-row .value.bold,
.summary-row .value.bold .woocommerce-Price-amount { font-weight: 700; color: #00a859 !important; }

.summary-row.border-top { border-top: 1px dashed #ddd; padding-top: 10px; margin-top: 10px; }
.summary-divider { height: 1px; background: #eaeaea; margin: 12px 0; }
.summary-row.final-total { margin-bottom: 0; font-size: 16px; font-weight: 700; color: #000; }
.summary-row.final-total .label { color: #666; font-weight: 600;}

/* ── Custom Checkout Button ─────────────────────────────────────────────────── */
.custom-checkout-btn-advanced {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; 
    background: #4caf50; /* Changed to Green */
    color: #fff; text-decoration: none;
    border-radius: 8px; transition: background 0.2s ease; width: 100%; box-sizing: border-box;
}
.custom-checkout-btn-advanced:hover { 
    background: #388e3c; /* Darker Green on Hover */
    color: #fff; 
}

.ccr-left { display: flex; flex-direction: column; gap: 4px;}
.ccr-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; color: #fff; }
.ccr-subtitle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #e8f5e9; font-weight: 400; } /* Soft light green subtitle */
.ccr-title svg, .ccr-subtitle svg { flex-shrink: 0; }

.ccr-right { display: flex; align-items: center; justify-content: center; }
.checkout-brand-icons { height: 26px; width: auto; max-width: 140px;}

/* ── Empty cart ─────────────────────────────────────────────────────────────── */
.empty-cart { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: #666; font-style: italic; padding: 40px 20px; }
.empty-cart-icon { width: 80px; height: 80px; margin-bottom: 20px; opacity: .7; }
.empty-cart p    { margin: 0; font-size: 16px; }

/* ── Loader overlay (remove-item) ───────────────────────────────────────────── */
#cart-loader {
    position: absolute; inset: 0; background: rgba(255,255,255,.65);
    display: flex; align-items: center; justify-content: center; z-index: 10; pointer-events: none;
}
.cart-spinner {
    width: 32px; height: 32px; border: 3px solid #ddd;
    border-top-color: #000; border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cart icon SVGs ─────────────────────────────────────────────────────────── */
.cart-icon-svg { width: 32px; height: auto; color: #01082f; }
.cart-header-icon { display: flex; align-items: center; margin-right: 8px; }
.cart-header-svg  { width: 30px; height: 30px; }
.close-cart-icon  { width: 40px; height: 40px; display: block; }
.qty-icon         { width: 20px; height: 20px; display: block; }
.remove-icon      { width: 20px; height: 20px; display: block; }
.empty-cart-icon svg { width: 80px; height: 80px; opacity: .7; }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sliding-cart-panel { width: 100%; right: -100%; }
    .cart-items { height: calc(100vh - 160px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .cart-footer { background: #fff; }
    .cart-icon-svg    { width: 37px; }
    .empty-cart-icon  { width: 60px; height: 60px; margin-bottom: 15px; }
    .empty-cart p     { font-size: 14px; }
    .sliding-cart-trigger { padding: 0 9px; font-size: 14px; }
}