/* ==========================================================================
   Buscaditos UI · Componentes reutilizables (prefijo .bd-)
   Requiere tokens.css. Pensado para reutilizarse en las demás vistas.
   ========================================================================== */

/* ---------- Layout ---------- */
.bd-container {
    width: 100%;
    max-width: calc(var(--bd-container) + var(--bd-gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--bd-gutter);
}

.bd-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- Card / sección ---------- */
.bd-card {
    background: var(--bd-white);
    border-radius: var(--bd-r-2xl);
    box-shadow: var(--bd-shadow-card);
    padding: 28px;
}

.bd-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.bd-card__titles {
    flex: 1;
    min-width: 0;
}

.bd-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--bd-ink);
    line-height: 1.25;
}

.bd-subtitle {
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--bd-muted);
}

/* ---------- Breadcrumb ---------- */
.bd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--bd-muted);
    padding: 24px 0;
}

.bd-breadcrumb a {
    color: var(--bd-brand);
    font-weight: 500;
}

.bd-breadcrumb [aria-current] {
    color: var(--bd-ink);
    font-weight: 600;
}

.bd-breadcrumb__sep {
    display: inline-flex;
    align-items: center;
    opacity: .6;
}

.bd-breadcrumb__sep img {
    width: auto;
    height: 10px;
}

/* ---------- Iconos ---------- */
.bd-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bd-icon img {
    display: block;
}

/* Caja de icono (cuadrada, redondeada) */
.bd-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--bd-r-lg);
    background: var(--bd-brand-50);
    color: var(--bd-brand);
    font-size: 22px;
}

.bd-icon-box--brand {
    background: var(--bd-brand);
    color: var(--bd-white);
}

.bd-icon-box--success {
    background: var(--bd-success);
}

.bd-icon-box--round {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ---------- Badges / chips ---------- */
.bd-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--bd-r-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.bd-badge--sm {
    padding: 3px 10px;
    gap: 5px;
}

.bd-badge--danger {
    background: var(--bd-danger);
    color: var(--bd-white);
    box-shadow: 0 6px 14px rgba(229, 56, 61, .3);
}

.bd-badge--danger-soft {
    background: var(--bd-danger-50);
    color: var(--bd-danger);
    border-radius: 6px;
    padding: 2px 7px;
}

.bd-badge--success {
    background: var(--bd-success-50);
    color: var(--bd-success);
}

.bd-badge--accent {
    background: var(--bd-accent);
    color: var(--bd-white);
}

/* ---------- Botones ---------- */
.bd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--bd-r-lg);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, box-shadow .15s, transform .05s;
}

.bd-btn:active {
    transform: translateY(1px);
}

.bd-btn:focus-visible {
    outline: 3px solid rgba(47, 75, 179, .35);
    outline-offset: 2px;
}

.bd-btn--primary {
    background: var(--bd-brand);
    color: var(--bd-white);
    box-shadow: var(--bd-shadow-brand);
}

.bd-btn--primary:hover,
.bd-btn--primary:focus {
    background: #263e98;
    color: var(--bd-white);
    text-decoration: none;
}

.bd-btn--outline {
    background: var(--bd-white);
    border-color: var(--bd-line);
    color: var(--bd-ink);
}

.bd-btn--outline:hover {
    border-color: var(--bd-brand);
}

.bd-btn--icon {
    width: 52px;
    padding: 0;
}

.bd-btn--pill-soft {
    height: auto;
    padding: 8px 14px;
    gap: 6px;
    border-radius: var(--bd-r-pill);
    background: var(--bd-brand-50);
    color: var(--bd-brand);
    font-size: 13px;
}

/* ---------- Lista clave / valor ---------- */
.bd-kv {
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-lg);
    overflow: hidden;
}

.bd-kv__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    font-size: 13px;
}

.bd-kv__row:nth-child(odd) {
    background: var(--bd-surface);
}

.bd-kv__key {
    color: var(--bd-muted);
    font-weight: 500;
}

.bd-kv__val {
    color: var(--bd-ink);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.bd-kv__val a {
    color: inherit;
}

/* ---------- Tarjeta de contacto (icono + texto) ---------- */
.bd-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--bd-r-lg);
    background: var(--bd-brand-50);
    color: inherit;
    text-decoration: none;
}

.bd-contact:hover,
.bd-contact:focus {
    text-decoration: none;
    color: inherit;
}

.bd-contact__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--bd-muted);
}

.bd-contact__value {
    font-size: 15px;
    font-weight: 700;
    color: var(--bd-brand);
}

.bd-contact__value--success {
    font-size: 14px;
    color: var(--bd-success);
}

/* ---------- Selector de cantidad ---------- */
.bd-qty {
    display: inline-flex;
    align-items: stretch;
    height: 44px;
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-md);
    background: var(--bd-white);
    overflow: hidden;
}

/* Botones +/− idénticos (se anulan estilos legacy de .btn-minus/.btn-plus) */
.bd-qty .bd-qty__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    /* !important: assets/custom/shop.css fuerza padding/height/radius en .btn-plus/.btn-minus */
    height: 100% !important;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 0 !important;
    background: var(--bd-brand-50);
    box-shadow: none;
    cursor: pointer;
    transition: background-color .15s;
}

.bd-qty .bd-qty__btn:hover {
    background: #dfe6fb;
}

.bd-qty__input {
    width: 52px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--bd-ink);
    background: var(--bd-white);
}

.bd-qty__input:focus {
    outline: none;
}

/* ---------- Tarjeta de producto ---------- */
.bd-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .bd-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

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

.bd-pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bd-white);
    border: 1px solid var(--bd-line);
    border-radius: var(--bd-r-xl);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.bd-pcard:hover {
    box-shadow: var(--bd-shadow-card);
    transform: translateY(-2px);
}

.bd-pcard__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--bd-surface);
}

.bd-pcard__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.bd-pcard__flag {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    padding: 4px 8px;
}

.bd-pcard__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding: 16px;
}

.bd-pcard__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--bd-ink);
}

.bd-pcard__name:hover {
    color: var(--bd-brand);
    text-decoration: none;
}

.bd-pcard__meta {
    font-size: 12px;
    color: var(--bd-muted);
}

.bd-pcard__meta a {
    color: inherit;
}

.bd-pcard__price {
    margin-top: auto;
    padding-top: 6px;
}

.bd-pcard__old {
    font-size: 12px;
    color: var(--bd-muted);
}

.bd-pcard__now {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--bd-brand);
}

/* ---------- Modal (extiende el modal de Bootstrap 3) ---------- */
.bd-modal .modal-content {
    border: 0;
    border-radius: var(--bd-r-2xl);
    overflow: hidden;
    font-family: var(--bd-font);
}

.bd-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bd-line);
}

.bd-modal .modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 800;
    color: var(--bd-ink);
}

.bd-modal .close {
    float: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bd-surface);
    opacity: 1;
    font-size: 22px;
    color: var(--bd-ink-2);
}

.bd-modal .modal-body {
    padding: 20px 24px;
}

.bd-modal .modal-body img {
    width: 100%;
    height: auto;
    border-radius: var(--bd-r-md);
}

@media (max-width: 767px) {
    .bd-modal .modal-dialog {
        margin: 0;
        position: absolute;
        bottom: 0;
        width: 100%;
    }

    .bd-modal .modal-content {
        border-radius: var(--bd-r-2xl) var(--bd-r-2xl) 0 0;
    }
}

/* ---------- Encabezado de sección (título + enlace + flechas) ---------- */
.bd-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bd-section-head .bd-title {
    flex: 1;
    min-width: 0;
}

.bd-section-head__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bd-brand);
    white-space: nowrap;
}

.bd-section-head__link i { font-size: 11px; }

/* ---------- Flechas de carrusel ---------- */
.bd-swiper-nav {
    display: flex;
    gap: 8px;
}

.bd-swiper-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--bd-line);
    border-radius: 50%;
    background: var(--bd-white);
    color: var(--bd-ink-2);
    font-size: 12px;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}

.bd-swiper-nav__btn:hover {
    border-color: var(--bd-brand);
    background: var(--bd-brand);
    color: var(--bd-white);
}

.bd-swiper-nav__btn.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.bd-swiper-nav__btn.swiper-button-lock { display: none; }

@media (max-width: 767px) {
    .bd-swiper-nav { display: none; }
}

/* Swiper: las tarjetas ocupan todo el alto del slide */
.bd .swiper-slide { height: auto; }
.bd .swiper-slide > .bd-pcard { height: 100%; }
