/* Buy box V2 (test stage, admin-only via ?buybox=v2).
   Palette from the Figma file: dark #26344B, muted #8A94A3, green #2FB67C,
   green bg #E7F6EF, border #E2E6EC, coral #F45B62. */

.cgbb2 {
    --bb-dark: #26344b;
    --bb-muted: #8a94a3;
    --bb-green: #2fb67c;
    --bb-greenbg: #e7f6ef;
    --bb-border: #e2e6ec;
    --bb-coral: #f45b62;
    color: var(--bb-dark);
    margin-top: 1rem;
}
.cgbb2 p { margin: 0; }

/* Helper buttons */
.cgbb2-aides { display: flex; gap: 10px; margin-bottom: 20px; }
.cgbb2-aide {
    flex: 1; text-align: center; padding: 9px 12px;
    border: 1.5px solid var(--bb-coral); border-radius: 999px;
    color: var(--bb-coral); font-size: .82rem; font-weight: 600;
    text-decoration: none; transition: background .15s, color .15s;
}
.cgbb2-aide:hover { background: var(--bb-coral); color: #fff; }

/* Step titles */
.cgbb2 .cgbb2-step {
    font-size: .78rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--bb-green); margin: 34px 0 14px;
}

/* Format cards */
.cgbb2-format {
    display: flex; align-items: center; gap: 12px; width: 100%;
    border: 1.5px solid var(--bb-border); border-radius: 14px;
    background: #fff; padding: 14px 16px; margin-bottom: 10px;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.cgbb2-format input,
.cgbb2-card input { position: absolute; opacity: 0; pointer-events: none; }
.cgbb2-format.is-selected { border-color: var(--bb-green); background: var(--bb-greenbg); }
.cgbb2-format.is-oos { opacity: .45; cursor: not-allowed; }
.cgbb2-format-check {
    flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--bb-border); background: #fff; position: relative;
}
.is-selected .cgbb2-format-check { border-color: var(--bb-green); }
.is-selected .cgbb2-format-check::after {
    content: ""; position: absolute; inset: 3px; border-radius: 50%;
    background: var(--bb-green);
}
.cgbb2-format-label { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cgbb2-format-title { font-weight: 700; font-size: .95rem; }
.cgbb2-format-sub { font-size: .8rem; color: var(--bb-green); }
.cgbb2-format-sub:empty { display: none; }
.cgbb2-format:not(.is-selected) .cgbb2-format-sub { color: var(--bb-muted); }
.cgbb2-format-desc { font-size: .8rem; color: var(--bb-muted); }
.cgbb2-format-prix { text-align: right; display: flex; flex-direction: column; }
.cgbb2-format-prix del { font-size: .78rem; color: var(--bb-muted); text-decoration: line-through; }
.cgbb2-format-prix strong { font-size: 1.05rem; font-weight: 800; color: var(--bb-green); }
.cgbb2-format-prix del[hidden] { display: none; }
.cgbb2.single-mode .cgbb2-format-prix strong { color: var(--bb-dark); }
.cgbb2-oos { font-size: .8rem; color: var(--bb-coral); font-weight: 600; }
.cgbb2 .cgbb2-format-note { font-size: .78rem; color: var(--bb-muted); margin-top: 2px; }

/* Formula cards */
.cgbb2-formules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cgbb2-card {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    border: 1.5px solid var(--bb-border); border-radius: 14px; background: #fff;
    padding: 18px; padding-bottom: 46px; cursor: pointer; min-height: 200px;
    transition: border-color .15s, background .15s;
}
.cgbb2-card.is-selected { border-color: var(--bb-green); background: var(--bb-greenbg); }
.cgbb2-card .cgbb2-format-check { position: absolute; left: 18px; bottom: 16px; }
.cgbb2-pill {
    align-self: flex-start; font-size: .62rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px;
    border-radius: 999px;
}
.cgbb2-pill--coral { background: var(--bb-coral); color: #fff; }
.cgbb2-pill--grey { background: #eef0f4; color: var(--bb-dark); }
.cgbb2-card-title { font-weight: 800; font-size: 1rem; margin-top: 4px; }
.cgbb2-card-price { font-size: 1.25rem; font-weight: 800; color: var(--bb-green); }
.cgbb2-card[data-type="single"] .cgbb2-card-price { color: var(--bb-dark); }
.cgbb2-card-note { font-size: .8rem; color: var(--bb-muted); line-height: 1.35; }

/* Cost-per-day panel */
.cgbb2-repere {
    background: var(--bb-greenbg); border-radius: 14px; padding: 16px;
    margin-top: 16px;
}
.cgbb2 .cgbb2-repere-main { font-size: 1.1rem; font-weight: 800; color: var(--bb-green); }
.cgbb2 .cgbb2-repere-sub { font-size: .85rem; margin-top: 4px; }
.cgbb2 .cgbb2-repere-hint { font-size: .75rem; color: var(--bb-muted); margin-top: 4px; }

/* Benefits (reuses the ACF subscription_benefits markup) */
.cgbb2-avantages {
    background: var(--bb-greenbg); border-radius: 14px; padding: 14px 18px;
    margin-top: 14px; font-size: .9rem;
}
.cgbb2-avantages ul { margin: 0; padding: 0; list-style: none; }
/* Green check before each benefit line (works for the ACF content whether it
   renders <p> or <li>). Inline SVG: no icon-font dependency. */
.cgbb2 .cgbb2-avantages p,
.cgbb2 .cgbb2-avantages li {
    position: relative; padding: 3px 0 3px 28px; margin: 0;
}
.cgbb2 .cgbb2-avantages p::before,
.cgbb2 .cgbb2-avantages li::before {
    content: ""; position: absolute; left: 0; top: 6px;
    width: 16px; height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%232fb67c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M2.5 8.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Gift goblet */
.cgbb2-gobelet {
    display: flex; gap: 14px; align-items: center;
    border: 1.5px solid var(--bb-coral); border-radius: 14px;
    padding: 14px 18px; margin-top: 14px; font-size: .85rem;
}
.cgbb2-gobelet img { width: 34px; height: auto; flex: 0 0 34px; }

/* Frequency — custom chevron, native dropdown kept (iOS & co. untouched);
   16px font size so iOS does not auto-zoom on focus. */
.cgbb2-frequence select {
    width: 100%; padding: 13px 48px 13px 16px;
    border: 1.5px solid var(--bb-border); border-radius: 12px;
    font-size: 1rem; font-weight: 600; color: var(--bb-dark);
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%2326344b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1.5 1.5L7 7l5.5-5.5'/%3E%3C/svg%3E") no-repeat right 18px center / 13px;
    cursor: pointer;
}
.cgbb2-frequence select:focus {
    outline: none; border-color: var(--bb-green);
    box-shadow: 0 0 0 3px rgba(47, 182, 124, .18);
}
.cgbb2-frequence select::-ms-expand { display: none; }

/* One-off hint */
.cgbb2 .cgbb2-astuce { font-size: .82rem; color: var(--bb-muted); margin-top: 14px; }

/* Quantity + CTA — radii faithful to the live site controls */
.cgbb2-cta-row { display: flex; gap: 12px; margin-top: 20px; }
.cgbb2-qty {
    display: flex; align-items: stretch; border: 1.5px solid var(--bb-border);
    border-radius: 12px; overflow: hidden; flex: 0 0 auto;
}
.cgbb2-qty-btn {
    width: 34px; border: 0; background: var(--bb-greenbg); color: var(--bb-dark);
    font-size: 1.2rem; font-weight: 700; cursor: pointer;
}
.cgbb2-qty input {
    width: 48px; border: 0; text-align: center; font-weight: 700;
    font-size: .95rem; -moz-appearance: textfield; appearance: textfield;
}
.cgbb2-qty input::-webkit-outer-spin-button,
.cgbb2-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cgbb2-cta {
    flex: 1; border: 0; border-radius: 12px; background: var(--bb-coral);
    color: #fff; font-weight: 700; font-size: .95rem; padding: 12px 16px;
    cursor: pointer; transition: filter .15s;
}
.cgbb2-cta:hover { filter: brightness(.95); }

@media (max-width: 575px) {
    .cgbb2-formules { grid-template-columns: 1fr; }
    .cgbb2-card { min-height: 0; }
}

/* ------------------------------------------------------------------ */
/* "Short path" layout (per Loïc/FC, chosen by CG on 28/10/2026): the
   buying controls (format → formula → frequency → CTA) grouped
   together, supporting content (cost/day, benefits, gift) moved below
   the CTA. The .cgbb2--short class is now always on; flex-order only. */
.cgbb2--short { display: flex; flex-direction: column; margin-bottom: 8px; }
/* The theme's WooCommerce rules put 28px under form.cart with higher
   specificity — measured live; hence the !important, scoped to the variant. */
.cgbb2--short form.cart { margin-bottom: 0 !important; }
/* Wizard helper: original outlined-pill design, back at the TOP of the box
   (as in variant A); the product video carousel (Socialez, moved here from
   above the buy box) takes the bottom slot with the same 16px rhythm. */
.cgbb2--short .cgbb2-aides { order: 0; }
.cgbb2--short .cgbb2-videos { order: 2; margin: 16px 0 0; }
.cgbb2--short form { order: 1; display: flex; flex-direction: column; }
/* Even breathing room for the supporting blocks once they sit below the CTA */
.cgbb2--short .cgbb2-repere    { margin-top: 28px; }
.cgbb2--short .cgbb2-avantages { margin-top: 16px; }
.cgbb2--short .cgbb2-gobelet   { margin-top: 16px; }
.cgbb2--short .cgbb2-cta-row   { margin-top: 24px; }
.cgbb2--short .cgbb2-step--1   { order: 1; }
.cgbb2--short .cgbb2-formats   { order: 2; }
.cgbb2--short .cgbb2-step--2   { order: 3; }
.cgbb2--short .cgbb2-formules  { order: 4; }
.cgbb2--short .cgbb2-step--3   { order: 5; }
.cgbb2--short .cgbb2-frequence { order: 6; }
.cgbb2--short .cgbb2-astuce    { order: 7; }
.cgbb2--short .cgbb2-cta-row   { order: 8; }
.cgbb2--short .cgbb2-repere    { order: 9; }
.cgbb2--short .cgbb2-avantages { order: 10; }
.cgbb2--short .cgbb2-gobelet   { order: 11; }
