/* ═══════════════════════════════════════════
   PRG Side Cart — Layout & Structure Only v1.2
   Colors applied via inline styles (theme-proof)
   ═══════════════════════════════════════════ */

/* ─── Overlay ─── */
.prg-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.prg-overlay.active {
    display: block;
    opacity: 1;
}

/* ─── Side Cart ─── */
.prg-side-cart {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.18);
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-sizing: border-box;
}
.prg-side-cart.open {
    transform: translateX(0);
}
.prg-side-cart *,
.prg-side-cart *::before,
.prg-side-cart *::after {
    box-sizing: border-box;
}

/* ─── Header ─── */
.prg-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    flex-shrink: 0;
}
.prg-cart-title {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}
.prg-cart-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 4px;
    opacity: 0.9;
    transition: opacity 0.2s;
    text-decoration: none !important;
}
.prg-cart-close:hover { opacity: 1; }

/* ─── Body ─── */
.prg-cart-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.prg-cart-body::-webkit-scrollbar { width: 4px; }
.prg-cart-body::-webkit-scrollbar-track { background: transparent; }
.prg-cart-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

/* ─── Cart Items container ─── */
.prg-cart-items {
    padding: 16px 20px 0;
}
.prg-empty-cart {
    text-align: center;
    padding: 40px 0;
    font-size: 0.95rem;
}

/* ─── Single cart item ─── */
.prg-cart-item {
    display: grid;
    grid-template-columns: 80px 1fr 28px;
    gap: 12px;
    align-items: start;
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.prg-cart-item:last-child { margin-bottom: 0; }

.prg-item-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.prg-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.prg-item-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.prg-item-name {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    /* color & size via inline style */
}

.prg-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Qty control box */
.prg-qty-control {
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.prg-qty-btn {
    border: none !important;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.prg-qty-btn:hover { filter: brightness(0.88); }
.prg-qty-val {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    padding: 0 4px;
    line-height: 32px;
    /* color & size via inline */
}
.prg-item-price {
    font-weight: 700;
    white-space: nowrap;
    /* color & size via inline */
}

/* Remove button */
.prg-item-remove {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
    box-shadow: none !important;
}
.prg-item-remove:hover { color: #e44 !important; }

/* ─── Upsell Section ─── */
.prg-upsell {
    padding: 16px 20px 20px;
    margin-top: 12px;
}
.prg-upsell-title {
    margin: 0 0 16px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
}
.prg-upsell-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    margin-bottom: 16px;
    align-items: start;
}
.prg-upsell-item:last-child { margin-bottom: 0; }
.prg-upsell-img {
    width: 72px;
    height: 72px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.prg-upsell-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prg-upsell-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prg-upsell-name {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
}
.prg-upsell-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.prg-upsell-qty {
    width: 52px;
    height: 30px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 4px;
    outline: none;
}
.prg-upsell-price {
    font-size: 0.9rem;
    font-weight: 700;
}
.prg-upsell-price ins { text-decoration: none; }
.prg-upsell-price del { font-weight: 400; margin-left: 4px; font-size: 0.8rem; opacity: 0.6; }
.prg-upsell-add-btn {
    border: none !important;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity 0.2s;
    text-transform: uppercase;
    align-self: flex-start;
    box-shadow: none !important;
}
.prg-upsell-add-btn:hover { opacity: 0.85; }
.prg-upsell-add-btn.loading { opacity: 0.6; pointer-events: none; }

/* ─── Footer ─── */
.prg-cart-footer {
    padding: 16px 20px 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.prg-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
}
.prg-subtotal-price { font-weight: 700; }

.prg-btn-checkout {
    display: block;
    text-align: center;
    text-decoration: none !important;
    padding: 14px 20px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: none !important;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 2px;
    box-shadow: none !important;
}
.prg-btn-checkout:hover { opacity: 0.9; }

.prg-btn-keep-shopping {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: none !important;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 2px;
    background: none;
    box-shadow: none !important;
}
.prg-btn-keep-shopping:hover { opacity: 0.85; }

/* ─── Cart Icon Widget ─── */
.prg-cart-icon-widget {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    line-height: 1;
    gap: 6px;
    user-select: none;
}
.prg-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.prg-cart-icon-svg { display: block; transition: color 0.2s; }
.prg-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e44;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
    pointer-events: none;
}
.prg-cart-count:not(.has-items) { display: none; }

/* ─── Animations ─── */
@keyframes prg-shake {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(-18deg); }
    30%  { transform: rotate(18deg); }
    45%  { transform: rotate(-12deg); }
    60%  { transform: rotate(12deg); }
    75%  { transform: rotate(-5deg); }
    90%  { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}
@keyframes prg-badge-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.prg-cart-icon-widget.prg-animate .prg-cart-icon-wrap {
    animation: prg-shake 0.6s ease;
}
.prg-cart-icon-widget.prg-animate .prg-cart-count {
    animation: prg-badge-pop 0.35s ease forwards;
}

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .prg-side-cart { width: 100vw !important; border-radius: 0 !important; }
    .prg-cart-item { grid-template-columns: 68px 1fr 26px; gap: 10px; }
    .prg-item-img  { width: 68px; height: 68px; }
    .prg-upsell-item { grid-template-columns: 60px 1fr; gap: 10px; }
    .prg-upsell-img  { width: 60px; height: 60px; }
}
