/* Ficha de producto (producto.php): galería con miniaturas, columna de compra fija en compu,
   variantes, acordeones y relacionados. Colores y tamaños explícitos: core-style.css pone los <a> blancos y de 12px. */

.pb-ficha-main { display: block; }
.pb-ficha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 8px; padding-bottom: 32px; }
@media (min-width: 992px) {
    .pb-ficha { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; padding-top: 16px; padding-bottom: 56px; }
}

/* ---- Galería ---- */
.pb-ficha-galeria { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pb-ficha-fotos { position: relative; min-width: 0; border-radius: 12px; overflow: hidden; background: #fff; }
.pb-ficha-fotos img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.pb-ficha-fotos .owl-nav .owl-prev, .pb-ficha-fotos .owl-nav .owl-next {
    position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.9) !important; box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; opacity: .85; cursor: pointer; z-index: 2; }
.pb-ficha-fotos .owl-nav .owl-prev { left: 10px; }
.pb-ficha-fotos .owl-nav .owl-next { right: 10px; }
.pb-ficha-fotos .owl-nav .owl-prev:hover, .pb-ficha-fotos .owl-nav .owl-next:hover { opacity: 1; }
.pb-ficha-fotos .owl-nav img { width: 18px; height: auto; aspect-ratio: auto; background: none; }
.pb-ficha-fotos .owl-dots { display: none; }
.pb-ficha-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pb-ficha-thumbs::-webkit-scrollbar { display: none; }
.pb-thumb { flex: 0 0 auto; width: 64px; height: 64px; padding: 0; border: 2px solid #e6e6e6; border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.pb-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pb-thumb:hover { border-color: #bdbdbd; }
.pb-thumb.activa { border-color: #1d1d1b; }
@media (min-width: 992px) {
    /* miniaturas verticales a la izquierda, como MercadoLibre */
    .pb-ficha-galeria.con-thumbs { flex-direction: row-reverse; align-items: flex-start; gap: 12px; }
    .pb-ficha-galeria.con-thumbs .pb-ficha-fotos { flex: 1 1 auto; }
    .pb-ficha-galeria.con-thumbs .pb-ficha-thumbs { flex-direction: column; overflow: visible; }
    .pb-thumb { width: 72px; height: 72px; }
    /* la foto no empuja el botón debajo del pliegue */
    .pb-ficha-fotos { max-height: calc(100vh - 190px); }
    .pb-ficha-fotos img { max-height: calc(100vh - 190px); }
}

/* ---- Columna de compra ---- */
.pb-ficha-compra { min-width: 0; color: #1d1d1b; }
@media (min-width: 992px) {
    .pb-ficha-compra { position: sticky; top: 150px; }
}
.pb-ficha-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pb-ficha-cat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1f1f1; color: #555; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pb-ficha-nombre { margin: 0 0 10px; color: #1d1d1b; font-size: 26px; line-height: 1.2; }
@media (min-width: 992px) { .pb-ficha-nombre { font-size: 30px; } }
.pb-ficha-precio { margin: 0; color: #1d1d1b; font-size: 30px; font-weight: 700; line-height: 1.2; font-family: inherit; }
.pb-ficha-precio .old-price { color: #9a9a9a; font-size: 18px; font-weight: 400; text-decoration: line-through; margin-right: 6px; }
.pb-ficha-transf { margin: 4px 0 0; color: #444; font-size: 14px; line-height: 1.4; }
.pb-ficha-transf strong { color: #1d1d1b; font-weight: 700; }
.pb-pill { display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 4px; background: #e6f4ea; color: #1e6b3a; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pb-ficha-sin-stock { margin: 18px 0 0; color: #b00020; font-size: 15px; font-weight: 600; }
.pb-ficha-sin-stock a, .pb-ficha-sin-stock a:hover { color: #00823f; font-size: 15px; text-decoration: underline; }

/* Compartir */
.pb-share { position: relative; flex: 0 0 auto; }
.pb-share-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #e2e2e2; border-radius: 50%; background: #fff; color: #333; cursor: pointer; }
.pb-share-btn svg { width: 18px; height: 18px; }
.pb-share-btn:hover { border-color: #999; }
.pb-share-menu { position: absolute; right: 0; top: 44px; z-index: 20; min-width: 180px; padding: 6px; border: 1px solid #e2e2e2; border-radius: 10px; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.pb-share-menu[hidden] { display: none; }
.pb-share-menu a, .pb-share-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: #1d1d1b; font-size: 14px; text-align: left; cursor: pointer; }
.pb-share-menu a:hover, .pb-share-menu button:hover { background: #f4f4f4; color: #1d1d1b; font-size: 14px; }
.pb-share-menu .fa { width: 16px; text-align: center; }

/* Variantes */
.pb-variantes { margin: 18px 0 0; }
.pb-variantes-tit { margin: 0 0 8px; color: #555; font-size: 14px; }
.pb-variantes-tit strong { color: #1d1d1b; }
.pb-variantes-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-variante, .pb-variante:hover, .pb-variante:focus { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 2px solid #e2e2e2; border-radius: 10px; background: #fff; color: #1d1d1b; font-size: 14px; text-decoration: none; }
.pb-variante:hover { border-color: #9a9a9a; }
.pb-variante.actual { border-color: #1d1d1b; }
.pb-variante.sin-stock { opacity: .6; }
.pb-variante img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; }
.pb-variante-txt { display: flex; flex-direction: column; line-height: 1.25; }
.pb-variante-nom { font-size: 13px; font-weight: 600; color: #1d1d1b; }
.pb-variante-precio { font-size: 13px; color: #555; }

/* Botón */
.pb-ficha-form { margin: 18px 0 0; }
.pb-ficha-form .add-to-cart-btn { display: block; width: 100%; height: 54px; line-height: 54px; border-radius: 10px; font-size: 14px; }

/* Entrega y Club: una línea cada uno */
.pb-ficha .pb-entrega-linea { font-size: 14px; }
.pb-entrega-mas, .pb-entrega-mas:hover, .pb-entrega-mas:focus { margin-left: 4px; color: #1e6b3a; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.pb-ficha .pb-club-ficha { margin: 10px 0 0; }
.pb-ficha .pb-club-ficha .pb-club-suma { margin: 0 0 4px; font-size: 14px; }
.pb-ficha .pb-club-canje { font-size: 13px; }
.pb-ficha .pb-club-canje a, .pb-ficha .pb-club-canje a:hover { color: #00823F; font-size: 13px; }
.pb-ficha .pb-club-canje .pb-club-btn { margin-top: 4px; padding: 6px 14px; font-size: 13px; }

/* ---- Acordeones ---- */
.pb-acc-grupo { margin-top: 22px; border-top: 1px solid #e8e8e8; }
.pb-acc, .pb-gc-ficha details { border-bottom: 1px solid #e8e8e8; }
.pb-gc-ficha { margin: 0; font-size: 14px; color: #444; }
.pb-acc > summary, .pb-gc-ficha summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; cursor: pointer; list-style: none; color: #1d1d1b; font-size: 15px; font-weight: 600; }
.pb-acc > summary::-webkit-details-marker, .pb-gc-ficha summary::-webkit-details-marker { display: none; }
.pb-acc > summary::after, .pb-gc-ficha summary::after { content: "+"; flex: 0 0 auto; font-size: 20px; font-weight: 400; line-height: 1; color: #555; }
.pb-acc[open] > summary::after, .pb-gc-ficha details[open] summary::after { content: "−"; }
.pb-acc > summary h2 { margin: 0; color: #1d1d1b; font-family: "Poppins", sans-serif; font-size: 15px; font-weight: 600; line-height: 1.3; }
.pb-acc-body { padding: 0 2px 16px; }
.pb-gc-ficha details > :not(summary) { margin-left: 2px; }
.pb-gc-ficha details { padding-bottom: 0; }
.pb-gc-ficha details[open] { padding-bottom: 14px; }
.pb-ficha-desc { margin: 0 0 12px; color: #333; font-size: 15px; line-height: 1.6; }
.pb-specs { display: grid; grid-template-columns: 1fr; margin: 0 0 12px; }
.pb-specs div { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid #f0f0f0; }
.pb-specs div:first-child { border-top: 0; }
.pb-specs dt { flex: 0 0 110px; margin: 0; color: #777; font-size: 14px; font-weight: 400; }
.pb-specs dd { margin: 0; color: #1d1d1b; font-size: 14px; }
.pb-ficha-cat-txt { margin: 0; color: #666; font-size: 13px; line-height: 1.55; }

/* ---- Relacionados ---- */
.pb-rel { padding-top: 8px; padding-bottom: 32px; }
.pb-rel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pb-rel-head h2 { margin: 0; color: #1d1d1b; font-size: 22px; }
.pb-rel-todos, .pb-rel-todos:hover, .pb-rel-todos:focus { color: #00823F; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.pb-rel-todos:hover { text-decoration: underline; }
.pb-rel-fila { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 6px; }
.pb-rel-col { flex: 0 0 46%; max-width: 46%; padding-left: 8px; padding-right: 8px; scroll-snap-align: start; }
@media (min-width: 768px) { .pb-rel-col { flex-basis: 30%; max-width: 30%; } }
@media (min-width: 992px) { .pb-rel-col { flex-basis: 23%; max-width: 23%; } }
@media (min-width: 1200px) { .pb-rel-col { flex-basis: 20%; max-width: 20%; } }

/* ---- Personalizados ---- */
.pb-perso { padding-bottom: 40px; }
.pb-perso p { margin: 0; padding: 16px 18px; border-radius: 12px; background: #f6f3ff; color: #333; font-size: 15px; line-height: 1.5; }
.pb-perso a, .pb-perso a:hover, .pb-perso a:focus { color: #5b3cc4; font-size: 15px; font-weight: 600; text-decoration: underline; }

/* Promos para subir el ticket (php/promos.php): llevando más, envío gratis y el set del mismo diseño */
.pb-ficha-promos { list-style: none; margin: 10px 0 0; padding: 0; }
.pb-ficha-promos li { margin: 4px 0; color: #444; font-size: 14px; line-height: 1.4; }
.pb-ficha-promos strong { color: #1d1d1b; }
.pb-pill.pb-pill-promo { margin: 0 4px 0 0; background: #fff1d6; color: #8a4b00; }
.pb-ficha-set { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px; border: 2px dashed #f0c27a; border-radius: 10px; background: #fffaf0; }
.pb-ficha-set-img img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #fff; }
.pb-ficha-set-txt { flex: 1; min-width: 0; }
.pb-ficha-set-tit { margin: 0; color: #1d1d1b; font-size: 14px; line-height: 1.4; }
.pb-ficha-set-tit a, .pb-ficha-set-tit a:hover { color: #1d1d1b; font-size: 14px; font-weight: 700; text-decoration: underline; }
.pb-ficha-set-precio { margin: 4px 0 0; color: #555; font-size: 14px; }
.pb-ficha-set-precio strong { color: #1d1d1b; font-size: 16px; }
.pb-set-add { flex-shrink: 0; padding: 8px 14px; border: 0; border-radius: 8px; background: #1d1d1b; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.pb-set-add:hover, .pb-set-add:focus-visible { background: #000; }
@media (max-width: 480px) {
    .pb-ficha-set { flex-wrap: wrap; }
    .pb-set-add { width: 100%; }
}
