/* Hide WooCommerce's one-variation selector only on products enabled for Carton Mix. */
.ybcm-enabled-product form.variations_form.cart { display: none !important; }

.ybcm-mixer {
    --ybcm-green:#7dbd4d; --ybcm-green-dark:#5c9a2f; --ybcm-dark:#182230;
    --ybcm-border:#e3e8ef; --ybcm-soft:#f7f9fc; --ybcm-muted:#667085;
    margin:20px 0; border:1px solid var(--ybcm-border); border-radius:18px;
    background:#fff; overflow:visible; box-shadow:0 8px 28px rgba(16,24,40,.05);
}
.ybcm-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:18px; background:var(--ybcm-soft); border-bottom:1px solid var(--ybcm-border); border-radius:18px 18px 0 0; }
.ybcm-heading h3 { margin:0 0 6px; font-size:24px; line-height:1.2; color:var(--ybcm-dark); }
.ybcm-heading p { margin:0; color:var(--ybcm-muted); line-height:1.55; }
.ybcm-rule-badge { flex:0 0 auto; padding:9px 13px; border-radius:999px; background:var(--ybcm-green); color:#fff; font-weight:800; white-space:nowrap; }
.ybcm-groups { padding:16px 16px 6px; }
.ybcm-group { margin-bottom:18px; }
.ybcm-group h4 { margin:0 0 10px; font-size:16px; color:var(--ybcm-dark); }

/* Mobile-first catalogue cards. */
.ybcm-variation-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.ybcm-variation-row { position:relative; display:flex; flex-direction:column; min-width:0; padding:9px; border:1px solid var(--ybcm-border); border-radius:15px; background:#fff; overflow:hidden; transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.ybcm-variation-row.has-selection { border-color:var(--ybcm-green); box-shadow:0 0 0 3px rgba(125,189,77,.16); background:#fbfff8; }
.ybcm-variation-row.has-selection::after { content:'✓'; position:absolute; top:14px; right:14px; z-index:3; display:grid; place-items:center; width:27px; height:27px; border-radius:50%; background:var(--ybcm-green); color:#fff; font-size:16px; font-weight:900; box-shadow:0 2px 8px rgba(39,80,18,.22); }
.ybcm-variation-row.is-out-of-stock { opacity:.55; background:#fafafa; }
.ybcm-variation-main { display:flex; flex:1; flex-direction:column; align-items:stretch; gap:9px; min-width:0; }
.ybcm-image-button { position:relative; display:block; width:100%; aspect-ratio:1/1; margin:0; padding:0; overflow:hidden; border:0; border-radius:11px; background:#f2f4f7; cursor:zoom-in; }
.ybcm-image-button:focus-visible { outline:3px solid rgba(125,189,77,.48); outline-offset:2px; }
.ybcm-image-button img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .22s ease; }
.ybcm-image-button:hover img,.ybcm-image-button:focus-visible img { transform:scale(1.045); }
.ybcm-image-zoom-label { position:absolute; left:7px; bottom:7px; padding:4px 8px; border-radius:999px; background:rgba(17,24,39,.78); color:#fff; font-size:10px; font-weight:800; line-height:1.2; pointer-events:none; }
.ybcm-variation-details { min-width:0; padding:0 2px; }
.ybcm-variation-details strong { display:block; color:var(--ybcm-dark); font-size:14px; font-weight:800; line-height:1.35; }
.ybcm-variation-label { min-height:2.7em; }
.ybcm-variation-label-line { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ybcm-price { display:block; margin-top:3px; color:var(--ybcm-green-dark); font-size:15px; font-weight:800; }
.ybcm-stock-status { display:block; margin-top:2px; color:var(--ybcm-muted); font-size:11px; }
.ybcm-stepper { display:grid; grid-template-columns:42px minmax(0,1fr) 42px; align-items:center; width:100%; margin-top:10px; }
.ybcm-stepper button,.ybcm-stepper input { width:100%; height:44px; margin:0; border:1px solid #d0d5dd; background:#fff; text-align:center; border-radius:0; }
.ybcm-stepper button { padding:0; color:var(--ybcm-dark); font-size:22px; font-weight:700; line-height:1; cursor:pointer; touch-action:manipulation; }
.ybcm-stepper button:first-child { border-radius:10px 0 0 10px; }
.ybcm-stepper button:last-child { border-radius:0 10px 10px 0; }
.ybcm-stepper input { border-left:0; border-right:0; font-size:16px; font-weight:800; -moz-appearance:textfield; }
.ybcm-stepper input::-webkit-outer-spin-button,.ybcm-stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

.ybcm-footer { position:sticky; bottom:0; z-index:50; display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,300px); gap:14px; align-items:center; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--ybcm-border); border-radius:0 0 18px 18px; background:rgba(255,255,255,.97); backdrop-filter:blur(10px); box-shadow:0 -8px 24px rgba(16,24,40,.08); }
.ybcm-progress-text,.ybcm-total-line { display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--ybcm-dark); }
.ybcm-total-line { margin-top:4px; font-size:14px; }
.ybcm-total-line strong { color:var(--ybcm-green-dark); font-size:17px; }
.ybcm-progress { height:7px; margin-top:7px; border-radius:999px; background:#e6e9ee; overflow:hidden; }
.ybcm-progress span { display:block; width:0; height:100%; border-radius:inherit; background:var(--ybcm-green); transition:width .2s ease; }
.ybcm-status { margin:5px 0 0; color:var(--ybcm-muted); font-size:12px; line-height:1.35; }
.ybcm-add-button { width:100%; min-height:50px; border-radius:12px !important; font-weight:800 !important; }
.ybcm-add-button:disabled { opacity:.48; cursor:not-allowed; }
.ybcm-mixer.is-valid .ybcm-status { color:#2f7d32; font-weight:700; }

.ybcm-lightbox[hidden] { display:none !important; }
.ybcm-lightbox { position:fixed; inset:0; z-index:999999; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(8,12,20,.9); backdrop-filter:blur(5px); }
.ybcm-lightbox-dialog { width:min(94vw,900px); max-height:92vh; display:flex; flex-direction:column; align-items:center; gap:10px; }
.ybcm-lightbox-image { display:block; max-width:100%; max-height:calc(92vh - 64px); border-radius:14px; background:#fff; object-fit:contain; box-shadow:0 24px 70px rgba(0,0,0,.38); }
.ybcm-lightbox-caption { max-width:860px; margin:0; color:#fff; text-align:center; font-size:15px; line-height:1.45; }
.ybcm-lightbox-close { position:fixed; top:12px; right:12px; width:48px; height:48px; padding:0; border:1px solid rgba(255,255,255,.45); border-radius:50%; background:rgba(17,24,39,.75); color:#fff; font-size:32px; line-height:42px; cursor:pointer; }
body.ybcm-lightbox-open { overflow:hidden; }
.ybcm-locked-quantity { display:inline-block; min-width:34px; padding:5px 8px; border-radius:6px; background:#f3f4f6; text-align:center; font-weight:700; }

@media (min-width:768px) {
    .ybcm-variation-list { grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; }
    .ybcm-variation-row { padding:11px; }
}
@media (max-width:480px) {
    .ybcm-mixer { margin:14px 0; border-radius:14px; }
    .ybcm-heading { padding:14px 12px; border-radius:14px 14px 0 0; }
    .ybcm-heading h3 { font-size:20px; }
    .ybcm-heading p { font-size:13px; }
    .ybcm-rule-badge { display:none; }
    .ybcm-groups { padding:12px 9px 2px; }
    .ybcm-variation-list { gap:8px; }
    .ybcm-variation-row { padding:7px; border-radius:12px; }
    .ybcm-image-button { border-radius:9px; }
    .ybcm-variation-details strong { font-size:13px; }
    .ybcm-price { font-size:14px; }
    .ybcm-stepper { grid-template-columns:38px minmax(0,1fr) 38px; }
    .ybcm-stepper button,.ybcm-stepper input { height:42px; }
    .ybcm-footer { grid-template-columns:1fr; gap:9px; padding:10px 11px calc(10px + env(safe-area-inset-bottom)); border-radius:0 0 14px 14px; }
    .ybcm-status { display:none; }
    .ybcm-add-button { min-height:48px; }
}

/* Keep prices readable in RTL languages and show a clear dollar amount. */
.ybcm-price, #ybcm-total-price { direction:ltr; unicode-bidi:isolate; font-variant-numeric:tabular-nums; }
#ybcm-total-price { display:inline-block; min-width:72px; text-align:right; }
.ybcm-mixer.is-valid .ybcm-add-button:not(:disabled) { background:var(--ybcm-green-dark) !important; border-color:var(--ybcm-green-dark) !important; color:#fff !important; opacity:1; }

/* Cart group controls: one safe edit/remove panel for the entire carton mix. */
.ybcm-cart-group-actions {
    margin:10px 0 4px;
    padding:11px 12px;
    border:1px solid #dfe7d8;
    border-radius:10px;
    background:#f8fcf5;
}
.ybcm-cart-group-summary {
    margin-bottom:9px;
    color:#475467;
    font-size:12px;
    line-height:1.45;
}
.ybcm-cart-group-buttons {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.ybcm-cart-group-buttons .button {
    min-height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 12px !important;
    border-radius:8px !important;
    font-size:12px !important;
    font-weight:800 !important;
    line-height:1.2 !important;
    text-decoration:none !important;
}
.ybcm-edit-mix {
    border-color:#6ea93e !important;
    background:#78b84a !important;
    color:#fff !important;
}
.ybcm-remove-entire-mix {
    border-color:#f0c5c5 !important;
    background:#fff5f5 !important;
    color:#b42318 !important;
}
@media (max-width:600px) {
    .ybcm-cart-group-buttons { display:grid; grid-template-columns:1fr; }
    .ybcm-cart-group-buttons .button { width:100%; min-height:44px; }
}
