/* ROOT OVERLAY + PANEL */
.wpfc-sidecart-root {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.2s ease;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wpfc-sidecart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wpfc-sidecart-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 360px;
    max-width: 100%;
    background: #ffffff;
    box-shadow: -4px 0 14px rgba(15,23,42,0.16);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.wpfc-sidecart-header {
    padding: 14px 16px;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpfc-sidecart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wpfc-sidecart-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
}

.wpfc-sidecart-close:hover {
    color: #ef4444;
}

/* BODY */
.wpfc-sidecart-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 10px 12px;
}

/* EMPTY MESSAGE */
.wpfc-sidecart-empty {
    margin: 12px 6px;
    font-size: 14px;
    color: #6b7280;
}

/* ITEM CARDS – DIV-BASED, NO TABLES */
.wpfc-sidecart-body .wpfc-cart-row {
    display: flex;
    flex-direction: column;
    margin: 0 0 10px;
    padding: 8px 8px 10px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.12);
    border: 1px solid #f3f4f6;
    box-sizing: border-box;
}

/* PRODUCT BLOCK */
.wpfc-sidecart-body .wpfc-cart-product {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.wpfc-sidecart-body .wpfc-cart-thumb img {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
}

.wpfc-sidecart-body .wpfc-cart-title {
    font-size: 14px;
    margin-bottom: 1px;
    text-decoration: none;
    color: #111827;
    display: inline-block;
}

.wpfc-sidecart-body .wpfc-cart-title:hover {
    text-decoration: underline;
}

.wpfc-sidecart-body .wpfc-cart-sku,
.wpfc-sidecart-body .wpfc-opt-line {
    font-size: 12px;
    color: #4b5563;
}

.wpfc-sidecart-body .wpfc-cart-options-list {
    margin-top: 2px;
}

.wpfc-sidecart-body .wpfc-artwork-btn {
    margin-top: 4px;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
}

/* MINI ROW: QTY | UNIT | SUBTOTAL | REMOVE */
.wpfc-sidecart-body .wpfc-mini-row {
    display: flex;
    border-top: 1px solid #f1f3f5;
    padding-top: 4px;
    margin-top: 4px;
}

.wpfc-sidecart-body .wpfc-mini-row .cell {
    flex: 1 1 25%;
    text-align: center;
    padding: 4px 2px 2px;
    box-sizing: border-box;
    font-size: 13px;
}

/* LABELS */
.wpfc-sidecart-body .wpfc-mini-row .wpfc-label {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

/* QTY INPUT */
.wpfc-sidecart-body .wpfc-qty-wrap {
    display: flex;
    justify-content: center;
}

.wpfc-sidecart-body .wpfc-qty {
    width: 52px;
    font-size: 13px;
}

/* UNIT & SUBTOTAL */
.wpfc-sidecart-body .wpfc-unit,
.wpfc-sidecart-body .wpfc-subtotal {
    white-space: nowrap;
}

/* REMOVE BUTTON — Modern Icon Style */
.wpfc-sidecart-body .wpfc-remove {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6; /* Light gray background */
    color: #6b7280;      /* Icon color */
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.wpfc-sidecart-body .wpfc-remove:hover {
    background: #ef4444; /* Red hover */
    color: #ffffff;      /* White icon */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: scale(1.1);
}

/* FOOTER */
.wpfc-sidecart-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid #edf0f3;
    background: #ffffff;
}

.wpfc-sidecart-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.wpfc-sidecart-total-label,.wpfc-sidecart-discount-label,.wpfc-sidecart-subtotal-label,.wpfc-sidecart-values {
    font-size: 13px;
    color: #6b7280;
}

.wpfc-sidecart-total-amount {
    font-size: 17px;
    font-weight: 600;
}

/* FOOTER BUTTONS */
.wpfc-sidecart-buttons {
    display: flex;
    gap: 8px;
}

.wpfc-sidecart-view-cart,
.wpfc-sidecart-checkout {
    flex: 1 1 50%;
    text-align: center;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.wpfc-sidecart-view-cart {
    border: 1px solid #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.wpfc-sidecart-view-cart:hover {
    background: #f3f4ff;
}

.wpfc-sidecart-checkout {
    border: none;
    background: #2563eb;
    color: #ffffff;
}

.wpfc-sidecart-checkout:hover {
    background: #1d4ed8;
}

/* TOGGLE BUTTON */
.wpfc-sidecart-toggle {
    position: fixed;
    right: 18px;
    bottom: 120px;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: none;
    box-shadow: 0 4px 10px rgba(15,23,42,0.25);
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpfc-sidecart-toggle-count {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}

/* OPEN STATE */
.wpfc-sidecart-root.is-open {
    pointer-events: auto;
    visibility: visible;
}

.wpfc-sidecart-root.is-open .wpfc-sidecart-backdrop {
    opacity: 1;
}

.wpfc-sidecart-root.is-open .wpfc-sidecart-panel {
    transform: translateX(0);
}

/* MOBILE: FULL-WIDTH DRAWER */
@media (max-width: 600px) {
    .wpfc-sidecart-panel {
        width: 100%;
        border-radius: 0;
    }
}

/* RESPECT WP ADMIN BAR */
.admin-bar .wpfc-sidecart-root {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .wpfc-sidecart-root {
        top: 46px; /* taller admin bar on small screens */
    }
}

/* Adjust panel/backdrop height when shifted */
.admin-bar .wpfc-sidecart-panel {
    height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .wpfc-sidecart-panel {
        height: calc(100% - 46px);
    }
}

.admin-bar .wpfc-sidecart-backdrop {
    top: 0; /* root already shifted; backdrop covers below bar */
}

/* SweetAlert Styling - Make modals larger and more readable */
.swal2-popup {
    font-size: 16px;
}
