/* ==========================================================================
   PRACTICAL CART DRAWER
   Primary : #111111  |  Accent : #D35228
   ========================================================================== */

/* ── Custom properties ────────────────────────────────────────────────────── */
:root {
    --pcd-primary  : #111111;
    --pcd-accent   : #D35228;
    --pcd-white    : #ffffff;
    --pcd-grey1    : #f6f6f6;
    --pcd-grey2    : #e8e8e8;
    --pcd-grey3    : #aaaaaa;
    --pcd-text     : #1a1a1a;
    --pcd-text2    : #666666;
    --pcd-panel-w  : 420px;
    --pcd-z        : 100000;
    --pcd-ease     : cubic-bezier(0.4, 0, 0.2, 1);
    --pcd-radius   : 4px;
}

/* ── Box-sizing reset ─────────────────────────────────────────────────────── */
.pcd-drawer *,
.pcd-drawer *::before,
.pcd-drawer *::after,
.pcd-float *,
.pcd-toast {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.pcd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: calc(var(--pcd-z) - 1);
    pointer-events: none;
    transition: background 0.32s var(--pcd-ease);
}
.pcd-drawer.is-open .pcd-overlay {
    background: rgba(0, 0, 0, 0.48) !important;
    pointer-events: all;
}

/* ── Panel ────────────────────────────────────────────────────────────────── */
.pcd-panel {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: min(var(--pcd-panel-w), 100vw);
    height: 100dvh;
    height: 100vh; /* fallback for browsers without dvh */
    background: var(--pcd-white);
    z-index: var(--pcd-z);
    display: flex;
    flex-direction: column;
    transition: transform 0.36s var(--pcd-ease);
    box-shadow: -6px 0 40px rgba(0, 0, 0, 0.14);
    will-change: transform;
    overflow: hidden;
}
.pcd-drawer.is-open .pcd-panel {
    transform: translateX(0) !important;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.pcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-bottom: 1px solid var(--pcd-grey2);
    flex-shrink: 0;
    background: var(--pcd-white);
}
.pcd-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pcd-text);
    line-height: 1;
    letter-spacing: 0.01em;
}
.pcd-header-count {
    font-weight: 400;
    color: var(--pcd-text2);
}
.pcd-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--pcd-text);
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.pcd-close:hover {
    background: var(--pcd-grey1) !important;
    color: var(--pcd-accent) !important;
}

/* ── Shipping progress bar ────────────────────────────────────────────────── */
.pcd-ship-bar {
    padding: 12px 20px 10px;
    border-bottom: 1px solid var(--pcd-grey2);
    flex-shrink: 0;
    background: var(--pcd-white);
}
.pcd-ship-msg {
    font-size: 12px;
    color: var(--pcd-text2);
    margin-bottom: 8px;
    line-height: 1.45;
}
.pcd-ship-msg strong { color: var(--pcd-text); font-weight: 700; }
.pcd-ship-track {
    position: relative;
    height: 5px;
    background: var(--pcd-grey2);
    border-radius: 99px;
    overflow: visible;
}
.pcd-ship-fill {
    height: 100%;
    background: var(--pcd-accent);
    border-radius: 99px;
    transition: width 0.55s var(--pcd-ease);
    max-width: 100%;
}
.pcd-ship-lock {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 22px;
    height: 22px;
    background: var(--pcd-grey2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcd-grey3);
    transition: background 0.3s, color 0.3s;
    border: 2px solid var(--pcd-white);
}
.pcd-ship-lock.unlocked {
    background: var(--pcd-accent) !important;
    color: var(--pcd-white) !important;
}

/* ── Scrollable body ──────────────────────────────────────────────────────── */
.pcd-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.pcd-body::-webkit-scrollbar          { width: 4px; }
.pcd-body::-webkit-scrollbar-track    { background: transparent; }
.pcd-body::-webkit-scrollbar-thumb    { background: var(--pcd-grey2); border-radius: 99px; }

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.pcd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.pcd-spinner {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--pcd-grey2);
    border-top-color: var(--pcd-primary);
    border-radius: 50%;
    animation: pcd-spin 0.7s linear infinite;
}
@keyframes pcd-spin { to { transform: rotate(360deg); } }

/* ── Empty cart state ─────────────────────────────────────────────────────── */
.pcd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 24px 48px;
    gap: 12px;
    text-align: center;
}
.pcd-empty-icon { color: var(--pcd-grey3); }
.pcd-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pcd-text);
}
.pcd-empty-sub {
    font-size: 13px;
    color: var(--pcd-text2);
    max-width: 230px;
    line-height: 1.5;
}
.pcd-empty-link {
    margin-top: 8px;
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pcd-primary) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
.pcd-empty-link:hover { color: var(--pcd-accent) !important; }

/* ── Cart items ───────────────────────────────────────────────────────────── */
.pcd-items { padding: 0; }

.pcd-item {
    display: flex;
    gap: 14px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--pcd-grey2);
    position: relative;
    align-items: flex-start;
    transition: opacity 0.2s;
}
.pcd-item:last-child { border-bottom: none; }

/* Image wrapper */
.pcd-item-img-wrap {
    position: relative;
    flex-shrink: 0;
}
.pcd-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--pcd-radius);
    display: block;
}

/* Remove (×) button overlaid on image */
.pcd-item-remove {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    background: var(--pcd-white);
    border: 1px solid var(--pcd-grey2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcd-text2);
    z-index: 2;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pcd-item-remove:hover {
    background: var(--pcd-primary) !important;
    color: var(--pcd-white) !important;
    border-color: var(--pcd-primary) !important;
}

/* Item details */
.pcd-item-details {
    flex: 1;
    min-width: 0;
}
.pcd-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
}
.pcd-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pcd-text);
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}
.pcd-item-name:hover { color: var(--pcd-accent) !important; }
.pcd-item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--pcd-text);
    white-space: nowrap;
    flex-shrink: 0;
}
.pcd-item-variants {
    font-size: 12px;
    color: var(--pcd-text2);
    line-height: 1.55;
    margin-bottom: 4px;
}
.pcd-item-opts {
    display: inline-block;
    font-size: 12px;
    color: var(--pcd-text2);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: color 0.15s;
}
.pcd-item-opts:hover { color: var(--pcd-accent) !important; }

/* Qty controls */
.pcd-item-qty {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--pcd-grey2);
    border-radius: var(--pcd-radius);
    overflow: hidden;
    width: fit-content;
    margin-top: 8px;
}
.pcd-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--pcd-white) !important;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcd-text);
    transition: background 0.15s;
    flex-shrink: 0;
}
.pcd-qty-btn:hover:not(:disabled) { 
    background: var(--pcd-grey1) !important;
    color: #D35228 !important; }
.pcd-qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pcd-qty-num {
    min-width: 34px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--pcd-text);
    border-left: 1px solid var(--pcd-grey2);
    border-right: 1px solid var(--pcd-grey2);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bundled items */
.pcd-item[data-bundled="true"] {
    padding-left: 32px;
    background: var(--pcd-grey1);
    opacity: 0.88;
}
.pcd-item[data-bundled="true"] .pcd-item-img { width: 60px; height: 60px; }

/* ── Frequently Bought Together ───────────────────────────────────────────── */
.pcd-fbt {
    background: var(--pcd-grey1);
    padding: 10px 20px;
    border-top: 1px solid var(--pcd-grey2);
}
.pcd-fbt-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pcd-text);
    margin-bottom: 12px;
}

/* Carousel layout */
.pcd-fbt-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pcd-fbt-track-wrap {
    flex: 1;
    overflow: hidden;
    border-radius: 6px;
}
.pcd-fbt-track {
    display: flex;
    transition: transform 0.3s var(--pcd-ease);
}
.pcd-fbt-slide {
    flex: 0 0 100%;
    width: 100%;
}
.pcd-fbt-card {
    background: var(--pcd-white);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.pcd-fbt-img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--pcd-radius);
    flex-shrink: 0;
}
.pcd-fbt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.pcd-fbt-name-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}
.pcd-fbt-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pcd-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pcd-fbt-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--pcd-text);
    white-space: nowrap;
    flex-shrink: 0;
}
.pcd-fbt-price del { color: var(--pcd-grey3); font-weight: 400; }
.pcd-fbt-price ins { text-decoration: none; }

/* FBT action buttons */
.pcd-fbt-add,
.pcd-fbt-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1.5px solid var(--pcd-primary);
    background: var(--pcd-white);
    color: var(--pcd-primary) !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--pcd-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    width: fit-content;
}
.pcd-fbt-add:hover,
.pcd-fbt-select:hover {
    background: var(--pcd-primary) !important;
    color: var(--pcd-white) !important;
}
.pcd-fbt-add.pcd-adding { opacity: 0.6; cursor: wait; }

/* Carousel arrows */
.pcd-fbt-prev,
.pcd-fbt-next {
    width: 28px;
    height: 28px;
    border: 1px solid var(--pcd-grey2);
    background: var(--pcd-white) !important;
    border-radius: 50%;
    display: flex;

    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--pcd-text) !important;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pcd-fbt-prev:hover:not(:disabled),
.pcd-fbt-next:hover:not(:disabled) {
    background: var(--pcd-primary) !important;
    color: var(--pcd-white) !important;
    border-color: var(--pcd-primary) !important;
}
.pcd-fbt-prev:disabled,
.pcd-fbt-next:disabled { opacity: 0.28; cursor: default; }

/* Dots */
.pcd-fbt-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 11px;
}
.pcd-fbt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: var(--pcd-grey2) !important;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.pcd-fbt-dot.active {
    background: var(--pcd-primary) !important;
    transform: scale(1.25);
}
.pcd-fbt-dot:hover {
    background: #D35228 !important;
}

/* ── Sticky footer ────────────────────────────────────────────────────────── */
.pcd-footer {
    border-top: 1px solid var(--pcd-grey2);
    flex-shrink: 0;
    background: var(--pcd-white);
}

/* Discount accordion */
.pcd-coupon {
    border-bottom: 1px solid var(--pcd-grey2);
}
.pcd-coupon-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--pcd-text) !important;
    text-align: left;
    transition: background 0.15s;
}
.pcd-coupon-toggle:hover  { background: var(--pcd-grey1) !important; }
.pcd-coupon-toggle:focus  { outline: none; }
.pcd-coupon-toggle:focus-visible { outline: 2px solid var(--pcd-primary); outline-offset: -2px; }
.pcd-coupon-toggle[aria-expanded="true"] { color: var(--pcd-text) !important; background: transparent !important; }
.pcd-chevron { transition: transform 0.22s; flex-shrink: 0; }
.pcd-coupon-toggle[aria-expanded="true"] .pcd-chevron { transform: rotate(180deg); }
.pcd-coupon-body {
    padding: 10px 20px;
    display: none;
}
.pcd-coupon-body.is-open { display: block; }
.pcd-coupon-row { display: flex; gap: 8px; }
.pcd-coupon-input {
    flex: 1;
    height: 38px;
    border: 1px solid var(--pcd-grey2);
    border-radius: var(--pcd-radius);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--pcd-text);
    outline: none;
    transition: border-color 0.15s;
    background: var(--pcd-white);
}
.pcd-coupon-input:focus { border-color: var(--pcd-primary) !important; }
.pcd-coupon-apply {
    height: 38px;
    padding: 0 18px;
    background: var(--pcd-primary) !important;
    color: var(--pcd-white) !important;
    border: none;
    border-radius: var(--pcd-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.pcd-coupon-apply:hover { background: var(--pcd-accent) !important; }
.pcd-coupon-apply:active { background: var(--pcd-accent) !important; }
.pcd-coupon-apply:disabled { opacity: 0.6; cursor: wait; }
.pcd-coupon-msg {
    font-size: 12px;
    margin-top: 7px;
    line-height: 1.4;
}
.pcd-coupon-msg.success { color: #1a7f37; }
.pcd-coupon-msg.error   { color: #cf222e; }

/* Totals */
.pcd-totals {
    padding: 12px 20px 10px;
    border-top: 1px solid var(--pcd-grey2);
}
.pcd-total-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.pcd-total-main-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--pcd-text);
}
.pcd-total-main-amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--pcd-text);
}
.pcd-breakdown-toggle {
    background: none !important;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--pcd-text) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
    margin-bottom: 8px;
    display: block;
}
.pcd-breakdown-toggle:focus { outline: none; }
.pcd-breakdown { display: none; }
.pcd-breakdown.is-open { display: block; }
.pcd-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--pcd-text);
    margin-bottom: 5px;
}
.pcd-totals-row span:first-child { font-weight: 400; color: var(--pcd-text2); }
.pcd-totals-row span:last-child  { font-weight: 600; }
.pcd-totals-note {
    font-size: 11px;
    color: var(--pcd-text2);
    margin-top: 6px;
    line-height: 1.4;
}

/* Express checkout container */
.pcd-express {
    padding: 0px 20px;
    display: flex;
    flex-direction: column;
}
.pcd-express:empty { display: none; }

/* WC injects view-cart / checkout links alongside Apple/Google Pay — hide them */
.pcd-express a.wc-forward { display: none !important; }

/* Clip Stripe iframes (Stripe forces height:58px inline; visible ~50px after their -4px margin) */
.pcd-express a.StripeElement {
    display: block !important;
    overflow: hidden !important;
    max-height: 44px !important;
    border-radius: var(--pcd-radius);
}

/* Fill-width helpers for other Stripe wrapper variants */
.pcd-express .wc-stripe-express-payment-button-wrapper,
.pcd-express .wc-stripe-cart-payment-request-wrapper,
.pcd-express .wc-stripe-mini-cart-payment-section,
.pcd-express #wc-stripe-payment-request-wrapper,
.pcd-express .stripe-payment-request-button { width: 100% !important; margin: 0 !important; }

/* Checkout button */
.pcd-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0px 20px;
    padding: 10px 20px;
    background: var(--pcd-primary);
    color: var(--pcd-white) !important;
    text-decoration: none;
    border-radius: var(--pcd-radius);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background 0.17s, transform 0.12s;
}
.pcd-checkout-btn:hover {
    background: var(--pcd-accent) !important;
    color: var(--pcd-white) !important;
    transform: translateY(-1px);
}
.pcd-checkout-btn:active { transform: translateY(0); }
.pcd-checkout-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pcd-checkout-label { font-weight: 700; }
.pcd-checkout-total { font-weight: 700; white-space: nowrap; }

/* Continue shopping */
.pcd-continue {
    display: block;
    width: 100%;
    padding: 9px 20px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--pcd-text2);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: center;
    transition: color 0.15s;
    font-family: inherit;
}
.pcd-continue:hover { 
    color: var(--pcd-accent) !important;
    background: transparent !important;

}

/* ── Body scroll-lock ─────────────────────────────────────────────────────── */
body.pcd-open { overflow: hidden !important; }

/* ── Floating cart icon ───────────────────────────────────────────────────── */
.pcd-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: calc(var(--pcd-z) - 10);
}
/* Hide on checkout */
.woocommerce-checkout .pcd-float { display: none !important; }

.pcd-float-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pcd-primary) !important;
    color: var(--pcd-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.2);
    transition: background 0.17s, transform 0.17s, box-shadow 0.17s;
}
.pcd-float-btn:hover {
    background: var(--pcd-accent) !important;
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(211, 82, 40, 0.38) !important;
}
.pcd-float-btn:active { transform: scale(0.96); }

.pcd-float-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--pcd-accent);
    color: var(--pcd-white);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--pcd-white);
    transition: transform 0.15s;
    pointer-events: none;
}
.pcd-float-badge.pcd-badge-zero { display: none !important; }
.pcd-float-badge.pcd-badge-bump { animation: pcd-bump 0.32s var(--pcd-ease); }
@keyframes pcd-bump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* ── Toast notification ───────────────────────────────────────────────────── */
.pcd-toast {
    position: fixed;
    bottom: 90px;
    left: 24px;
    background: var(--pcd-primary);
    color: var(--pcd-white);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: calc(var(--pcd-z) + 1);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s, transform 0.22s;
    max-width: 260px;
    line-height: 1.4;
    font-family: inherit;
}
.pcd-toast.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    :root { --pcd-panel-w: 100vw; }

    .pcd-float           { bottom: 16px; left: 16px; }
    .pcd-float-btn       { width: 50px; height: 50px; }

    .pcd-header          { padding: 5px 16px; }
    .pcd-header-title    { font-size: 15px; }
    .pcd-ship-bar        { padding: 10px 16px 8px; }

    .pcd-item            { padding: 10px 16px; gap: 12px; }
    .pcd-item-img        { width: 72px; height: 72px; }

    .pcd-fbt             { padding: 10px 16px; }

    .pcd-coupon-toggle   { padding: 5px 16px; }
    .pcd-coupon-body     { padding: 10px 16px; }
    .pcd-totals          { padding: 12px 16px 8px; }
    .pcd-express         { padding: 0px 16px; }
    .pcd-checkout-btn    { margin: 6px 16px; padding: 14px 16px; }
    .pcd-toast           { left: 16px; bottom: 76px; }
}
