/* Contenedor Principal */
#custom-pack-builder-ui {
    font-family: inherit;
    margin: 30px 0;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

/* Selector de Packs (Cápsulas) */
.pack-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.pack-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #555;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    flex: 1 1;
    min-width: 120px;
    max-width: 180px;
    text-align: center;
}

.pack-btn:hover {
    background: #ebebeb;
    transform: translateY(-2px);
}

.pack-btn.active {
    background: #1d1d1d;
    color: #ffffff;
    border-color: #1d1d1d;
    box-shadow: 0 6px 15px rgba(29, 29, 29, 0.2);
}

/* Slots del Pack (Huecos) */
.slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 15px 0;
}

.slot {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    border: 2px dashed #cccccc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
    overflow: hidden;
}


.slot.empty.highlight {
    border-color: #1d1d1d;
    background-color: rgba(29, 29, 29, 0.05);
}

.slot.filled {
    border: 2px solid #1d1d1d;
    background: #ffffff;
}

.slot.filled:hover::after {
    content: "✕";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Grid de Variaciones (Sabores) */
.variations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.variation-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.variation-item:hover:not(.out-of-stock) {
    transform: scale(1.05);
}

.variation-item.out-of-stock {
    opacity: 0.4;
    filter: grayscale(100%);
    cursor: not-allowed;
    position: relative;
}

.variation-item.out-of-stock::after {
    content: "AGOTADO";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #e74c3c;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 10;
    pointer-events: none;
}

/* Tooltip estético para stock máximo en el builder */
.variation-item.max-reached {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.variation-item.max-reached::after {
    content: "Máx. Alcanzado";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.variation-item.max-reached:hover::after {
    opacity: 1;
    visibility: visible;
}


.variation-item img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    padding: 2px;
    object-fit: contain;
    background: #ffffff;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.variation-item:hover:not(.out-of-stock) img {
    border-color: #1d1d1d;
}

.variation-item span {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    color: #333333;
    font-weight: 500;
}

/* Status y Botón Añadir */
.pack-status {
    text-align: center;
    font-size: 15px;
    color: #555555;
    margin-bottom: 20px;
    font-weight: 500;
}

.add-pack-btn {
    display: block;
    width: 100%;
    background: #1d1d1d;
    color: #ffffff;
    border: none;
    padding: 16px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-pack-btn:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(29, 29, 29, 0.25);
}

.add-pack-btn:disabled {
    background: #999999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal de Upselling Estilo Elegante */
#upsell-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#upsell-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.upsell-modal {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 12px;
    padding: 35px 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    text-align: center;
}

#upsell-modal-overlay.active .upsell-modal {
    transform: translateY(0);
}

.upsell-modal h3 {
    margin: 0 0 15px 0;
    color: #1d1d1d;
    font-size: 24px;
    font-weight: 700;
}

.upsell-modal p {
    color: #555555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.upsell-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wdr-btn-primary {
    background-color: #1d1d1d !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 12px 24px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
}

.wdr-btn-primary:hover {
    background-color: #333333 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

.wdr-btn-secondary {
    background-color: #ffffff !important;
    color: #1d1d1d !important;
    border: 1px solid #1d1d1d !important;
    border-radius: 50px !important;
    padding: 12px 24px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.wdr-btn-secondary:hover {
    background-color: #f0f0f0 !important;
}