/* =============================================================================
   BOY OR GIRL — LISTA DE COMPRAS DE LA DIETA (modal #shoppingListModal)
   -----------------------------------------------------------------------------
   Checklist por pasillos: semana / día, progreso, "ya lo tengo" guardado en el
   dispositivo, compartir, imprimir y envío a Amazon Fresh (solo EE. UU.).
   Usa los tokens --bog-* y el color de la etapa (--stage) de .bog-diet.
   En móvil el modal se abre como hoja inferior con cabecera y acciones fijas.
   ============================================================================= */

.bog-diet .modal-content.bds {
    display: flex;
    flex-direction: column;
    max-width: 640px;
    max-height: 88vh;
    overflow: hidden;
    padding: 0;
}
.bog-diet .bds .bd-modal-head { flex: none; }
.bog-diet .bds .bd-modal-head h5 { margin: 0; font: 700 1.2rem/1.2 var(--bog-font-display); flex: 1; }
.bog-diet .bds-body { flex: 1 1 auto; overflow-y: auto; padding: 1rem 1.25rem 1.25rem; overscroll-behavior: contain; }
.bog-diet .bds-muted { color: var(--bog-muted); margin: 0; font-size: .9rem; }

/* Semana / día */
.bog-diet .bds-scope {
    flex: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: .85rem 1.25rem 0;
    padding: 4px;
    border-radius: 999px;
    background: var(--bog-tint, #F6F3F9);
}
.bog-diet .bds-seg {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--bog-muted);
    font-weight: 700;
    font-size: .95rem;
}
.bog-diet .bds-seg.is-active { background: #fff; color: var(--bog-ink); box-shadow: 0 2px 8px rgba(27, 35, 64, .12); }

/* Progreso */
.bog-diet .bds-progress {
    padding: .9rem 1rem;
    border: 1px solid var(--bog-line);
    border-radius: 16px;
    margin-bottom: 1rem;
}
.bog-diet .bds-progress__top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.bog-diet .bds-progress__top strong { font: 700 1.05rem/1.3 var(--bog-font-display); color: var(--bog-ink); }
.bog-diet .bds-progress__track { height: 8px; border-radius: 99px; background: var(--stage-soft); margin: .55rem 0 .6rem; overflow: hidden; }
.bog-diet .bds-progress__bar { height: 100%; width: 0; border-radius: 99px; background: var(--stage); transition: width .35s ease; }
.bog-diet .bds-help { margin: 0; font-size: .85rem; color: var(--bog-muted); }
.bog-diet .bds-tools { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .6rem; flex-wrap: wrap; }
.bog-diet .bds-switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--bog-ink); cursor: pointer; margin: 0; }
.bog-diet .bds-switch input { width: 18px; height: 18px; accent-color: var(--stage); }
.bog-diet .bds-link { border: 0; background: none; padding: .25rem 0; color: var(--stage-d); font-weight: 600; font-size: .9rem; text-decoration: underline; }

/* Categorías */
.bog-diet .bds-cat { border: 1px solid var(--bog-line); border-radius: 16px; margin-bottom: .75rem; overflow: hidden; background: #fff; }
.bog-diet .bds-cat__head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    cursor: pointer;
    list-style: none;
    background: var(--bog-tint, #F6F3F9);
    min-height: 48px;
}
.bog-diet .bds-cat__head::-webkit-details-marker { display: none; }
.bog-diet .bds-cat__icon { font-size: 1.15rem; }
.bog-diet .bds-cat__name { flex: 1; font-weight: 700; color: var(--bog-ink); }
.bog-diet .bds-cat__count { font-size: .8rem; font-weight: 700; color: var(--stage-d); background: var(--stage-soft); padding: .15rem .55rem; border-radius: 99px; }
.bog-diet .bds-cat__chev { color: var(--bog-muted); transition: transform .2s ease; }
.bog-diet .bds-cat:not([open]) .bds-cat__chev { transform: rotate(-90deg); }
.bog-diet .bds-cat__hint { margin: 0; padding: .5rem 1rem 0; font-size: .82rem; color: var(--bog-muted); }

/* Ítems */
.bog-diet .bds-list { list-style: none; margin: 0; padding: .25rem 0; }
.bog-diet .bds-item { position: relative; border-top: 1px solid var(--bog-line); }
.bog-diet .bds-item:first-child { border-top: 0; }
.bog-diet .bds-check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bog-diet .bds-item__label {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    min-height: 52px;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}
.bog-diet .bds-box {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--bog-line);
    background: #fff;
    display: grid;
    place-items: center;
    transition: background .15s ease, border-color .15s ease;
}
.bog-diet .bds-box::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.bog-diet .bds-check:checked + .bds-item__label .bds-box { background: var(--stage); border-color: var(--stage); }
.bog-diet .bds-check:checked + .bds-item__label .bds-box::after { opacity: 1; }
.bog-diet .bds-check:focus-visible + .bds-item__label { outline: 3px solid var(--bog-focus); outline-offset: -3px; border-radius: 10px; }
.bog-diet .bds-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bog-diet .bds-item__name { color: var(--bog-ink); font-weight: 600; line-height: 1.3; }
.bog-diet .bds-item__for { color: var(--bog-muted); font-size: .78rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bog-diet .bds-item__qty { flex: none; max-width: 45%; text-align: right; font-size: .88rem; font-weight: 700; color: var(--bog-ink); }
.bog-diet .bds-item.is-done .bds-item__name { text-decoration: line-through; color: var(--bog-muted); font-weight: 400; }
.bog-diet .bds-item.is-done .bds-item__qty { color: var(--bog-muted); font-weight: 400; }
.bog-diet .bds-hide-done .bds-item.is-done { display: none; }

/* Acciones fijas abajo */
.bog-diet .bds-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .85rem 1.25rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--bog-line);
    background: #fff;
}
.bog-diet .bds-actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.bog-diet .bds-actions__row .bd-btn { width: 100%; justify-content: center; }
.bog-diet .bds-amazon { display: flex; flex-direction: column; gap: .35rem; }
.bog-diet .bds-amazon__btn { width: 100%; justify-content: center; }
.bog-diet .bds-amazon__note { margin: 0; font-size: .74rem; line-height: 1.4; color: var(--bog-muted); }
.bog-diet .bds-amazon__note a { color: var(--bog-ink); text-decoration: underline; }

/* Botón Amazon (modal y pie de la dieta): texto oscuro sobre naranja = contraste AA */
.bog-diet .bd-btn--amazon { background: #FF9900; border-color: #FF9900; color: #1B2340; }
.bog-diet .bd-btn--amazon:hover,
.bog-diet .bd-btn--amazon:focus { background: #E68A00; border-color: #E68A00; color: #1B2340; text-decoration: none; }
.bog-diet a.bd-btn--amazon { text-decoration: none; }
.bog-diet .bd-btn--amazon[disabled] { background: var(--bog-line); border-color: var(--bog-line); color: var(--bog-muted); }

body.bd-modal-open { overflow: hidden; }

/* Móvil: hoja inferior */
@media (max-width: 600px) {
    .bog-diet #shoppingListModal { backdrop-filter: none; }
    .bog-diet .modal-content.bds {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 92vh;
        margin: 0;
        border-radius: 22px 22px 0 0;
        animation: bdsSheetUp .25s ease;
    }
    .bog-diet .bds-body { padding: .85rem 1rem 1rem; }
    .bog-diet .bds-scope { margin: .75rem 1rem 0; }
    .bog-diet .bds-actions { padding-left: 1rem; padding-right: 1rem; gap: .5rem; }
    .bog-diet .bds-actions__row .bd-btn { min-height: 42px; padding: .45rem .8rem; }
    .bog-diet .bds-item__label { padding: .55rem .85rem; }
}
@keyframes bdsSheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .bog-diet .modal-content.bds { animation: none; }
    .bog-diet .bds-progress__bar, .bog-diet .bds-box, .bog-diet .bds-cat__chev { transition: none; }
}
