/* =================================================================== */
/* 1. Main Layout & Responsive
/* =================================================================== */

/* Layout */
.tp-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr);
    gap: 2.5rem;
    align-items: flex-start;
    margin: 2rem 0 4rem;
    padding: 1.5rem;
    background: radial-gradient(circle at top left, #fff7ed 0, #fff 55%);
    /*border-radius: 18px;*/
}

/* Mobile: stack */
@media (max-width: 900px) {
    .tp-cart-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .tp-cart-items {
        order: 0;
    }

    .tp-cart-summary {
        order: 1;
    }
}

/* =================================================================== */
/* 2. Left Column: Cart List
/* =================================================================== */

/* Left side */
.tp-cart-title {
    font-size: 1.7rem;
    margin: 0 0 1.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tp-cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty state */
.tp-cart-empty {
    padding: 2.5rem 2rem;
    border-radius: 16px;
    background: #fffdf7;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    color: #7c5b4a;
}

/* =================================================================== */
/* 3. Item Card Structure
/* =================================================================== */

/* Item cards */
.tp-cart-item-card {
    position: relative;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(253, 186, 116, 0.4); /* light orange */
    overflow: hidden;
}

.tp-cart-item-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(254, 243, 199, 0.45), transparent 55%);
    opacity: 0.4;
    pointer-events: none;
}

/* Item main layout */
.tp-cart-item-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Remove button */
.tp-cart-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: none;
    background: #fff0f0;
    color: #b91c1c;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tp-cart-remove:hover {
    background: #fecaca;
}

/* =================================================================== */
/* 4. Item Card: Image & Info
/* =================================================================== */

.tp-cart-thumb {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff7ed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tp-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tp-cart-thumb-placeholder {
    font-size: 1.6rem;
}

/* Item info */
.tp-cart-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tp-cart-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.tp-cart-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #3b2f2f;
}

.tp-cart-sku {
    font-size: 0.8rem;
    color: #9b7b6a;
}

.tp-cart-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tp-cart-tag {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #fef3c7;
    font-size: 0.75rem;
    color: #92400e;
}

/* =================================================================== */
/* 5. Item Card: Controls (Qty, Price, Add-ons, Subtotal)
/* =================================================================== */

/* =================================================================== */
/* Add-ons under product name                                          */
/* =================================================================== */

.tp-cart-addons {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #7a6a5d;
}

.tp-cart-addon-row {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
}

.tp-cart-addon-name {
    font-style: italic;
}

.tp-cart-addon-meta {
    white-space: nowrap;
}

/* one-line summary column in the controls row */
.tp-cart-addons-summary {
    font-size: 0.85rem;
    color: #7a6a5d;
    margin-top: 2px;
}

/* =================================================================== */
/* Controls row: Qty | Price | Add-ons | Subtotal                      */
/* =================================================================== */

.tp-cart-controls {
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)   /* Qty      */
        minmax(0, 1fr)     /* Price    */
        minmax(0, 1fr)     /* Add-ons  */
        minmax(0, 1.2fr);  /* Subtotal */
    column-gap: 1.5rem;
    align-items: flex-end;
    margin-top: 0.35rem;
}

/* Qty block */
.tp-cart-qty label {
    font-size: 0.8rem;
    color: #4b3b35;
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tp-cart-qty-input {
    width: 60px;
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
    border: 1px solid #fed7aa;
    text-align: center;
    font-size: 0.85rem;
}

.tp-cart-qty-input:focus {
    outline: 2px solid #fb923c;
    outline-offset: 1px;
}

/* Table-like columns */
.tp-cart-price,
.tp-cart-addons-summary,
.tp-cart-subtotal {
    text-align: center;
}

.tp-cart-subtotal {
    text-align: right; /* make the total feel like a total */
}

/* Labels + values shared style */
.tp-cart-price-label {
    display: block;
    font-size: 0.75rem;
    color: #a16207;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-cart-price-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #3b2f2f;
}

/* Slightly softer style for Add-ons column */
.tp-cart-addons-summary .tp-cart-price-label {
    color: #946032;
}

.tp-cart-addons-summary .tp-cart-price-value {
    font-size: 0.9rem;
}

/* Mobile: Qty full-width on top, others in a 2x2 grid */
@media (max-width: 600px) {
    .tp-cart-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 0.4rem;
    }

    .tp-cart-qty {
        grid-column: 1 / 3;
        text-align: left;
    }

    .tp-cart-price,
    .tp-cart-addons-summary,
    .tp-cart-subtotal {
        text-align: left;
    }

    .tp-cart-subtotal {
        text-align: right;
    }
}


/* =================================================================== */
/* 6. Right Column: Summary Card
/* =================================================================== */

/* Summary card (right side) */
.tp-cart-summary {
    position: relative;
}

.tp-cart-summary-card {
    position: sticky;
    top: 1.5rem;
    border-radius: 18px;
    background: #614936;
    color: #fefce8;
    padding: 1.8rem 1.6rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.tp-cart-summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1.1rem;
}

.tp-cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.tp-cart-summary-subtotal {
    font-weight: 600;
    border-top: 1px dashed rgba(254, 249, 195, 0.4);
    padding-top: 0.8rem;
    margin-top: 0.6rem;
}

.tp-cart-checkout-btn {
    width: 100%;
    margin-top: 1.2rem;
    border-radius: 999px;
    border: none;
    padding: 0.75rem 1.2rem;
    background: linear-gradient(135deg, #f97316, #fb7185);
    color: #fff7ed;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(248, 113, 113, 0.45);
}

.tp-cart-checkout-btn:hover {
    filter: brightness(1.05);
}

.tp-cart-summary-note {
    margin-left: 2.15rem;
    font-size: 0.78rem;
    color: #e5e7eb;
    opacity: 0.9;
}

/* =================================================================== */
/* 7. General Buttons (Continue Shopping, Update)
/* =================================================================== */

.tp-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tp-cart-btn {
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.tp-cart-btn:active {
    transform: translateY(1px);
}

.tp-cart-btn-secondary {
    background: #ffffff;
    color: #7c5b4a;
    border-color: rgba(124, 91, 74, 0.35);
}

.tp-cart-btn-secondary:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.tp-cart-btn {
    background: transparent;
    color: #b45309;
    border-color: #f59e0b;
}

.tp-cart-btn:hover {
    background: #fffbeb;
}

/* =================================================================== */
/* 8. Full-size Image Modal
/* =================================================================== */

.tp-image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tp-image-modal.is-open {
    display: flex;
}

.tp-image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.tp-image-modal__content {
    position: relative;
    max-width: min(90vw, 480px);
    max-height: min(90vh, 640px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.tp-image-modal__img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
}

.tp-image-modal__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-image-modal__close:hover {
    background: #fee2e2;
}

/* Show "zoom" cursor on your cart thumb images */
.tp-cart-thumb-img {
    cursor: zoom-in;
}

.tp-image-modal__caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #4b3b35;
    text-align: center;
}
