/* =========================================================================
   Beauty CRM — Vetrina prodotti (frontend)
   Mobile-first. Barra categorie orizzontale scorrevole + griglia schede.
   ========================================================================= */

.bcs-vetrina {
    --bcs-accent: #7A2E4A;
    --bcs-cols: 2;
    --bcs-radius: 14px;
    --bcs-gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
    color: #1f1f1f;
    box-sizing: border-box;
}
.bcs-vetrina *,
.bcs-vetrina *::before,
.bcs-vetrina *::after { box-sizing: border-box; }

/* ---- Barra categorie: orizzontale, scorrevole con lo swipe su mobile ---- */
.bcs-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;                 /* Firefox */
    scroll-snap-type: x proximity;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}
.bcs-cats::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.bcs-cat {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1.5px solid #e3d7dd;
    background: #fff;
    color: #444;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.bcs-cat:hover { border-color: var(--bcs-accent); }
.bcs-cat.is-active {
    background: var(--bcs-accent);
    border-color: var(--bcs-accent);
    color: #fff;
}

/* ---- Griglia prodotti ---- */
.bcs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* mobile: 2 colonne compatte */
    gap: var(--bcs-gap);
}

.bcs-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: var(--bcs-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.bcs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.bcs-card:focus-visible {
    outline: 2px solid var(--bcs-accent);
    outline-offset: 2px;
}
.bcs-card.is-hidden { display: none; }

/* Il dettaglio completo è nascosto nella scheda: appare solo nella modale. */
.bcs-detail { display: none; }
.bcs-card__more {
    font-size: 13px;
    font-weight: 700;
    color: var(--bcs-accent);
    white-space: nowrap;
}

.bcs-card__img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f6f2f4;
    overflow: hidden;
}
.bcs-card__photo,
.bcs-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bcs-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbb9c2;
}

.bcs-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 12px 14px;
    flex: 1;
}
.bcs-card__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    color: #1f1f1f;
}
.bcs-card__brand {
    font-size: 12px;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.bcs-card__desc {
    font-size: 13px;
    color: #555;
    margin: 2px 0 0;
    line-height: 1.4;
}
.bcs-card__foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.bcs-card__price {
    font-size: 18px;
    font-weight: 800;
    color: var(--bcs-accent);
}
.bcs-card__wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    background: #25D366;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 12px;
    border-radius: 10px;
    line-height: 1;
    transition: filter .15s ease;
}
.bcs-card__wa:hover { filter: brightness(.94); }
.bcs-card__wa svg { flex: 0 0 auto; }

.bcs-empty {
    text-align: center;
    color: #888;
    padding: 32px 12px;
}

/* ---- Tablet ---- */
@media (min-width: 600px) {
    .bcs-grid { grid-template-columns: repeat(var(--bcs-cols), 1fr); }
    .bcs-card__title { font-size: 16px; }
    .bcs-card__desc  { font-size: 14px; }
}

/* ---- Desktop ---- */
@media (min-width: 900px) {
    .bcs-cat { font-size: 15px; }
}

/* =========================================================================
   Modale dettaglio prodotto
   ========================================================================= */
html.bcs-noscroll { overflow: hidden; }

.bcs-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: flex-end;      /* mobile: pannello dal basso */
    justify-content: center;
}
.bcs-modal.is-open { display: flex; }

.bcs-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 16, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: bcsFade .2s ease;
}

.bcs-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    background: #fff;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: bcsSlideUp .25s ease;
    box-shadow: 0 -8px 40px rgba(0,0,0,.25);
}

.bcs-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #333;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.bcs-modal__close:hover { background: #fff; }

.bcs-modal__content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Contenuto del dettaglio dentro la modale */
.bcs-modal__content .bcs-detail__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f6f2f4;
}
.bcs-modal__content .bcs-detail__photo,
.bcs-modal__content .bcs-detail__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bcs-modal__content .bcs-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbb9c2;
}
.bcs-modal__content .bcs-detail__body {
    padding: 18px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bcs-modal__content .bcs-detail__title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: #1f1f1f;
}
.bcs-modal__content .bcs-detail__brand {
    font-size: 13px;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.bcs-modal__content .bcs-detail__price {
    font-size: 24px;
    font-weight: 800;
    color: var(--bcs-accent);
    margin: 2px 0 4px;
}
.bcs-modal__content .bcs-detail__price .bcs-card__price { font-size: inherit; }
.bcs-modal__content .bcs-detail__desc {
    font-size: 15px;
    line-height: 1.55;
    color: #444;
}
.bcs-modal__content .bcs-detail__wa {
    margin-top: 10px;
    padding: 13px 16px;
    font-size: 16px;
}

@keyframes bcsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bcsSlideUp { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

/* Su schermi grandi la modale è centrata come card */
@media (min-width: 600px) {
    .bcs-modal { align-items: center; }
    .bcs-modal__dialog { border-radius: 18px; }
}
