/* ==========================================================================
   Volume calculator

   Two columns: a picker on the left, a sticky summary on the right. The class
   names calculator.js depends on (.items-box, .qty-input, .indplus/.indminus,
   .jtab*, .clubtotal, .total_volume, .item_list, .truck-cube-box, #vcp-*) are
   styled here but never renamed.

   Selected state is driven straight off the DOM the script already maintains:
   it stores each quantity in the qty-input's `placeholder`, so
   `:has(.qty-input:not([placeholder="0"]))` highlights a chosen card with no
   extra JS and no state to keep in sync.
   ========================================================================== */

.mm-calcpage {
    padding-block: clamp(40px, 5vw, 72px);
    background: var(--mm-canvas, #f6f8fb);
}

/* -- "How this works" strip ------------------------------------------------ */
.mm-calcsteps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
}
.mm-calcsteps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--mm-surface, #fff);
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--mm-ink, #0e1b2c);
}
.mm-calcsteps span {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mm-orange, #ff9305);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

/* -- Shell ----------------------------------------------------------------- */
.mm-calc {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
@media (min-width: 992px) {
    .mm-calc { grid-template-columns: minmax(0, 1fr) 366px; gap: 28px; }
}

.mm-calc__main {
    background: var(--mm-surface, #fff);
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 18px;
    padding: clamp(16px, 2.4vw, 26px);
}

/* -- Toolbar --------------------------------------------------------------- */
.mm-calc__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-bottom: 18px;
}
.mm-calc__search {
    position: relative;
    flex: 1 1 260px;
    display: flex;
    align-items: center;
}
.mm-calc__search svg {
    position: absolute;
    left: 15px;
    color: var(--mm-orange, #ff9305);
    pointer-events: none;
}
.mm-calc__search input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 12px;
    background: var(--mm-canvas, #f6f8fb);
    font-size: .95rem;
    color: var(--mm-ink, #0e1b2c);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.mm-calc__search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--mm-orange, #ff9305);
    box-shadow: 0 0 0 4px rgba(255, 147, 5, .14);
}
.mm-calc__search input::-webkit-search-cancel-button { cursor: pointer; }
.mm-calc__toolbarhint {
    margin: 0;
    font-size: .82rem;
    color: var(--mm-muted, #667085);
}

/* -- Room tabs ------------------------------------------------------------- */
.jtabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.jtabs-nav::-webkit-scrollbar { height: 5px; }
.jtabs-nav::-webkit-scrollbar-thumb { background: var(--mm-line, #e6eaf0); border-radius: 3px; }

.jtabs-nav-link {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 999px;
    background: var(--mm-surface, #fff);
    color: var(--mm-ink, #0e1b2c);
    font-size: .87rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.jtabs-nav-link:hover { border-color: var(--mm-orange, #ff9305); color: var(--mm-orange, #ff9305); }
.jtabs-nav-link.active {
    background: var(--mm-navy, #0e1b2c);
    border-color: var(--mm-navy, #0e1b2c);
    color: #fff;
}
.jtabs-nav-link__n {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(14, 27, 44, .07);
    font-size: .72rem;
    font-weight: 700;
}
.jtabs-nav-link.active .jtabs-nav-link__n { background: rgba(255, 255, 255, .18); }
/* Count of items actually chosen in that room. */
.jtabs-nav-link__picked {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--mm-orange, #ff9305);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
}
.jtabs-nav-link__picked[hidden] { display: none; }

/* -- Item grid ------------------------------------------------------------- */
.jtab { display: none; }
.jtab.active { display: block; }

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 14px;
}

.items-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 12px 14px;
    background: var(--mm-surface, #fff);
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.items-box:hover {
    border-color: rgba(255, 147, 5, .55);
    box-shadow: 0 8px 22px rgba(14, 27, 44, .08);
    transform: translateY(-2px);
}

/* Chosen state — read straight from the placeholder the script maintains. */
.items-box__tick {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mm-orange, #ff9305);
    color: #fff;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .18s ease, transform .18s ease;
}
.items-box:has(.qty-input:not([placeholder="0"])) {
    border-color: var(--mm-orange, #ff9305);
    box-shadow: 0 0 0 3px rgba(255, 147, 5, .13);
}
.items-box:has(.qty-input:not([placeholder="0"])) .items-box__tick { opacity: 1; transform: scale(1); }

.item-image {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    color: var(--mm-navy, #0e1b2c);
}
.item-image img { max-width: 100%; max-height: 100%; object-fit: contain; }

.items_main {
    margin: 0 0 4px;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--mm-ink, #0e1b2c);
}
.items-box .item-volume {
    display: inline-block;
    margin-bottom: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--mm-canvas, #f6f8fb);
    font-size: .74rem;
    font-weight: 600;
    color: var(--mm-muted, #667085);
}

/* -- Quantity stepper ------------------------------------------------------ */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: auto 0 0;
    padding: 3px;
    list-style: none;
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 999px;
    background: var(--mm-canvas, #f6f8fb);
}
.quantity-controls li { display: flex; }

.indminus,
.indplus {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--mm-navy, #0e1b2c);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(14, 27, 44, .12);
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.indplus { background: var(--mm-orange, #ff9305); color: #fff; }
.indminus:hover:not(:disabled) { background: var(--mm-navy, #0e1b2c); color: #fff; }
.indplus:hover { transform: scale(1.08); }
.indminus:disabled,
.indminus.disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.qty-input {
    width: 34px;
    border: 0;
    background: none;
    text-align: center;
    font-size: .92rem;
    font-weight: 700;
    color: var(--mm-ink, #0e1b2c);
    pointer-events: none;
}
/* The value lives in the placeholder, so it must read as real text, not a hint. */
.qty-input::placeholder { color: var(--mm-ink, #0e1b2c); opacity: 1; }

.mm-calc__none { padding: 26px 0; color: var(--mm-muted, #667085); }

/* -- Manual item ----------------------------------------------------------- */
.mm-calc__custom {
    margin-top: 22px;
    padding: 18px;
    border: 1px dashed var(--mm-line, #d8dee8);
    border-radius: 14px;
    background: var(--mm-canvas, #f6f8fb);
}
.mm-calc__custom-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mm-calc__custom-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 147, 5, .13);
    color: var(--mm-orange, #ff9305);
}
.mm-calc__custom h4 { margin: 0; font-size: .98rem; }
.mm-calc__custom-head p { margin: 2px 0 0; font-size: .82rem; color: var(--mm-muted, #667085); }
.mm-calc__custom-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) {
    .mm-calc__custom-grid { grid-template-columns: 2fr 1.1fr .8fr auto; align-items: center; }
}
.mm-calc__custom-grid .mm-field { margin: 0; }
.mm-calc__custom-grid .mm-input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 10px;
    background: #fff;
    font-size: .9rem;
}

/* -- Summary --------------------------------------------------------------- */
@media (min-width: 992px) {
    .mm-calc__sidebar { position: sticky; top: 92px; }
}
.mm-calc-summary {
    background: var(--mm-surface, #fff);
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 34px rgba(14, 27, 44, .07);
}
.mm-calc-summary__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--mm-line, #e6eaf0);
}
.mm-calc-summary h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0;
    font-size: 1.06rem;
}
.clubtotal {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--mm-navy, #0e1b2c);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

.mm-calc-summary__readout { padding: 16px 0 4px; }
.mm-calc-summary__label {
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mm-muted, #667085);
}
.mm-calc-summary__figure {
    margin: 4px 0 0;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--mm-ink, #0e1b2c);
}
.mm-calc-summary__figure em { font-style: normal; font-size: 1rem; color: var(--mm-muted, #667085); }

/* -- Capacity meter -------------------------------------------------------- */
.mm-calcmeter { margin: 14px 0 18px; }
.mm-calcmeter__track {
    position: relative;
    height: 9px;
    border-radius: 999px;
    background: var(--mm-canvas, #eef1f6);
    overflow: hidden;
}
.mm-calcmeter__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--mm-orange, #ff9305), #ffb347);
    transition: width .45s cubic-bezier(.16, 1, .3, 1);
}
.mm-calcmeter__tick {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(14, 27, 44, .18);
}
.mm-calcmeter__scale {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 7px;
}
.mm-calcmeter__scale span {
    display: flex;
    flex-direction: column;
    font-size: .7rem;
    font-weight: 600;
    color: var(--mm-muted, #667085);
}
.mm-calcmeter__scale small { font-weight: 400; opacity: .75; }

/* -- Recommended truck ----------------------------------------------------- */
.truck-cube-box {
    display: none;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
    background: var(--mm-navy, #0e1b2c);
    color: #fff;
}
.truck-cube-box.is-visible { display: block; }
.truck-cube-box__head { display: flex; align-items: center; gap: 12px; }
.truck-cube-box img#truck-image {
    width: 62px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, .1);
}
#truck-name { font-weight: 700; font-size: .96rem; }
#truck-description { font-size: .78rem; color: rgba(255, 255, 255, .7); line-height: 1.4; }
.turck-value { display: block; margin-top: 8px; font-size: .78rem; color: var(--mm-orange, #ff9305); font-weight: 600; }

/* -- Chosen items ---------------------------------------------------------- */
.youritemslist { max-height: 260px; overflow-y: auto; margin-bottom: 16px; }
.item_list { list-style: none; margin: 0; padding: 0; }
.item_list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--mm-line, #e6eaf0);
    font-size: .87rem;
}
.item_list li:last-child { border-bottom: 0; }
.item_list .item-name { flex: 1; min-width: 0; color: var(--mm-ink, #0e1b2c); }
.item_list .item-qty {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--mm-canvas, #f6f8fb);
    font-weight: 700;
    font-size: .76rem;
}
.item_list .remove-item {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--mm-muted, #667085);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}
.item_list .remove-item:hover { background: rgba(220, 53, 69, .1); color: #dc3545; }

.mm-calc-summary__empty {
    margin: 0;
    padding: 22px 12px;
    text-align: center;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--mm-muted, #667085);
}
.mm-calc-summary__emptyicon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--mm-canvas, #f6f8fb);
    color: var(--mm-muted, #98a2b3);
}
.mm-calc-summary__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: .78rem;
    color: var(--mm-muted, #667085);
}
.mm-calc-summary__note svg { color: #12b76a; }

#booking-link { width: 100%; justify-content: center; }

/* -- Phone running total --------------------------------------------------- */
.mm-calcbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 16px;
    background: var(--mm-navy, #0e1b2c);
    box-shadow: 0 -6px 24px rgba(14, 27, 44, .22);
}
.mm-calcbar[hidden] { display: none; }
.mm-calcbar__figure { line-height: 1.2; }
.mm-calcbar__figure span { display: block; font-size: .7rem; color: rgba(255, 255, 255, .62); }
.mm-calcbar__figure strong { color: #fff; font-size: 1.05rem; }
.mm-calcbar .mm-btn { padding: 10px 20px; }
@media (min-width: 992px) {
    .mm-calcbar { display: none !important; }
}

/* -- Quote modal ----------------------------------------------------------- */
.mm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    background: rgba(8, 15, 28, .62);
    overflow-y: auto;
}
.mm-modal-backdrop.is-visible { display: flex; }
#vcp-modal .mm-modal {
    position: relative;
    width: min(560px, 100%);
    padding: 26px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(8, 15, 28, .3);
}
#vcp-modal .close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--mm-canvas, #f6f8fb);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
#vcp-modal .close:hover { background: #e9edf3; }
#vcp-modal .mm-field { margin-bottom: 13px; }
#vcp-modal label { display: block; margin-bottom: 5px; font-size: .84rem; font-weight: 600; }
#vcp-modal .mm-input,
#vcp-modal .mm-textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--mm-line, #e6eaf0);
    border-radius: 10px;
    font-size: .92rem;
}
#vcp-form-message { margin-bottom: 12px; }

@media (max-width: 991.98px) {
    .mm-calcsteps { grid-template-columns: 1fr; gap: 8px; }
    .mm-calcpage { padding-bottom: 96px; }   /* clear the fixed bar */
    .youritemslist { max-height: none; }
}
@media (max-width: 575.98px) {
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
    .mm-calc-summary__figure { font-size: 1.9rem; }
}
