/* =========================================================
   Coffee Genaveh - Lightweight Cart
   ========================================================= */

.cg-cart-page {
    direction: rtl;
    width: 100%;
    background: #f7f7f7;
    padding: 28px 15px 50px;
    box-sizing: border-box;
    font-family: inherit;
    color: #242424;
}

.cg-cart-page *,
.cg-cart-page *::before,
.cg-cart-page *::after {
    box-sizing: border-box;
}

.cg-cart-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

/* =========================
   Header
   ========================= */

.cg-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.cg-cart-header h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.5;
    font-weight: 700;
    color: #202020;
}

.cg-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf8f4;
    color: #16835f;
    border-radius: 30px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
}

/* =========================
   Main Layout
   ========================= */

.cg-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 20px;
    align-items: start;
}

/* =========================
   Products Card
   ========================= */

.cg-cart-products-card {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 16px;
    overflow: hidden;
}

.cg-cart-product {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 20px;
    padding: 22px;
    border-bottom: 1px solid #eeeeee;
    background: #fff;
}

.cg-cart-product:last-child {
    border-bottom: 0;
}

/* =========================
   Product Image
   ========================= */

.cg-product-image {
    width: 145px;
    height: 145px;
    border-radius: 13px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.cg-product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
    padding: 10px;
}

/* =========================
   Product Info
   ========================= */

.cg-product-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cg-product-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.cg-product-title {
    min-width: 0;
    line-height: 1.8;
}

.cg-product-title a,
.cg-product-title {
    color: #222;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.cg-product-title a:hover {
    color: #15966c;
}

/* =========================
   Remove
   ========================= */

.cg-product-remove {
    flex: 0 0 auto;
}

.cg-remove {
    width: 34px;
    height: 34px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff4f4;
    color: #d64545 !important;
    text-decoration: none !important;
    transition: .2s ease;
}

.cg-remove:hover {
    background: #ffe5e5;
    transform: scale(1.05);
}

.cg-remove svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* =========================
   Product Data
   ========================= */

.cg-product-info .variation {
    margin: 8px 0 0;
    font-size: 12px;
    color: #777;
}

.cg-product-info .variation dt,
.cg-product-info .variation dd {
    display: inline;
    margin: 0 5px 0 0;
}

.cg-product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    padding-top: 25px;
}

/* =========================
   Price
   ========================= */

.cg-product-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cg-price-label {
    font-size: 12px;
    color: #888;
}

.cg-price-value {
    color: #222;
    font-size: 15px;
    font-weight: 700;
}

.cg-price-value .amount {
    font-weight: 700;
}

/* =========================
   Quantity
   ========================= */

.cg-product-quantity {
    direction: ltr;
}

.cg-product-quantity .quantity {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 118px;
    height: 42px;
    margin: 0 !important;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.cg-product-quantity .qty {
    width: 50px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    text-align: center;
    font-size: 14px;
    box-shadow: none !important;
}

/* Hide native arrows */

.cg-product-quantity input::-webkit-outer-spin-button,
.cg-product-quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cg-product-quantity input[type="number"] {
    -moz-appearance: textfield;
}

/* =========================
   Subtotal
   ========================= */

.cg-product-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #e8e8e8;
    font-size: 12px;
    color: #888;
}

.cg-product-subtotal strong {
    color: #222;
    font-size: 15px;
}

/* =========================
   Cart Actions
   ========================= */

.cg-cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.cg-coupon {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 400px;
}

.cg-coupon input {
    height: 44px !important;
    min-height: 44px !important;
    flex: 1;
    margin: 0 !important;
    border: 1px solid #dedede !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    outline: none !important;
}

.cg-coupon input:focus {
    border-color: #15966c !important;
}

.cg-coupon-button,
.cg-update-cart {
    height: 44px !important;
    min-height: 44px !important;
    border: 0 !important;
    border-radius: 10px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: .2s ease;
}

.cg-coupon-button {
    background: #edf8f4 !important;
    color: #16835f !important;
}

.cg-coupon-button:hover {
    background: #dff2eb !important;
}

.cg-update-cart {
    background: #fff !important;
    color: #555 !important;
    border: 1px solid #ddd !important;
}

.cg-update-cart:hover {
    border-color: #15966c !important;
    color: #15966c !important;
}

/* =========================
   Summary
   ========================= */

.cg-summary-card {
    position: sticky;
    top: 20px;
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 16px;
    padding: 22px;
}

.cg-summary-card h2 {
    margin: 0 0 20px;
    padding-bottom: 17px;
    border-bottom: 1px solid #eeeeee;
    color: #222;
    font-size: 18px;
    font-weight: 700;
}

.cg-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 0;
    color: #666;
    font-size: 13px;
}

.cg-summary-row strong {
    color: #333;
    font-weight: 600;
}

.cg-summary-row .amount {
    white-space: nowrap;
}

.cg-summary-row .woocommerce-Price-currencySymbol,
.cg-summary-total .woocommerce-Price-currencySymbol {
    font-size: .8em;
}

.cg-discount {
    color: #15966c;
}

.cg-discount strong {
    color: #15966c;
}

/* =========================
   Total
   ========================= */

.cg-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 12px;
    padding: 18px 0;
    border-top: 1px solid #e7e7e7;
}

.cg-summary-total span {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.cg-summary-total strong {
    color: #15966c;
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

/* =========================
   Checkout
   ========================= */

.cg-checkout-button {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 11px;
    background: #15966c;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    transition: .2s ease;
}

.cg-checkout-button:hover {
    background: #117c5a;
    color: #fff !important;
    transform: translateY(-1px);
}

.cg-checkout-button span {
    font-size: 20px;
    line-height: 1;
}

/* =========================
   Secure Payment
   ========================= */

.cg-safe-payment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 15px;
    color: #777;
    font-size: 11px;
}

.cg-safe-payment svg {
    width: 17px;
    height: 17px;
    fill: #15966c;
}

/* =========================
   Empty Cart
   ========================= */

.cg-cart-empty {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 18px;
    padding: 70px 20px;
    text-align: center;
}

.cg-cart-empty-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf8f4;
    color: #15966c;
}

.cg-cart-empty-icon svg {
    width: 38px;
    height: 38px;
    fill: currentColor;
}

.cg-cart-empty h2 {
    margin: 0 0 8px;
    color: #222;
    font-size: 20px;
}

.cg-cart-empty p {
    margin: 0 0 25px;
    color: #888;
    font-size: 13px;
}

.cg-shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 46px;
    padding: 0 22px;
    border-radius: 10px;
    background: #15966c;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 700;
}

.cg-shop-button:hover {
    background: #117c5a;
    color: #fff !important;
}

/* =========================
   WooCommerce Compatibility
   ========================= */

.cg-cart-page .woocommerce-shipping-destination,
.cg-cart-page .shipping-calculator-button {
    font-size: 11px;
}

.cg-cart-page .shipping-calculator-form {
    margin-top: 10px;
}

.cg-cart-page .select2-container {
    width: 100% !important;
}

.cg-cart-page .woocommerce-shipping-methods {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cg-cart-page .woocommerce-shipping-methods li {
    margin: 5px 0;
    font-size: 12px;
}

/* =========================
   Tablet
   ========================= */

@media (max-width: 900px) {

    .cg-cart-layout {
        grid-template-columns: 1fr;
    }

    .cg-summary-card {
        position: static;
    }

    .cg-cart-summary {
        order: 2;
    }

    .cg-cart-products {
        order: 1;
    }
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 600px) {

    .cg-cart-page {
        padding: 15px 10px 35px;
    }

    .cg-cart-header {
        margin-bottom: 12px;
    }

    .cg-cart-header h1 {
        font-size: 20px;
    }

    .cg-cart-count {
        padding: 5px 9px;
        font-size: 11px;
    }

    .cg-cart-layout {
        gap: 12px;
    }

    .cg-cart-products-card {
        border-radius: 13px;
    }

    .cg-cart-product {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        padding: 14px 11px;
    }

    .cg-product-image {
        width: 92px;
        height: 92px;
        border-radius: 10px;
    }

    .cg-product-image img {
        padding: 6px;
    }

    .cg-product-title a,
    .cg-product-title {
        font-size: 13px;
        line-height: 1.7;
    }

    .cg-product-top {
        gap: 7px;
    }

    .cg-remove {
        width: 29px;
        height: 29px;
    }

    .cg-remove svg {
        width: 15px;
        height: 15px;
    }

    .cg-product-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 13px;
    }

    .cg-product-price {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cg-product-quantity {
        width: 100%;
    }

    .cg-product-quantity .quantity {
        width: 100%;
        height: 40px;
    }

    .cg-product-quantity .qty {
        width: 55px !important;
    }

    .cg-product-subtotal {
        margin-top: 12px;
        padding-top: 10px;
    }

    .cg-product-subtotal strong {
        font-size: 13px;
    }

    .cg-cart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cg-coupon {
        width: 100%;
        flex: none;
    }

    .cg-coupon input {
        min-width: 0;
        font-size: 12px !important;
    }

    .cg-coupon-button {
        padding: 0 13px !important;
        white-space: nowrap;
    }

    .cg-update-cart {
        width: 100%;
    }

    .cg-summary-card {
        border-radius: 13px;
        padding: 17px 14px;
    }

    .cg-summary-card h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .cg-summary-row {
        font-size: 12px;
    }

    .cg-summary-total {
        margin-top: 8px;
        padding: 15px 0;
    }

    .cg-summary-total span {
        font-size: 13px;
    }

    .cg-summary-total strong {
        font-size: 17px;
    }

    .cg-checkout-button {
        height: 49px;
        font-size: 14px;
    }

    .cg-safe-payment {
        font-size: 10px;
    }

    .cg-cart-empty {
        padding: 50px 15px;
    }

    .cg-cart-empty h2 {
        font-size: 18px;
    }

    .cg-cart-empty p {
        font-size: 12px;
    }
}

/* =========================
   Very Small Screens
   ========================= */

@media (max-width: 380px) {

    .cg-cart-product {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 9px;
    }

    .cg-product-image {
        width: 78px;
        height: 78px;
    }

    .cg-product-title a,
    .cg-product-title {
        font-size: 12px;
    }

    .cg-coupon {
        gap: 5px;
    }

    .cg-coupon-button {
        padding: 0 9px !important;
        font-size: 11px !important;
    }
}


/* =========================================================
   Quantity + / -
   ========================================================= */

.cg-product-quantity .quantity {
    display: flex !important;
    align-items: center;
    justify-content: center;
    direction: ltr;
}

.cg-product-quantity .quantity .cg-qty-minus,
.cg-product-quantity .quantity .cg-qty-plus {
    width: 34px;
    height: 40px;
    flex: 0 0 34px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #15966c;
    font-size: 21px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}

.cg-product-quantity .quantity .cg-qty-minus:hover,
.cg-product-quantity .quantity .cg-qty-plus:hover {
    background: #edf8f4;
}

.cg-product-quantity .quantity .qty {
    flex: 1 1 auto;
    min-width: 0;
}

/* هنگام بروزرسانی */

.cg-cart-form.cg-cart-updating {
    opacity: .65;
    pointer-events: none;
    transition: opacity .15s ease;
}


/* Mobile */

@media (max-width: 600px) {

    .cg-product-quantity .quantity .cg-qty-minus,
    .cg-product-quantity .quantity .cg-qty-plus {
        width: 36px;
        flex-basis: 36px;
        height: 38px;
        line-height: 38px;
    }

}




/* =========================================================
   FIX QUANTITY CONTROLS
   ========================================================= */

/* تمام کنترل‌های پیش‌فرض قالب را مخفی کن */
.cg-product-quantity .quantity .minus,
.cg-product-quantity .quantity .plus,
.cg-product-quantity .quantity .wd-minus,
.cg-product-quantity .quantity .wd-plus,
.cg-product-quantity .quantity .quantity-minus,
.cg-product-quantity .quantity .quantity-plus {
    display: none !important;
}

/* کانتینر تعداد */
.cg-product-quantity .quantity {
    display: flex !important;
    align-items: center;
    justify-content: center;
    direction: ltr;
    width: 118px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #dedede !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden;
}

/* دکمه‌های خودمان */
.cg-product-quantity .cg-qty-minus,
.cg-product-quantity .cg-qty-plus {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px !important;
    height: 40px !important;
    flex: 0 0 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #15966c !important;
    font-size: 21px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    cursor: pointer;
}

/* عدد وسط */
.cg-product-quantity .quantity input.qty {
    display: block !important;
    width: 50px !important;
    height: 40px !important;
    min-width: 50px !important;
    min-height: 40px !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 14px !important;
    color: #222 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* هاور */
.cg-product-quantity .cg-qty-minus:hover,
.cg-product-quantity .cg-qty-plus:hover {
    background: #edf8f4 !important;
}

/* =========================================================
   DESKTOP - نمایش واضح تعداد
   ========================================================= */

@media (min-width: 601px) {

    .cg-product-bottom {
        align-items: flex-end;
    }

    .cg-product-quantity {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    .cg-product-quantity::before {
        content: "تعداد";
        color: #777;
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
    }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .cg-product-quantity {
        width: 100%;
    }

    .cg-product-quantity .quantity {
        width: 100% !important;
        height: 40px !important;
    }

    .cg-product-quantity .cg-qty-minus,
    .cg-product-quantity .cg-qty-plus {
        width: 36px !important;
        flex-basis: 36px !important;
        height: 38px !important;
    }

    .cg-product-quantity .quantity input.qty {
        height: 38px !important;
        min-height: 38px !important;
    }

}