/*******************************************************************
PRODUCT.CSS — solo en la ficha de detalle de producto
Cargar DESPUÉS de global.css
********************************************************************/

/* -------- Título del producto -------- */
h1.bs-product__title {
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 32px;
    line-height: 36px;
    letter-spacing: 0;
    color: #1D2127;
    margin-bottom: 24px;
}

/* -------- Marca (texto) -------- */
.product-detail__brand {
    display: inline-block;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0;
    color: #61666E;
    text-decoration: none;
}
a.product-detail__brand:hover {
    text-decoration: underline;
}

/* -------- SKU -------- */
.bs-product__sku {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 24px;
    color: #1D2127;
    margin-bottom: 0 !important;
}

/* -------- Notice -------- */
.bs-product__notice {
    display: inline-block;
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 8px;
}
.bs-product__notice:empty {
    display: none;
}

/* -------- Precio -------- */
.bs-product__price {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
    padding-top: 16px;
    border-top: 1px solid #EBECEE;
}
.bs-product__original-price {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #1D2127;
}
.bs-product__original-price del {
    text-decoration: line-through;
}
.bs-product__final-price {
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 32px;
    line-height: 36px;
    color: var(--primary-color);
}
.bs-product__discount-condition {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 13px;
    color: #61666e;
}

/* -------- Contenedor principal de cantidad + botón -------- */
.bs-product-add-row {
    display: flex;
    align-items: center;
    gap: 177px; /* <-- Controla la separación en px entre cantidad y botón */
    margin-top: 16px;
    margin-bottom: 24px;
}

.bs-product-qty-col,
.bs-product-add-col {
    margin-bottom: 0 !important;
}

/* -------- Selector de cantidad -------- */
.input-group:has([data-bs="product.quantity"]) {
    display: flex;
    align-items: center;
    width: 199px;
    height: 40px;
    border: 1px solid #C2C4C7;
    border-radius: 12px;
    overflow: hidden;
}

[data-bs="product.quantity.minus"],
[data-bs="product.quantity.plus"] {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #61666E !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
[data-bs="product.quantity.minus"]:hover i,
[data-bs="product.quantity.plus"]:hover i {
    color: var(--primary-color);
}

[data-bs="product.quantity"] {
    flex: 1;
    height: 40px;
    border: none !important;
    border-radius: 0;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #1D2127;
    text-align: center;
    background: transparent;
    box-shadow: none !important;
}
[data-bs="product.quantity"]:focus {
    outline: none;
}

/* -------- Botón "Agregar al carro" -------- */
[data-bs="cart.add"].btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 228px;
    height: 44px;
    padding: 12px 24px;
    border-radius: 32px;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
}

/* -------- Descripción corta -------- */
.bs-product-description {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 24px;
    color: #1D2127;
    max-width: 608px;
    margin-top: 32px;
}

/* -------- Compartir en redes -------- */
aside:has(> .btn-share) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}
aside > small {
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 16px;
    line-height: 20px;
    color: #1D2127;
    padding: 8px;
}
.btn.btn-share {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--secondary-text-color);
    font-size: 18px;
    cursor: pointer;
    transition: background .2s ease;
}
.btn.btn-share:hover {
    background: var(--primary-light-color);
    color: var(--secondary-text-color);
}

/* -------- Stock por sucursal -------- */
.bs-product__stock .badge-danger {
    background: var(--danger-color);
    color: var(--danger-contrast);
    font-weight: var(--font-regular);
    padding: 4px 8px;
    border-radius: 4px;
}

.bs-product__stock .badge-alert {
    background: #FFBA40;
    color: #1D2127;
    font-weight: var(--font-regular);
    padding: 4px 8px;
    border-radius: 4px;
}

a.btn-sm.btn-link {
    color: var(--primary-color);
    font-weight: var(--font-bold);
    text-decoration: none;
}
a.btn-sm.btn-link:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
}

#modalStock .modal-content {
    border-radius: 12px;
    border: 1px solid #ebeced;
}
#modalStock .modal-header {
    border-bottom: 1px solid #ebeced;
}
#modalStock .modal-title {
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 18px;
    color: #1D2127;
}
#modalStock .modal-footer {
    border-top: 1px solid #ebeced;
}

/* Botón "Cerrar" del modal de stock — aislado, no reutiliza .close de Bootstrap */
#modalStock .bs-stock-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1.25rem;
    background: transparent;
    color: var(--secondary-text-color);
    border: 1px solid var(--secondary-text-color);
    border-radius: var(--default-border-radius);
    font-family: var(--font-family);
    font-weight: var(--font-regular);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
#modalStock .bs-stock-modal__close:hover {
    background: var(--primary-light-color);
}

/* Tabla de stock por sucursal */
#modalStock .bs-table {
    width: 100%;
}
#modalStock .bs-table table {
    width: 100%;
    border-collapse: collapse;
}
#modalStock .bs-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--primary-light-color);
    color: var(--secondary-text-color);
    font-family: var(--font-family);
    font-weight: var(--font-bold);
    font-size: 14px;
    border-bottom: 1px solid #ebeced;
}
#modalStock .bs-table th:first-child {
    border-radius: 8px 0 0 8px;
}
#modalStock .bs-table th:last-child {
    border-radius: 0 8px 8px 0;
}
#modalStock .bs-table td {
    padding: 10px 12px;
    font-family: var(--font-family);
    font-size: 14px;
    color: #1D2127;
    border-bottom: 1px solid #ebeced;
}
#modalStock .bs-table tr:last-child td {
    border-bottom: none;
}
#modalStock .bs-table tr:hover td {
    background: #fafafa;
}
.bs-horizontal-slider .slick-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.bs-horizontal-slider .slick-arrow:hover {
    background: var(--primary-light-color);
    color: var(--primary-hover-color);
}

.bs-horizontal-slider .slick-arrow.slick-disabled {
    color: var(--disabled-text-color);
    cursor: not-allowed;
    pointer-events: none;
}

.bs-horizontal-slider .slick-arrow i {
    font-size: 1.5rem;
}
#bs-product-thumbnail .item {
    padding: 4px;
    box-sizing: border-box;
    cursor: pointer;
}

#bs-product-thumbnail .item .bs-img-square {
    border: 3px solid transparent !important;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color .2s ease;
}

#bs-product-thumbnail .item .bs-img-square img {
    transition: transform .3s ease;
}

#bs-product-thumbnail .item:hover .bs-img-square {
    border-color: var(--primary-color, silver) !important;
}
#bs-product-thumbnail .item:hover .bs-img-square img {
    transform: scale(1.05);
}

#bs-product-thumbnail .item.slick-current .bs-img-square {
    border-color: var(--primary-color, silver) !important;
}

/* -------- Responsive: mobile -------- */
@media (max-width: 576px) {
    .bs-product-add-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .bs-product-add-col,
    [data-bs="cart.add"].btn.btn-primary {
        width: 100% !important;
        max-width: 100%;
    }

    .input-group:has([data-bs="product.quantity"]) {
        width: 100%;
        max-width: 199px;
    }
}

/* -------- Solución para centrar imagen (768px - 1102px) -------- */
@media (min-width: 768px) and (max-width: 1179px) {

    div.container-xxl.bs-product > div.row > div[class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .bs-product__slider,
    #bs-product-slider,
    #bs-product-thumbnail {
        max-width: 550px !important; 
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }

    article[data-bs="product.detail"],
    article[data-bs="product.detail"] * {
        text-align: left !important;
    }

    article[data-bs="product.detail"] .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }
}