/* ==========================================================
   DG Studios
   checkout-modal.css
   Built for the current checkout.js render() structure
========================================================== */

:root{
    --dg-pink:#E65581;
    --dg-bg:#0c0c0c;
    --dg-card:#141414;
    --dg-border:rgba(255,255,255,.08);
    --dg-text:#ffffff;
    --dg-muted:#9a9a9a;
    --dg-success:#4ade80;
}

/* ==========================================================
   MODAL
========================================================== */

#checkoutModal{
    position:fixed;
    inset:0;

    display:flex;
    justify-content:center;
    align-items:center;

    padding:40px;

    background:rgba(0,0,0,.82);
    backdrop-filter:blur(14px);

    opacity:0;
    visibility:hidden;
    pointer-events:none;

    transition:.35s ease;

    z-index:10000;
}

#checkoutModal.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}

/* ==========================================================
   WRAPPER
========================================================== */

.checkout-wrapper{

    width:min(1180px,96vw);

    max-height:90vh;

    overflow:hidden;

    display:flex;
    flex-direction:column;

    background:var(--dg-bg);

    border-radius:30px;

    border:1px solid rgba(230,85,129,.20);

    box-shadow:
        0 30px 90px rgba(0,0,0,.70),
        0 0 60px rgba(230,85,129,.18);

    animation:checkoutPop .35s ease;
}

@keyframes checkoutPop{

    from{
        transform:translateY(35px) scale(.96);
        opacity:0;
    }

    to{
        transform:none;
        opacity:1;
    }

}

/* ==========================================================
   HEADER
========================================================== */

.checkout-header{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:28px 36px;

    border-bottom:1px solid var(--dg-border);

}

.checkout-header h2{

    margin:0;

    color:white;

    font-size:2rem;

    font-weight:800;

}

#checkoutClose{

    width:42px;
    height:42px;

    border-radius:50%;

    border:1px solid var(--dg-border);

    background:transparent;

    color:white;

    font-size:1.4rem;

    cursor:pointer;

    transition:.25s;

}

#checkoutClose:hover{

    background:var(--dg-pink);

    color:black;

    border-color:var(--dg-pink);

}

/* ==========================================================
   BODY
========================================================== */

.checkout-body{

    display:grid;

    grid-template-columns:1.4fr .8fr;

    overflow:auto;

}

/* ==========================================================
   LEFT
========================================================== */

.checkout-left{

    padding:36px;

    overflow-y:auto;

}

.checkout-left h3{

    margin:0 0 18px;

    color:white;

    font-size:1.2rem;

}

.checkout-left input{

    width:100%;

    margin-bottom:16px;

    padding:15px 18px;

    border-radius:14px;

    border:1px solid var(--dg-border);

    background:#171717;

    color:white;

    font-size:.95rem;

    outline:none;

    transition:.25s;

}

.checkout-left input:focus{

    border-color:var(--dg-pink);

    box-shadow:0 0 0 3px rgba(230,85,129,.15);

}

/* ==========================================================
   ORDER ITEMS
========================================================== */

.checkout-item{

    display:grid;

    grid-template-columns:70px 1fr auto;

    gap:16px;

    align-items:center;

    margin-bottom:18px;

    padding:16px;

    border-radius:18px;

    background:#151515;

    border:1px solid rgba(255,255,255,.05);

}

.checkout-item img{

    width:70px;
    height:70px;

    object-fit:cover;

    border-radius:12px;

}

.checkout-item strong{

    color:white;

}

.checkout-item div{

    color:#d3d3d3;

    line-height:1.5;

}

/* ==========================================================
   RIGHT SUMMARY
========================================================== */

.checkout-right{

    background:#111;

    border-left:1px solid var(--dg-border);

    padding:36px;

    display:flex;

    flex-direction:column;

}

.summary-row{

    display:flex;

    justify-content:space-between;

    margin-bottom:18px;

    color:#d6d6d6;

    font-size:.96rem;

}

.summary-total{

    display:flex;

    justify-content:space-between;

    margin:22px 0 30px;

    font-size:1.3rem;

    color:white;

}

.checkout-right hr{

    border:none;

    border-top:1px solid var(--dg-border);

    margin:20px 0;

}

/* ==========================================================
   PAYPAL
========================================================== */

#paypalContainer{

    margin-bottom:20px;

}

/* ==========================================================
   BUTTONS
========================================================== */

#continuePaypal,
#continueCart{

    width:100%;

    padding:16px;

    border-radius:999px;

    font-weight:700;

    font-size:.95rem;

    cursor:pointer;

    transition:.25s;

}

#continuePaypal{

    background:var(--dg-pink);

    color:black;

    border:none;

    margin-bottom:14px;

}

#continuePaypal:hover{

    transform:translateY(-2px);

    box-shadow:0 12px 30px rgba(230,85,129,.35);

}

#continueCart{

    background:transparent;

    color:white;

    border:1px solid var(--dg-border);

}

#continueCart:hover{

    background:white;

    color:black;

}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width:900px){

    #checkoutModal{

        padding:14px;

    }

    .checkout-wrapper{

        width:100%;

        max-height:96vh;

    }

    .checkout-body{

        grid-template-columns:1fr;

    }

    .checkout-right{

        border-left:none;

        border-top:1px solid var(--dg-border);

    }

}

/* ==========================================================
   DISCOUNT CODE
========================================================== */

.discount-section{
    margin-top:32px;
    padding-top:28px;
    border-top:1px solid rgba(255,255,255,.08);
}

.discount-input-row{
    display:flex;
    gap:10px;
}

.discount-input-row input{
    flex:1;
    margin-bottom:0;
}

#applyDiscount{
    padding:0 24px;
    min-height:50px;

    border:0;
    border-radius:14px;

    background:#E65581;
    color:#000;

    font-weight:700;
    cursor:pointer;

    transition:.25s ease;
}

#applyDiscount:hover{
    transform:translateY(-1px);
    filter:brightness(1.08);
}

#discountMessage{
    min-height:20px;
    margin-top:10px;

    font-size:.85rem;
    color:#9a9a9a;
}

@media (max-width:600px){

    .checkout-header{

        padding:22px;

    }

    .checkout-header h2{

        font-size:1.5rem;

    }

    .checkout-left,
    .checkout-right{

        padding:22px;

    }

    .checkout-item{

        grid-template-columns:60px 1fr;

    }

    .checkout-item div:last-child{

        grid-column:2;

        justify-self:end;

    }

}
/* ==========================================================
   PAYPAL CLICK FIX
========================================================== */

#paypalContainer{
    position:relative;
    z-index:20;
    width:100%;
    min-height:45px;
    pointer-events:auto !important;
}

#paypalContainer iframe{
    position:relative;
    z-index:21;
    pointer-events:auto !important;
}

.checkout-right{
    position:relative;
    z-index:10;
    overflow:visible;
}

.checkout-wrapper{
    position:relative;
}

#checkoutContent{
    position:relative;
    z-index:1;
}

/* ==========================================================
   MOBILE CHECKOUT — COMPACT SUMMARY
   Keeps desktop checkout unchanged.
========================================================== */
@media (max-width:600px){

    /* Let the checkout use more of the phone screen. */
    #checkoutModal{
        padding:8px;
    }

    .checkout-wrapper{
        max-height:98vh;
        border-radius:24px;
    }

    /* Slightly tighter header. */
    .checkout-header{
        padding:18px 20px;
    }

    /* Compact the summary/payment area. */
    .checkout-right{
        padding:16px 20px 18px;
    }

    .checkout-right .summary-row{
        margin-bottom:10px;
        font-size:.90rem;
        line-height:1.25;
    }

    .checkout-right hr{
        margin:12px 0;
    }

    .checkout-right .summary-total{
        margin:12px 0 16px;
        font-size:1.15rem;
        line-height:1.2;
    }

    /* PayPal buttons remain comfortably tappable, without excess space. */
    #paypalContainer{
        margin-bottom:10px;
        min-height:0;
    }

    #continuePaypal,
    #continueCart{
        padding:13px 16px;
        font-size:.90rem;
    }

    #continuePaypal{
        margin-bottom:8px;
    }
}