/* ================================================================
   PFD Side Cart — pfds.css
   Version: 1.0.0
================================================================ */

:root {
    --pfds-primary:       #CC3872;
    --pfds-primary-hover: #a82e5e;
    --pfds-text:          #1a1a1a;
    --pfds-muted:         #666666;
    --pfds-border:        #e0e0e0;
    --pfds-bg:            #ffffff;
    --pfds-drawer-width:  420px;
    --pfds-radius:        12px;
    --pfds-transition:    0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Overlay ── */
.pfds-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--pfds-transition);
}
.pfds-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Drawer ── */
.pfds-drawer {
    position: fixed;
    top: 0;
    right: calc(-1 * var(--pfds-drawer-width) - 20px);
    width: var(--pfds-drawer-width);
    max-width: 92vw;
    height: 100%;
    background: var(--pfds-bg);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    transition: right var(--pfds-transition);
}
.pfds-drawer.open {
    right: 0;
}

/* ── Header ── */
.pfds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--pfds-primary);
    background: var(--pfds-primary);
    flex-shrink: 0;
}
.pfds-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pfds-bag-icon {
    width: 22px;
    height: 22px;
    color: #fff;
}
.pfds-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.pfds-count-header {
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pfds-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}
.pfds-close:hover {
    background: rgba(255,255,255,0.35);
}

/* ── Body ── */
.pfds-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    position: relative;
}
.pfds-body.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}

/* ── Empty State ── */
.pfds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    height: 100%;
    min-height: 300px;
}
.pfds-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}
.pfds-empty-text {
    font-size: 18px;
    color: var(--pfds-muted);
    margin: 0 0 24px;
}
.pfds-shop-btn {
    background: var(--pfds-primary);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}
.pfds-shop-btn:hover {
    background: var(--pfds-primary-hover) !important;
    color: #fff !important;
}

/* ── Items List ── */
.pfds-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pfds-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--pfds-border);
    position: relative;
    transition: background 0.15s;
}
.pfds-item:last-child {
    border-bottom: none;
}
.pfds-item:hover {
    background: #fafafa;
}
.pfds-item-thumb-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--pfds-border);
    background: #f5f5f5;
}
.pfds-item-thumb,
.pfds-item-thumb-wrap img {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain !important;
    display: block;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    float: none !important;
}
.pfds-item-details {
    flex: 1;
    min-width: 0;
    padding-right: 28px;
}
.pfds-item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pfds-text) !important;
    text-decoration: none !important;
    margin-bottom: 4px;
    line-height: 1.3;
}
.pfds-item-name:hover {
    color: var(--pfds-primary) !important;
}
.pfds-item-meta {
    display: block;
    font-size: 12px;
    color: var(--pfds-muted);
    margin-bottom: 2px;
}
.pfds-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.pfds-item-qty {
    font-size: 13px;
    color: var(--pfds-muted);
}
.pfds-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--pfds-primary);
}
.pfds-remove {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 26px;
    height: 26px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    color: #999 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border: none;
}
.pfds-remove:hover {
    background: #ffebeb !important;
    color: #cc0000 !important;
}
.pfds-remove.removing {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Footer ── */
.pfds-footer {
    flex-shrink: 0;
    border-top: 2px solid var(--pfds-border);
    padding: 20px 24px;
    background: #fafafa;
}
.pfds-totals {
    margin-bottom: 16px;
}
.pfds-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--pfds-text);
}
.pfds-footer-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pfds-view-cart-btn {
    display: block;
    text-align: center;
    padding: 13px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    border: 2px solid var(--pfds-primary);
    color: var(--pfds-primary) !important;
    background: transparent;
    transition: all 0.2s;
}
.pfds-view-cart-btn:hover {
    background: var(--pfds-primary) !important;
    color: #fff !important;
}
.pfds-checkout-btn {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    background: var(--pfds-primary);
    color: #fff !important;
    transition: background 0.2s;
    box-shadow: 0 4px 15px rgba(204, 56, 114, 0.3);
}
.pfds-checkout-btn:hover {
    background: var(--pfds-primary-hover) !important;
    color: #fff !important;
}

/* ── Floating Button ── */
.pfds-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--pfds-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    box-shadow: 0 4px 20px rgba(204, 56, 114, 0.45);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    padding: 0;
}
.pfds-floating-btn:hover {
    background: var(--pfds-primary-hover);
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(204, 56, 114, 0.55);
}
.pfds-floating-btn svg {
    width: 26px;
    height: 26px;
    color: #fff;
    stroke: #fff;
}
.pfds-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: var(--pfds-primary);
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pfds-primary);
    line-height: 1;
    padding: 0 3px;
}

/* ================================================================
   HIDE LEGACY SIDE CART (developer's version — replaced by this plugin)
================================================================ */
#openSideCart,
#cartDrawer,
#cartOverlay,
.floating-cart-btn,
.side-cart-overlay,
.side-cart-drawer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    :root {
        --pfds-drawer-width: 100vw;
    }
    .pfds-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}
