/* ═══════════════════════════════════════════════════════════════
   PRACTICAL CART DRAWER — practical-cart-drawer.css
═══════════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────────── */
.pcd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 999999;
    pointer-events: none;
    transition: background 0.28s ease;
    display: flex;
    justify-content: flex-end;
}

.pcd-overlay.open {
    background: rgba(0,0,0,0.45);
    pointer-events: all;
}

/* ── Drawer — desktop: slides from right ─────────────────────── */
.pcd-drawer {
    width: 400px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pcd-overlay.open .pcd-drawer {
    transform: translateX(0);
}

/* ── Header ──────────────────────────────────────────────────── */
.pcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.pcd-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-title .ti {
    font-size: 18px;
    color: #111;
}

.pcd-count-badge {
    background: #f5f2ec;
    border: 0.5px solid rgba(0,0,0,0.10);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    color: #747971;
    font-family: 'Noah Text', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f5f2ec;
    color: #111 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.pcd-close:hover { background: #e8e4dc; }
.pcd-close svg {
    display: block;
    width: 13px;
    height: 13px;
    stroke: #111;
    flex-shrink: 0;
}

/* ── Free shipping bar ───────────────────────────────────────── */
.pcd-ship-bar {
    padding: 10px 20px;
    background: #f5f2ec;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.pcd-ship-bar.pcd-ship-achieved {
    background: #f0fdf4;
    border-bottom-color: rgba(22,163,74,0.15);
}

.pcd-ship-text {
    font-size: 11px;
    color: #747971;
    text-align: center;
    margin-bottom: 6px;
    font-family: 'Noah Text', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-ship-achieved .pcd-ship-text {
    color: #16a34a;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pcd-ship-text strong { color: #111; }

.pcd-ship-track {
    height: 3px;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.pcd-ship-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ── Body ────────────────────────────────────────────────────── */
.pcd-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}


/* ── Items ───────────────────────────────────────────────────── */
.pcd-items {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.pcd-items::-webkit-scrollbar { display: none; }

.pcd-item {
    display: grid;
    grid-template-columns: 68px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    background: #f5f2ec;
    border-radius: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pcd-item-img-wrap {
    display: block;
    width: 68px;
    height: 78px;
    border-radius: 7px;
    overflow: hidden;
    background: #e8e4dc;
    flex-shrink: 0;
}

.pcd-item-img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.pcd-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pcd-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-item-name:hover { color: #d35228; }

.pcd-item-variant {
    font-size: 11px;
    color: #747971;
    font-family: 'Noah Text', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-item-price {
    font-size: 12px;
    font-weight: 700;
    color: #111;
    margin-top: 2px;
}

.pcd-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.pcd-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 0.5px solid rgba(0,0,0,0.14);
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
    font-family: inherit;
}

.pcd-qty-btn:hover { background: #f0ede7; }

.pcd-qty-num {
    font-size: 12px;
    font-weight: 700;
    color: #111;
    min-width: 18px;
    text-align: center;
}

.pcd-item-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #b0ada8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.pcd-item-remove:hover { color: #d35228; background: rgba(211,82,40,0.08); }
.pcd-item-remove svg {
    display: block;
    width: 14px;
    height: 14px;
    stroke: #b0ada8;
    flex-shrink: 0;
}

.pcd-item-remove:hover svg {
    stroke: #d35228;
}

/* Hide qty controls on bundled child items */
.pcd-item[data-bundled="true"] .pcd-item-qty,
.pcd-item[data-bundled="true"] .pcd-item-remove {
    display: none;
}

.pcd-item[data-bundled="true"] .pcd-item-info {
    opacity: 0.75;
}

/* ── Promo code ──────────────────────────────────────────────── */
.pcd-promo {
    flex-shrink: 0;
    padding: 10px 20px 0px 20px;
    border-top: 0.5px solid rgba(0,0,0,0.06);
}

.pcd-promo-row {
    display: flex;
    gap: 6px;
}

.pcd-promo-input {
    flex: 1;
    height: 36px;
    border: 0.5px solid rgba(0,0,0,0.14);
    border-radius: 7px;
    background: #fff;
    color: #111;
    font-size: 12px;
    padding: 0 12px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}

.pcd-promo-input::placeholder { color: #b0ada8; }
.pcd-promo-input:focus { border-color: #d35228; }

.pcd-promo-apply {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 7px;
    background: #f5f2ec;
    color: #111 !important;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s;
}

.pcd-promo-apply:hover { background: #e8e4dc; }

.pcd-promo-msg {
    font-size: 11px;
    margin-top: 5px;
    min-height: 16px;
    font-family: inherit;
}

.pcd-promo-msg.success { color: #16a34a; }
.pcd-promo-msg.error { color: #d35228; }

/* ── Totals ──────────────────────────────────────────────────── */
.pcd-totals {
    flex-shrink: 0;
    padding: 10px 20px 0px 20px;
    border-top: 0.5px solid rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pcd-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #747971;
    font-family: 'Noah Text', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-totals-row.pcd-discount { color: #16a34a; }
.pcd-free { color: #16a34a !important; }

.pcd-totals-row.pcd-total {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 0.5px solid rgba(0,0,0,0.08);
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Footer ──────────────────────────────────────────────────── */
.pcd-footer {
    flex-shrink: 0;
    padding: 12px 20px 0px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcd-checkout-btn {
    display: block;
    width: 100%;
    padding: 13px 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-checkout-btn:hover { background: #d35228; color: #fff; }

.pcd-continue {
    background: none !important;
    border: none;
    font-size: 11px;
    color: #747971;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    padding: 4px 0;

}

.pcd-continue:hover { color: #111; }


/* ── Empty state ─────────────────────────────────────────────── */
.pcd-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 24px;
    text-align: center;
}

.pcd-empty .ti {
    font-size: 44px;
    color: #b0ada8;
}

.pcd-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
}

.pcd-empty-sub {
    font-size: 12px;
    color: #747971;
    line-height: 1.7;
    max-width: 240px;
}

.pcd-empty-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #111 ;
    color: #fff !important;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.15s;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
    margin-top: 4px;
}

.pcd-empty-btn:hover { background: #d35228; color: #fff; }

/* ── Floating cart button (FAB) ──────────────────────────────── */
.pcd-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #111 !important;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Noah Head', 'Helvetica Neue', Arial, sans-serif;
    transition: background 0.15s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.pcd-fab:hover { background: #d35228; transform: translateY(-2px); }
.pcd-fab:active { transform: translateY(0); }

.pcd-fab .ti { font-size: 18px; }

.pcd-fab-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pcd-fab-badge {
    background: #d35228;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* FAB pulse animation when item added */
@keyframes pcd-fab-pulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.12); }
    60%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.pcd-fab.pulse { animation: pcd-fab-pulse 0.4s ease; }

/* ── Loading state ───────────────────────────────────────────── */
.pcd-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* ── Mobile: drawer slides from bottom ───────────────────────── */
@media (max-width: 768px) {
    .pcd-overlay {
        align-items: flex-end;
        justify-content: center;
    }

    .pcd-drawer {
        width: 100%;
        height: 60vh;
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .pcd-overlay.open .pcd-drawer {
        transform: translateY(0);
    }

    /* Drag handle on mobile */
    .pcd-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(0,0,0,0.12);
        border-radius: 2px;
    }

    .pcd-header { position: relative; }

    .pcd-fab {
        bottom: 20px;
        left: 16px;
        padding: 9px 14px;
    }

    .pcd-fab-label { display: none; }
}
