/* ══════════════════════════════════════════
   P&D Cart Drawer — Premium slide panel
   ══════════════════════════════════════════ */

/* ── Cart Wrap + Badge (navbar) ── */
.pyd-header__cart-wrap { position: relative; display: flex; align-items: center; }
.pyd-header__cart-count {
    position: absolute; top: -8px; right: -10px;
    min-width: 16px; height: 16px;
    background: var(--pyd-primary, #0070C0);
    color: white; font-size: 10px; font-weight: 600;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pyd-header__cart-count.pulse {
    animation: pydBadgePulse 0.4s ease;
}
@keyframes pydBadgePulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── Hover Preview (desktop only) ── */
.pyd-cart-preview {
    position: absolute; top: calc(100% + 12px); right: -8px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
    padding: 20px;
    opacity: 0; visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 10003;
}
.pyd-header__cart-wrap:hover .pyd-cart-preview {
    opacity: 1; visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.pyd-cart-preview__title {
    font-family: 'Archivo', sans-serif;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2px;
    color: #9CA3AF;
    margin-bottom: 14px;
}
.pyd-cart-preview__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
}
.pyd-cart-preview__item + .pyd-cart-preview__item {
    border-top: 1px solid #F5F5F4;
}
.pyd-cart-preview__img {
    width: 44px; height: 44px;
    background: #F5F5F4;
    border-radius: 8px;
    overflow: hidden; flex-shrink: 0;
}
.pyd-cart-preview__img img { width: 100%; height: 100%; object-fit: cover; }
.pyd-cart-preview__name {
    font-size: 13px; color: #1A1A1A; font-weight: 500;
    flex: 1; line-height: 1.3;
}
.pyd-cart-preview__price {
    font-size: 13px; font-weight: 600; color: #1A1A1A;
    white-space: nowrap;
}
.pyd-cart-preview__footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 14px; margin-top: 6px;
    border-top: 1px solid #F5F5F4;
}
.pyd-cart-preview__total-label { font-size: 12px; color: #9CA3AF; }
.pyd-cart-preview__total { font-size: 16px; font-weight: 600; color: #1A1A1A; }
.pyd-cart-preview__btn {
    display: block; text-align: center;
    margin-top: 14px; padding: 11px;
    background: var(--pyd-primary, #0070C0); color: white;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    text-decoration: none; letter-spacing: 0.3px;
    transition: background 0.2s;
}
.pyd-cart-preview__btn:hover { background: #005a9a; color: white; }
.pyd-cart-preview__empty {
    text-align: center; padding: 20px 0;
    color: #9CA3AF; font-size: 13px;
}

/* ── Backdrop ── */
.pyd-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 10010;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(1px);
}
.pyd-drawer-backdrop.open { opacity: 1; visibility: visible; }

/* ── Slide Cart Drawer ── */
.pyd-cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 320px; max-width: 85vw;
    background: #FAFAF9;
    z-index: 10011;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -12px 0 48px rgba(0,0,0,0.08);
}
.pyd-cart-drawer.open { transform: translateX(0); }

/* ── Drawer Header ── */
.pyd-drawer__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #EEEEEB;
    flex-shrink: 0;
}
.pyd-drawer__header-left {
    display: flex; align-items: center; gap: 10px;
}
.pyd-drawer__header-label {
    font-family: 'Archivo', sans-serif;
    font-size: 18px; font-weight: 600;
    color: #1A1A1A;
    letter-spacing: 0.2px;
}
.pyd-drawer__header-icon { color: #1A1A1A; }
.pyd-drawer__count {
    font-family: 'Archivo', sans-serif;
    font-size: 14px; font-weight: 600;
    color: #1A1A1A;
    background: #EEEEEB;
    min-width: 26px; height: 26px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 8px;
}
.pyd-drawer__close {
    background: none; border: none; cursor: pointer;
    padding: 8px; display: flex; border-radius: 50%;
    transition: background 0.15s;
    margin-right: -17px;
    -webkit-tap-highlight-color: transparent;
}
.pyd-drawer__close:hover { background: #EEEEEB; }
.pyd-drawer__close svg { width: 18px; height: 18px; }

/* Shipping bar removed — not offering free shipping */

/* ── Drawer Items ── */
.pyd-drawer__items {
    flex: 1; overflow-y: auto;
    padding: 12px 28px 20px;
}
.pyd-drawer__items:empty { flex: 0; padding: 0; }
.pyd-drawer__item {
    display: flex; gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #EEEEEB;
}
.pyd-drawer__item:last-child { border-bottom: none; }
.pyd-drawer__item-img {
    width: 80px; height: 80px;
    background: #F5F5F4;
    border-radius: 10px;
    overflow: hidden; flex-shrink: 0;
}
.pyd-drawer__item-img img { width: 100%; height: 100%; object-fit: cover; }
.pyd-drawer__item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pyd-drawer__item-name {
    font-family: 'Archivo', sans-serif;
    font-size: 14px; font-weight: 500; color: #1A1A1A;
    line-height: 1.35;
}
.pyd-drawer__item-meta {
    font-size: 11px; color: #9CA3AF; letter-spacing: 0.3px;
}
.pyd-drawer__item-bottom {
    display: flex; align-items: center;
    margin-top: auto; padding-top: 8px;
}
.pyd-drawer__item-price {
    font-family: 'Archivo', sans-serif;
    font-size: 15px; font-weight: 600; color: #1A1A1A;
    width: 60px; flex-shrink: 0;
}

/* ── Quantity (matches product page .pyd-qty style) ── */
.pyd-drawer__qty {
    display: flex; align-items: center; gap: 2px;
    flex: 1; justify-content: center;
}
.pyd-drawer__qty-btn {
    width: 26px; height: 26px;
    border: none; border-radius: 50%;
    background: #F3F3F1;
    font-size: 14px; color: #6B7280;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
    font-family: 'Archivo', sans-serif;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.pyd-drawer__qty-btn:hover { color: #1A1A1A; background: #E5E5E3; }
.pyd-drawer__qty-val {
    width: 28px; text-align: center;
    font-family: 'Archivo', sans-serif;
    font-size: 14px; font-weight: 600; color: #1A1A1A;
    line-height: 26px;
}

/* ── Remove (trash icon) ── */
.pyd-drawer__item-remove {
    background: none; border: none; cursor: pointer;
    padding: 0px; display: flex; align-items: center; justify-content: center;
    color: #D1D1CE; transition: color 0.2s;
    width: 38px; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.pyd-drawer__item-remove:hover { color: #B32D2E; }

/* ── Drawer Footer ── */
.pyd-drawer__footer {
    padding: 20px 28px 28px;
    border-top: 1px solid #EEEEEB;
    flex-shrink: 0;
}
.pyd-drawer__summary {
    margin-bottom: 14px;
}
.pyd-drawer__summary-row {
    display: flex; justify-content: space-between;
    font-size: 12px; color: #6B7280;
    padding: 2px 0;
}
.pyd-drawer__summary-row--total {
    font-size: 15px; font-weight: 600; color: #1A1A1A;
    padding-top: 8px; margin-top: 4px;
    border-top: 1px solid #F5F5F4;
}
.pyd-drawer__actions { display: flex; gap: 10px; }
.pyd-drawer__btn {
    display: flex; align-items: center; justify-content: center;
    flex: 1;
    padding: 8px 12px; border-radius: 8px;
    font-family: 'Archivo', sans-serif;
    font-size: 14px; font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center; text-decoration: none;
    cursor: pointer; border: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pyd-drawer__btn--primary { background: var(--pyd-primary, #0070C0); color: white; }
.pyd-drawer__btn--primary:hover { background: #005a9a; color: white; }
.pyd-drawer__btn--secondary {
    background: white; color: #3A3F47;
    border: 1px solid #E5E5E3;
}
.pyd-drawer__btn--secondary:hover { border-color: #3A3F47; color: #1A1A1A; }

/* ── Empty state ── */
.pyd-drawer__empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 28px; text-align: center;
    min-height: 0;
}
.pyd-drawer__empty svg { margin-bottom: 20px; opacity: 0.1; }
.pyd-drawer__empty-title {
    font-family: 'Archivo', sans-serif;
    font-size: 15px; font-weight: 600; color: #1A1A1A;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}
.pyd-drawer__empty-text {
    font-size: 13px; color: #9CA3AF;
    max-width: 240px; line-height: 1.6;
}
.pyd-drawer__empty-cta {
    margin-top: 28px; padding: 13px 36px;
    background: var(--pyd-primary, #0070C0); color: white;
    border-radius: 10px; text-decoration: none;
    font-size: 13px; font-weight: 500; letter-spacing: 0.3px;
    transition: background 0.2s;
}
.pyd-drawer__empty-cta:hover { background: #005a9a; color: white; }

/* ── Loading ── */
.pyd-drawer__loading {
    position: absolute; inset: 0;
    background: rgba(250,250,249,0.8);
    display: none; align-items: center; justify-content: center;
    z-index: 5; border-radius: 0;
}
.pyd-drawer__loading.active { display: flex; }
.pyd-drawer__spinner {
    width: 22px; height: 22px;
    border: 2px solid #E5E5E3;
    border-top-color: var(--pyd-primary, #0070C0);
    border-radius: 50%;
    animation: pydSpin 0.6s linear infinite;
}
@keyframes pydSpin { to { transform: rotate(360deg); } }

/* ── Mobile ── */
@media (max-width: 768px) {
    .pyd-cart-preview { display: none !important; }
    .pyd-cart-drawer { width: 100vw; max-width: 100vw; }
    .pyd-drawer__header { padding: 24px 20px 18px; }
    .pyd-drawer__close { margin-right: 0; }
    .pyd-drawer__shipping { margin: 0 20px 4px; }
    .pyd-drawer__items { padding: 12px 20px 20px; }
    .pyd-drawer__footer { padding: 0 20px 24px; }
    .pyd-drawer__item { padding: 14px; }
    .pyd-drawer__item-img { width: 64px; height: 64px; }
}
