
/* =========================
   PBPL ROOT WRAPPER
========================= */

.pbpl-wrapper{
    max-width:900px;
    margin:40px auto;
    padding:20px;
    font-family:Arial, sans-serif;

    display:flex;
    flex-direction:column;
    gap:18px;
    box-sizing:border-box;
}

/* =========================
   TOTAL DISPLAY (DEFAULT MOBILE)
========================= */

.pbpl-total{
    background:#126b3f;
    color:#fff;
    padding:25px;
    border-radius:10px;
    text-align:center;
}

#pbpl-total{
    font-size:42px;
    font-weight:bold;
    margin-top:10px;
}

/* =========================
   ACTION BUTTONS
========================= */

.pbpl-actions{
    text-align:center;
    margin:10px 0 20px;
}

#pbpl-reset,
#pbpl-print,
#pbpl-explain{
    background:#0f3d2e;
    color:#fff;
    border:none;
    padding:10px 14px;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
    margin:3px;
}

#pbpl-reset{
    background:#c0392b;
}

#pbpl-reset:hover{
    background:#a93226;
}

/* =========================
   BREAKDOWN BOX
========================= */

#pbpl-breakdown{
    background:#f8f8f8;
    padding:15px;
    border-radius:10px;
    font-size:14px;
    line-height:1.6;
}

/* =========================
   CARD SYSTEM
========================= */

.pbpl-card{
    background:#fff;
    border-radius:12px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    overflow:hidden;
}

/* HEADER */
.pbpl-card h2.pbpl-toggle{
    margin:0;
    padding:14px 16px;
    background:#0f3d2e;
    color:#fff;
    cursor:pointer;
    user-select:none;
    font-size:16px;

    display:flex;
    justify-content:space-between;
    align-items:center;
}

.pbpl-card h2.pbpl-toggle::after{
    content:"▼";
    font-size:12px;
    opacity:0.8;
}

.pbpl-card.collapsed h2.pbpl-toggle::after{
    content:"►";
}

/* BODY */
.pbpl-card-body{
    padding:12px 16px;
}

.pbpl-card.collapsed .pbpl-card-body{
    display:none;
}

/* =========================
   OPTION ROWS
========================= */

.pbpl-card-body label{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;

    padding:10px 0;
    border-bottom:1px solid #eee;
    cursor:pointer;
    transition:0.15s ease;
}

.pbpl-card-body label:hover{
    background:#f9f9f9;
}

/* highlight selected */
.pbpl-card-body label:has(input:checked){
    background:#eaf7ef;
    border-left:4px solid #126b3f;
    padding-left:10px;
}

.pbpl-card-body label span{
    flex:1;
    font-size:14px;
}

/* inputs */
.pbpl-card-body input[type="checkbox"],
.pbpl-card-body input[type="radio"]{
    transform:scale(1.1);
    margin-right:10px;
}

/* =========================
   QUANTITY STEPPER
========================= */

.qty-control{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
}

.qty-control button{
    width:42px;
    height:42px;
    border-radius:50%;
    border:none;

    background:#0f3d2e;
    color:#fff;

    font-size:20px;
    font-weight:bold;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
    transition:0.15s ease;
}

.qty-control button:hover{
    background:#145c44;
    transform:scale(1.05);
}

.qty-control button:active{
    transform:scale(0.92);
}

.qty-control input{
    width:60px;
    height:42px;
    text-align:center;
    font-size:16px;
    border:1px solid #ccc;
    border-radius:8px;
}

/* =========================
   MOBILE OPTIMIZATION
========================= */

@media (max-width:600px){

    .pbpl-wrapper{
        padding:12px;
        gap:12px;
    }

    .pbpl-total{
        position:sticky;
        top:0;
        z-index:999;
    }

    #pbpl-total{
        font-size:34px;
    }

    .qty-control button{
        width:46px;
        height:46px;
        font-size:22px;
    }

    .qty-control input{
        width:70px;
        height:46px;
        font-size:18px;
    }
}

/* =========================
   DESKTOP FLOATING TOTAL HUD
========================= */

@media (min-width:901px){

    .pbpl-total{
        position:fixed;
        right:20px;
        top:120px;
        width:240px;
        z-index:9999;

        margin:0;

        border-radius:12px;
        box-shadow:0 10px 25px rgba(0,0,0,0.25);

        background:rgba(18,107,63,0.95);
        backdrop-filter: blur(8px);
        border:1px solid rgba(255,255,255,0.1);
    }

    #pbpl-total{
        font-size:34px;
    }
}

/* =========================
   PRINT MODE
========================= */

@media print{

    #pbpl-reset,
    #pbpl-print,
    #pbpl-explain,
    .plus,
    .minus{
        display:none !important;
    }

    body{
        background:#fff;
    }

    .pbpl-card{
        break-inside:avoid;
    }
}

@keyframes pbplPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pbpl-total.pulse {
    animation: pbplPulse 0.25s ease;
}

.cat-total{
    margin-left:auto;
    font-size:12px;
    opacity:0.9;
    font-weight:normal;
    background:rgba(255,255,255,0.15);
    padding:3px 8px;
    border-radius:20px;
}

.pbpl-card-body label:has(input:checked){
    background:#eaf7ef;
    border-left:5px solid #126b3f;
    padding-left:12px;
    position:relative;
}

.pbpl-card-body label:has(input:checked)::after{
    content:"✓";
    position:absolute;
    right:10px;
    color:#126b3f;
    font-weight:bold;
}

@media (max-width:600px){

    .pbpl-card-body label{
        flex-direction:row;
        align-items:center;
        justify-content:space-between;
    }

    .pbpl-card-body label span{
        flex:1;
        padding-right:10px;
    }

    .qty-control{
        transform:scale(0.95);
    }
}

.pbpl-card{
    transition:0.15s ease;
}

.pbpl-card:hover{
    transform:translateY(-1px);
    box-shadow:0 6px 18px rgba(0,0,0,0.12);
}

