/**
 * Cart Styles
 * 
 * @package GeneratePress_Child
 * @since 1.0.0
 */

/* ================================== */
/* Cart Modal Overlay                 */
/* ================================== */

.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: transparent;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.cart-modal-overlay.is-visible {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

/* ================================== */
/* Cart Container — Mobile Default    */
/* ================================== */

.cart-app-container {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 0 0 40px 40px;
    padding: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    overflow: hidden;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s ease;
}

.cart-modal-overlay.is-visible .cart-app-container {
    transform: translateY(0);
    opacity: 1;
}

/* ================================== */
/* Cart Header                        */
/* ================================== */

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px;
    flex-shrink: 0;
}

.cart-app-container .page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.cart-app-container .icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.cart-app-container .icon-btn:hover {
    background-color: #eee;
}

/* ================================== */
/* Cart Items List                    */
/* ================================== */

.cart-items-list {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cart-items-list::-webkit-scrollbar {
    display: none;
}

/* ================================== */
/* Cart Item Card                     */
/* ================================== */

.cart-item {
    position: relative;
}

.cart-item-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.cart-item-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ================================== */
/* Item Image                         */
/* ================================== */

.cart-app-container .item-image {
    width: 70px;
    height: auto;
    min-height: 70px;
    object-fit: cover;
    border-radius: 14px;
    align-self: stretch;
    flex-shrink: 0;
}

/* ================================== */
/* Item Info                          */
/* ================================== */

.cart-app-container .item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.cart-app-container .item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.cart-app-container .item-desc {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* ================================== */
/* Item Price Row                     */
/* ================================== */

.item-price-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.price-unit {
    font-size: 0.9rem;
    font-weight: 700;
    color: #000;
}

.price-qty-badge {
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
}

.price-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f4a7c;
}

/* ================================== */
/* Item Actions (qty + remove)        */
/* ================================== */

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ================================== */
/* Remove Button                      */
/* ================================== */

.cart-app-container .remove-btn {
    background: #f0f0f0;
    border: none;
    color: #aaa;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.cart-app-container .remove-btn:hover {
    background: #ff4d4d;
    color: #fff;
}

/* ================================== */
/* Quantity Control                   */
/* ================================== */

.cart-app-container .quantity-control {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
}

.cart-app-container .qty-btn {
    background-color: #f0f0f0;
    border: none;
    color: #000;
    font-size: 1rem;
    font-weight: 500;
    width: 32px;
    height: 30px;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s;
}

.cart-app-container .qty-btn:hover {
    background-color: #ddd;
}

.cart-app-container .qty-value {
    padding: 0 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================== */
/* Cart Summary                       */
/* ================================== */

.cart-summary {
    flex-shrink: 0;
    padding: 20px 0 0;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.summary-card {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 24px;
    padding: 25px;
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.summary-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.summary-card-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background: #0f4a7c;
    padding: 4px 10px;
    border-radius: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-label {
    font-size: 1rem;
    color: #888;
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.shipping-value {
    color: #888;
}

.summary-divider {
    border-top: 1px dashed #ddd;
    margin: 15px 0;
}

.total-line {
    font-weight: 700;
    margin-top: 5px;
}

.total-line .summary-label {
    font-size: 1.1rem;
    color: #000;
    font-weight: 700;
}

.total-line .summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
}

/* ================================== */
/* Checkout Button                    */
/* ================================== */

.cart-app-container .checkout-btn {
    width: 100%;
    background-color: #0f4a7c;
    color: #fff;
    border: none;
    padding: 18px 0;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
}

.cart-app-container .checkout-btn:hover {
    background-color: #0a3556;
}

/* ================================== */
/* Promo Code — Hidden                */
/* ================================== */

.promo-code-section {
    display: none;
}

/* ================================== */
/* Empty Cart State                   */
/* ================================== */

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.cart-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cart-empty-icon i {
    font-size: 2.2rem;
    color: #bbb;
}

.cart-empty-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px;
}

.cart-empty-sub {
    font-size: 0.95rem;
    color: #999;
    margin: 0 0 28px;
}

.cart-empty-btn {
    padding: 13px 32px;
    background: #0f4a7c;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cart-empty-btn:hover {
    background: #0a3556;
}

/* ================================== */
/* Mobile (max 450px)                 */
/* ================================== */

@media (max-width: 450px) {
    .cart-app-container {
        min-height: 100vh;
        border-radius: 0;
        padding: 20px 15px;
        box-shadow: none;
    }
}

/* ================================== */
/* Desktop (min 900px)                */
/* ================================== */

@media (min-width: 900px) {
    .cart-app-container {
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        margin-top: 60px;
        border-radius: 40px 40px 0 0;
        padding: 0;
    }

    .cart-header {
        width: 80%;
        margin: 0 auto;
        padding: 30px 0 25px;
        border-bottom: 1px solid #eee;
    }

    .cart-app-container .page-title {
        font-size: 2rem;
        font-weight: 700;
    }

    .cart-inner {
        width: 80%;
        margin: 0 auto;
        flex: 1 1 0;
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 0 50px;
        overflow: hidden;
        padding: 30px 0;
    }

    .cart-items-list {
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 20px;
    }

    .cart-items-list::-webkit-scrollbar {
        width: 6px;
        display: block;
    }

    .cart-items-list::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 10px;
    }

    .cart-summary {
        padding: 0;
        border-top: none;
        margin-top: 0;
        align-self: start;
        position: sticky;
        top: 0;
    }

    .cart-app-container .item-image {
        width: 80px;
        min-height: 80px;
    }

    .cart-app-container .item-name {
        font-size: 1rem;
    }

    .cart-app-container .item-desc {
        font-size: 0.85rem;
    }

    .total-line .summary-label {
        font-size: 1.2rem;
    }

    .total-line .summary-value {
        font-size: 1.5rem;
    }

    .cart-app-container .checkout-btn {
        margin-top: 30px;
    }
}