/* ==========================================================================
   PuriyaGalo — Cart Page v3.3 (Daraz-style)
   ========================================================================== */

.pg-cart-page { --pg-nav-active: #F5821F; --pg-green: #F5821F; --pg-green-dark: #E57217; background: #f6f7f9; }
.pg-cart-page.pg-app { background: #f6f7f9; }

/* ── Cart Content ──────────────────────────────────────────────────────── */
.pg-cart-content {
    padding: 0 14px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Cart Page Header ──────────────────────────────────────────────────── */
.pg-cart-page-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 16px 0 12px;
}
.pg-cart-page-head h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}
.pg-cart-item-count {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* ── Cart Empty State ──────────────────────────────────────────────────── */
.pg-cart-empty {
    text-align: center;
    padding: 60px 16px;
}
.pg-cart-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.pg-cart-empty h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.pg-cart-empty p {
    font-size: 14px;
    color: #888;
    margin: 0 0 20px;
}
.pg-cart-empty .pg-btn-pill {
    display: inline-block;
    background: #F5821F;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 30px;
    border-radius: 999px;
    text-decoration: none;
}

/* ── Cart Layout (items + summary side by side on desktop) ─────────────── */
.pg-cart-layout {
    display: block;
}

/* ── Cart Item Card ────────────────────────────────────────────────────── */
.pg-cart-items-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
    overflow: hidden;
}

/* ── Single Cart Item ──────────────────────────────────────────────────── */
.pg-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.pg-cart-item:last-child { border-bottom: none; }

.pg-cart-item-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: block;
}
.pg-cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-cart-item-info {
    flex: 1;
    min-width: 0;
}
.pg-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    margin-bottom: 4px;
}
.pg-cart-item-name:hover { color: #F5821F; }
.pg-cart-item-variant {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.pg-cart-item-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Quantity Controls ─────────────────────────────────────────────────── */
.pg-cart-item-right {
    text-align: right;
    flex-shrink: 0;
    margin-top: 24px; /* clears the absolutely-positioned remove (×) button
                          at top:8px/right:8px (see .pg-cart-remove below),
                          which was overlapping the "+" quantity button and
                          intercepting taps meant for it — tapping "+" was
                          sometimes actually removing the item instead. */
}
.pg-qty-row {
    margin-bottom: 6px;
}
.pg-qty-form {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
}
.pg-qty-btn {
    width: 32px;
    height: 100%;
    background: #fafafa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s;
}
.pg-qty-btn:hover { background: #f0f0f0; }
.pg-qty-btn:disabled { color: #ccc; cursor: default; }
.pg-qty-val {
    width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    line-height: 32px;
}
.pg-cart-line-total {
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
}

/* ── Remove Button ─────────────────────────────────────────────────────── */
.pg-cart-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    border-radius: 50%;
    transition: color 0.12s, background 0.12s;
}
.pg-cart-remove:hover { color: #ff3b30; background: #fff0f0; }

/* ── Coupon ────────────────────────────────────────────────────────────── */
.pg-coupon-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.pg-coupon-card .woocommerce-form-coupon {
    display: flex;
    gap: 8px;
    margin: 0;
}
.pg-coupon-card .woocommerce-form-coupon input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    min-width: 0;
}
.pg-coupon-card .woocommerce-form-coupon button {
    background: #F5821F;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Order Summary Card ────────────────────────────────────────────────── */
.pg-cart-summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.pg-cart-summary-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1a1a1a;
}
.pg-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}
.pg-summary-val { font-weight: 600; color: #333; }
.pg-summary-discount .pg-summary-val { color: #F5821F; }
.pg-summary-divider {
    border-top: 1px dashed #e0e0e0;
    margin: 10px 0;
}
.pg-summary-total {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}
.pg-summary-total .pg-summary-val {
    font-weight: 800;
    color: #ff3b30;
}

/* ── Checkout Button ───────────────────────────────────────────────────── */
.pg-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F5821F;
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 10px;
    transition: background 0.15s;
}
.pg-checkout-btn:hover { background: #E57217; }
.pg-checkout-total { font-weight: 400; opacity: 0.9; font-size: 14px; }

.pg-continue-shopping {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #F5821F;
    text-decoration: none;
    font-weight: 600;
}
.pg-continue-shopping:hover { text-decoration: underline; }

/* ── Trust Mini ────────────────────────────────────────────────────────── */
.pg-trust-mini {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
}
.pg-trust-mini-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
}
.pg-trust-mini-item svg { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   TABLET (≥768px)
   ========================================================================== */
@media (min-width: 768px) {
    .pg-cart-content { padding: 0 20px; }
    .pg-cart-item { padding: 14px; }
    .pg-cart-item-thumb { width: 80px; height: 80px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   DESKTOP (≥1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .pg-cart-page.pg-app { background: #f0f2f5; padding-bottom: 40px !important; }

    .pg-cart-layout {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: 16px;
        align-items: start;
    }

    .pg-cart-items-card {
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    }
    .pg-cart-summary-card {
        position: sticky;
        top: 88px;
        border-radius: 14px;
    }
    .pg-coupon-card { border-radius: 14px; }
}
@media (min-width: 1280px) {
    .pg-cart-content { max-width: 1200px; }
}