/* ==========================================================================
   Buscaditos UI · Página: Detalle de producto (prefijo .pdp-)
   Requiere tokens.css + components.css
   ========================================================================== */

.pdp {
    background: var(--bd-bg);
    padding-bottom: 48px;
}

/* ---------- Bloque principal ---------- */
.pdp-main {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "gallery" "info" "buy";
}

@media (min-width: 768px) {
    .pdp-main {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "gallery info" "buy buy";
    }
}

@media (min-width: 1200px) {
    .pdp-main {
        grid-template-columns: 400px minmax(0, 1fr) 360px;
        grid-template-areas: "gallery info buy";
    }
}

.pdp-gallery { grid-area: gallery; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pdp-info    { grid-area: info;    display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pdp-buy     { grid-area: buy; }

@media (max-width: 767px) {
    .pdp-main.bd-card { padding: 16px; border-radius: var(--bd-r-xl); }
}

/* ---------- Galería ---------- */
.pdp-gallery__stage {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--bd-r-xl);
    background: radial-gradient(circle at center, #f4f6ff 0%, #dfe6f8 100%);
    overflow: hidden;
}

.pdp-gallery__stage .carousel-inner,
.pdp-gallery__stage .item,
.pdp-gallery__stage .item > a {
    height: 100%;
}

.pdp-gallery__stage .item > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.pdp-gallery__stage .item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.pdp-gallery__badge {
    position: absolute;
    left: 14px;
    z-index: 2;
}

.pdp-gallery__badge--top { top: 14px; }
.pdp-gallery__badge--bottom { bottom: 14px; }

.pdp-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Neutraliza .carousel-indicators de Bootstrap 3 */
.pdp-thumbs.carousel-indicators {
    position: static;
    width: auto;
    left: auto;
    bottom: auto;
    margin: 14px 0 0;
    text-align: left;
}

.pdp-thumbs.carousel-indicators li,
.pdp-thumbs.carousel-indicators li.active {
    width: auto;
    height: auto;
    margin: 0;
    text-indent: 0;
    border-radius: var(--bd-r-md);
}

.pdp-thumbs li {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-md);
    background: var(--bd-surface);
    cursor: pointer;
    transition: border-color .15s;
}

.pdp-thumbs li.active {
    border: 2px solid var(--bd-brand);
    background: var(--bd-white);
}

.pdp-thumbs img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdp-share {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bd-ink-2);
}

.pdp-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--bd-r-md);
    background: var(--bd-brand-50);
    cursor: pointer;
}

.pdp-share__btn img { width: 18px; height: 18px; }

/* ---------- Información ---------- */
.pdp-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bd-brand);
}

.pdp-eyebrow a { color: inherit; }

.pdp-title {
    font-size: 25px;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -.015em;
    color: var(--bd-ink);
}

@media (max-width: 767px) {
    .pdp-title { font-size: 21px; }
}

.pdp-promo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: var(--bd-r-lg);
    background: var(--bd-accent-50);
}

.pdp-promo__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bd-accent);
}

.pdp-promo__price {
    margin-left: auto;
    font-size: 16px;
    font-weight: 800;
    color: var(--bd-ink);
}

.pdp-promo__dates {
    display: flex;
    gap: 10px;
}

.pdp-promo__date {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bd-white);
}

.pdp-promo__date small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--bd-muted);
}

.pdp-promo__date strong {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bd-ink);
}

/* ---------- Caja de compra ---------- */
.pdp-buy {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-xl);
    background: var(--bd-white);
    align-self: start;
}

.pdp-price__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bd-muted);
}

.pdp-price__old {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pdp-price__old del {
    font-size: 15px;
    font-weight: 500;
    color: var(--bd-muted);
}

.pdp-price__now {
    margin-top: 4px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--bd-ink);
}

.pdp-paymodes {
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-lg);
    overflow: hidden;
}

.pdp-paymode {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.pdp-paymode + .pdp-paymode { border-top: 1px solid var(--bd-line); }
.pdp-paymode--highlight { background: var(--bd-success-50); }

.pdp-paymode__text {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--bd-ink-2);
}

.pdp-paymode__amount {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    color: var(--bd-ink);
}

.pdp-paymode--highlight .pdp-paymode__amount { color: var(--bd-success); }

.pdp-trust__title {
    margin-bottom: 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--bd-muted);
}

.pdp-trust__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--bd-r-sm);
}

.pdp-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--bd-ink-2);
}

.pdp-buy .form-group { margin: 0; }

.pdp-actions {
    display: flex;
    gap: 10px;
}

.pdp-actions .bd-btn--primary { flex: 1; }

.pdp-variant .form-control { border-radius: var(--bd-r-md); }

.pdp-out-of-stock {
    padding: 12px 14px;
    border-radius: var(--bd-r-md);
    background: var(--bd-danger-50);
    color: var(--bd-danger);
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
}

/* ---------- Características principales ---------- */
.pdp-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 768px)  { .pdp-features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pdp-features { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.pdp-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border: 1px solid var(--bd-line);
    border-radius: 16px;
    text-align: center;
}

.pdp-feature .bd-icon-box { width: 52px; height: 52px; }

/* Las clases del admin traen fa-4x / mb-2: se normalizan al tamaño del diseño */
.pdp-feature .bd-icon-box i {
    font-size: 24px !important;
    margin: 0 !important;
    line-height: 1;
}

.pdp-feature__label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--bd-muted);
}

.pdp-feature__value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bd-ink);
    word-break: break-word;
}

/* ---------- Detalles (desplegable) ---------- */
.pdp-details { padding: 0; overflow: hidden; }

.pdp-details__head {
    margin: 0;
    padding: 22px 28px;
    border-bottom: 1px solid var(--bd-line);
}

.pdp-details__toggle img { transition: transform .2s; transform: rotate(-90deg); }
.pdp-details.is-collapsed .pdp-details__toggle img { transform: rotate(90deg); }
.pdp-details.is-collapsed .pdp-details__head { border-bottom: 0; }
.pdp-details.is-collapsed .pdp-details__body { display: none; }

.pdp-details__body {
    padding: 8px 28px 24px;
    font-size: 13px;
    color: var(--bd-ink-2);
}

@media (max-width: 767px) {
    .pdp-details__head { padding: 18px 16px; }
    .pdp-details__body { padding: 8px 16px 16px; }
}

.pdp-details__invoice {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--bd-r-md);
    background: var(--bd-surface);
}

.pdp-details__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--bd-brand);
}

/* El contenido viene como HTML libre del admin (tablas). Lo normalizamos. */
.pdp-specs table {
    width: 100% !important;
    border-collapse: collapse;
    border: 0 !important;
    background: transparent !important;
}

.pdp-specs tr { border-bottom: 1px solid var(--bd-line); }
.pdp-specs tr:last-child { border-bottom: 0; }

.pdp-specs td,
.pdp-specs th {
    padding: 10px 8px !important;
    border: 0 !important;
    background: transparent !important;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
    color: var(--bd-ink) !important;
    font-family: var(--bd-font) !important;
}

.pdp-specs td:first-child,
.pdp-specs th:first-child {
    width: 38%;
    font-weight: 600;
    color: var(--bd-brand) !important;
}

.pdp-specs img { max-width: 100%; height: auto; }

/* Formato más común: <b>grupo</b><ul><li>Clave: valor</li></ul> */
.pdp-specs > b,
.pdp-specs > strong {
    float: left;
    clear: left;
    width: 150px;
    padding: 12px 12px 0 0;
    font-weight: 700;
    color: var(--bd-brand);
    text-transform: capitalize;
    break-after: avoid;
}

.pdp-specs > ul {
    margin: 0 0 0 150px;
    padding: 12px 0;
    list-style: none;
    border-bottom: 1px solid var(--bd-line);
    break-inside: avoid;
    line-height: 1.5;
}

.pdp-specs > ul li { padding: 1px 0; color: var(--bd-ink); }

@media (max-width: 575px) {
    .pdp-specs > b, .pdp-specs > strong { float: none; display: block; width: auto; }
    .pdp-specs > ul { margin-left: 0; padding-top: 4px; }
}

@media (min-width: 992px) {
    .pdp-specs { column-count: 2; column-gap: 32px; }
    .pdp-specs table { break-inside: auto; }
    .pdp-specs tr { break-inside: avoid; }
}

/* ---------- Preguntas frecuentes ---------- */
.pdp-faq {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

@media (min-width: 768px)  { .pdp-faq { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pdp-faq { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pdp-faq__item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px;
    border: 1px solid var(--bd-line);
    border-radius: 16px;
    background: var(--bd-white);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.pdp-faq__item:hover { border-color: var(--bd-brand); box-shadow: var(--bd-shadow-card); }

.pdp-faq__text { flex: 1; min-width: 0; }
.pdp-faq__text strong { display: block; font-size: 15px; font-weight: 700; color: var(--bd-ink); }
.pdp-faq__text small { font-size: 12.5px; color: var(--bd-muted); }

/* ---------- Compartir en redes ---------- */
.pdp-social__msg {
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--bd-ink);
}

.pdp-social {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 768px)  { .pdp-social { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pdp-social { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.pdp-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    border-radius: var(--bd-r-sm);
    color: var(--bd-white);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.pdp-social__btn:hover,
.pdp-social__btn:focus { color: var(--bd-white); text-decoration: none; opacity: .9; }

.pdp-social__btn--facebook  { background: #1877f2; }
.pdp-social__btn--twitter   { background: #1da1f2; }
.pdp-social__btn--google    { background: #ea4335; }
.pdp-social__btn--pinterest { background: #e60023; }
.pdp-social__btn--tumblr    { background: #35465c; }
.pdp-social__btn--linkedin  { background: #0a66c2; }
.pdp-social__btn--whatsapp  { background: #25d366; }

/* ---------- Otros productos ---------- */
.pdp-related__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 20px;
}

.pdp-related__title { font-size: 24px; font-weight: 800; color: var(--bd-ink); }

.pdp-related__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bd-brand);
}

/* ---------- Barra fija de compra (móvil) ---------- */
.pdp-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bd-white);
    box-shadow: 0 -8px 24px rgba(15, 23, 41, .1);
}

.pdp-sticky__price small { display: block; font-size: 11px; color: var(--bd-muted); }
.pdp-sticky__price strong { font-size: 18px; font-weight: 800; color: var(--bd-ink); }
.pdp-sticky .bd-btn { flex: 1; height: 48px; font-size: 15px; }

@media (max-width: 767px) {
    .pdp-sticky { display: flex; }
    .pdp { padding-bottom: 96px; }
}
