/* Estilos personalizados para página de detalle de bundles */
/* Prefijo xoey- según reglas del proyecto (máximo 5% CSS custom) */

/* Thumbnail de productos en bundle mixto */
.bundle-mixed .xoey-bundle-product-thumb {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
}

.bundle-mixed .xoey-bundle-product-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Thumbnail para bundle múltiple (mantener tamaño original) */
.bundle-multiple .xoey-bundle-product-thumb {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
}

.bundle-multiple .xoey-bundle-product-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsive: ajustes para móvil */
@media (max-width: 991.98px) {
    .bundle-mixed .xoey-bundle-product-thumb {
        width: 70px;
        height: 70px;
    }

    .bundle-multiple .xoey-bundle-product-thumb {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 575.98px) {
    .bundle-mixed .xoey-bundle-product-thumb {
        width: 60px;
        height: 60px;
    }

    .bundle-multiple .xoey-bundle-product-thumb {
        width: 80px;
        height: 80px;
    }
}

/* Alineación de selectores de cantidad en bundle múltiple */
.bundle-variation-item {
    min-height: 48px;
}

.bundle-variation-item .variation-quantity {
    min-width: 100px;
    display: flex;
    justify-content: flex-end;
}

.bundle-variation-item .wg-quantity {
    width: 100%;
    max-width: 100px;
}

/* Asegurar que todos los selectores tengan el mismo ancho */
.bundle-variations-list .wg-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reducir espaciado entre variantes */
.bundle-variation-item:last-child {
    border-bottom: none !important;
}

/* Alineación del selector de cantidad de packs */
.bundle-pack-info .wg-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bundle-pack-info .wg-quantity .quantity-value {
    width: 51px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: transparent;
    border: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: var(--main);
}

.bundle-pack-info .wg-quantity .btn-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
}

/* Efecto cuando se alcanza el límite del pack */
.bundle-detail-page .quantity-value.bundle-input-max-reached {
    background-color: #e7e7e7;
    color: #8b4a6b;
}

.bundle-detail-page .bundle-variation-limit-reached {
    background-color: #e7e7e7;
    border-left: 3px solid #8b4a6b;
    padding-left: calc(0.75rem - 3px);
}

.bundle-detail-page .bundle-variation-limit-reached .variation-info {
    color: #8b4a6b;
}

.bundle-detail-page .bundle-variation-limit-reached .variation-info .fw-6 {
    color: #8b4a6b;
}

.bundle-detail-page
    .bundle-variation-limit-reached
    .btn-quantity[data-action="increase"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.bundle-detail-page .wg-quantity .btn-quantity.disabled,
.bundle-detail-page .wg-quantity .btn-quantity:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    color: #6c757d;
}

/* Estilos para bundle mixto - productos más compactos */
.bundle-mixed .bundle-product-section {
    min-height: 60px;
}

.bundle-mixed .bundle-product-section:last-child {
    border-bottom: none !important;
}

.bundle-mixed .bundle-add-variant-btn {
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Efecto de seleccionado en botón Agregar */
.bundle-mixed .bundle-add-variant-btn.selected {
    background-color: #8b4a6b;
    border-color: #8b4a6b;
    color: #ffffff;
    opacity: 0.8;
    cursor: not-allowed;
}

.bundle-mixed .bundle-add-variant-btn.selected:hover {
    background-color: #8b4a6b;
    border-color: #8b4a6b;
    opacity: 0.8;
}

/* Estilos para el resumen de packs */
.bundle-summary .card-body {
    padding: 0;
}

.bundle-summary .fw-6.mb-3 {
    padding: 1rem 1rem 0.75rem 1rem;
    margin-bottom: 0 !important;
}

.bundle-summary-empty {
    padding: 2rem 1rem !important;
}

.bundle-summary-total {
    padding: 0.75rem 1rem 1rem 1rem !important;
    margin-top: 0 !important;
}

.bundle-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.bundle-summary-item:last-child {
    border-bottom: none;
}

.bundle-summary-item-content {
    flex-grow: 1;
}

.bundle-summary-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.bundle-summary-item-variants {
    font-size: 0.875rem;
    color: #6c757d;
}

.bundle-summary-item-variants > div {
    margin-bottom: 0.25rem;
}

.bundle-summary-item-variants > div:last-child {
    margin-bottom: 0;
}

.bundle-summary-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.bundle-summary-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bundle-summary-item-quantity-label {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
}

.bundle-summary-item-quantity .wg-quantity {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bundle-summary-item-quantity .quantity-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #212529;
}

.bundle-summary-item-delete-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.bundle-summary-item-delete-btn:hover {
    background-color: #c82333;
    color: #ffffff;
}

.bundle-summary-item-delete-btn .icon {
    font-size: 1rem;
}

@media (max-width: 991.98px) {
    .bundle-mixed .bundle-product-section {
        flex-wrap: wrap;
    }

    .bundle-mixed .bundle-variant-select-wrapper {
        width: 100%;
        margin-top: 0.5rem;
    }

    .bundle-mixed .bundle-variant-select-wrapper .d-flex {
        flex-wrap: wrap;
    }

    .bundle-mixed .bundle-add-variant-btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .bundle-summary-item {
        flex-wrap: wrap;
    }

    .bundle-summary-item-actions {
        width: 100%;
        margin-top: 0.75rem;
        justify-content: space-between;
    }

    .bundle-summary-item-delete-btn {
        flex-grow: 1;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .bundle-summary-item-quantity {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .bundle-summary-item-quantity-label {
        width: 100%;
    }
}
