/* ============================================
   NEXTHAZ BUNDLE BUILDER - PREMIUM MINIMAL
   Inspirado en Lululemon, Tracksmith, On Running
   ============================================ */

:root {
    --nx-black: #0F0F0F;
    --nx-dark: #1A1A1A;
    --nx-gray-900: #2A2A2A;
    --nx-gray-700: #4A4A4A;
    --nx-gray-500: #888888;
    --nx-gray-300: #D4D4D4;
    --nx-gray-200: #E5E5E5;
    --nx-gray-100: #F5F5F5;
    --nx-white: #FFFFFF;
    --nx-accent: #1A1A1A;
}

.nexthaz-bundle-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 720px;
    margin: 24px auto;
    color: var(--nx-dark);
    font-size: 14px;
    line-height: 1.5;
}

.nexthaz-bundle-wrapper *,
.nexthaz-bundle-wrapper *::before,
.nexthaz-bundle-wrapper *::after {
    box-sizing: border-box;
}

/* Mensaje de error */
.nx-bundle-error {
    padding: 14px 18px;
    background: var(--nx-gray-100);
    border-left: 2px solid var(--nx-dark);
    color: var(--nx-gray-700);
    margin: 16px 0;
    font-size: 13px;
}

/* ===== Pasos ===== */
.nx-step {
    margin-bottom: 16px;
    padding: 20px;
    background: var(--nx-white);
    border: 1px solid var(--nx-gray-200);
    border-radius: 2px;
}

.nx-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--nx-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.nx-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--nx-dark);
    color: var(--nx-white);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0;
}

/* ===== Botones de Volumen (3 EN UNA LÍNEA) ===== */
.nx-volume-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.nx-volume-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 12px;
    border: 1px solid var(--nx-gray-300) !important;
    border-radius: 2px;
    background: var(--nx-white) !important;
    color: var(--nx-dark) !important;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.3;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.nx-volume-btn strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nx-dark);
}

.nx-volume-btn small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--nx-gray-500);
    line-height: 1.4;
}

.nx-volume-btn small strong {
    display: inline;
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    color: var(--nx-dark);
}

.nx-volume-btn:hover {
    border-color: var(--nx-dark) !important;
    background: var(--nx-white) !important;
}

.nx-volume-btn.nx-active {
    background: var(--nx-dark) !important;
    border-color: var(--nx-dark) !important;
    color: var(--nx-white) !important;
}

.nx-volume-btn.nx-active strong,
.nx-volume-btn.nx-active small,
.nx-volume-btn.nx-active small strong {
    color: var(--nx-white);
}

.nx-volume-btn.nx-active small {
    color: rgba(255, 255, 255, 0.75);
}

/* ===== Tabla de distribución ===== */
.nx-table-wrapper {
    overflow-x: auto;
}

.nx-bundle-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--nx-white);
    margin: 0;
}

.nx-bundle-table thead {
    background: transparent;
    border-bottom: 1px solid var(--nx-dark);
}

.nx-bundle-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--nx-dark);
}

.nx-bundle-table .nx-th-qty,
.nx-bundle-table .nx-th-subtotal {
    text-align: center;
    width: 110px;
}

.nx-bundle-table .nx-th-subtotal {
    text-align: right;
    width: 90px;
}

.nx-bundle-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--nx-gray-100);
    vertical-align: middle;
    font-size: 13px;
}

.nx-bundle-table tbody tr {
    transition: background 0.15s;
}

.nx-bundle-table tbody tr:hover {
    background: var(--nx-gray-100);
}

.nx-bundle-table tbody tr:last-child td {
    border-bottom: 1px solid var(--nx-gray-200);
}

/* Color dot */
.nx-color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--nx-gray-200);
    vertical-align: middle;
    margin-right: 8px;
}

/* Controles de cantidad */
.nx-qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--nx-gray-300);
    border-radius: 2px;
    overflow: hidden;
    background: var(--nx-white);
}

.nx-qty-controls button {
    width: 28px;
    height: 32px;
    border: none;
    background: var(--nx-white);
    color: var(--nx-dark);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    line-height: 1;
    padding: 0;
}

.nx-qty-controls button:hover {
    background: var(--nx-gray-100);
}

.nx-qty-controls .nx-qty-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--nx-gray-200);
    border-right: 1px solid var(--nx-gray-200);
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    background: var(--nx-white);
    color: var(--nx-dark);
    -moz-appearance: textfield;
    font-family: inherit;
}

.nx-qty-controls .nx-qty-input::-webkit-outer-spin-button,
.nx-qty-controls .nx-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nx-qty-controls .nx-qty-input:focus {
    outline: none;
}

/* Subtotal */
.nx-row-subtotal {
    text-align: right;
    font-weight: 500;
    color: var(--nx-dark);
    font-variant-numeric: tabular-nums;
}

/* Footer de tabla */
.nx-bundle-table tfoot {
    background: transparent;
}

.nx-bundle-table tfoot td {
    padding: 14px 8px;
    border-top: 1px solid var(--nx-dark);
    border-bottom: none;
    font-weight: 600;
}

.nx-total-label {
    text-align: right;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--nx-dark);
}

.nx-total-qty-cell {
    text-align: center;
    font-size: 14px;
    color: var(--nx-dark);
    font-variant-numeric: tabular-nums;
}

.nx-total-price-cell {
    text-align: right;
    color: var(--nx-dark);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.nx-total-price-cell .amount {
    font-size: 15px;
    font-weight: 600;
}

/* ===== Mensajes ===== */
.nx-warning,
.nx-success {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 2px;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.5;
}

.nx-warning {
    background: var(--nx-gray-100);
    border-left: 2px solid var(--nx-gray-700);
    color: var(--nx-gray-700);
}

.nx-success {
    background: var(--nx-dark);
    color: var(--nx-white);
    border-left: none;
}

/* ===== Resumen ===== */
.nx-items-list {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border-left: none;
}

.nx-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--nx-gray-100);
    font-size: 13px;
}

.nx-item-row:first-child {
    padding-top: 0;
}

.nx-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nx-item-row > span:first-child {
    color: var(--nx-dark);
}

.nx-item-row strong {
    font-weight: 600;
    margin-right: 4px;
}

.nx-item-price {
    color: var(--nx-dark);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===== Botón Final ===== */
.nx-add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin-top: 12px;
    background: var(--nx-dark);
    color: var(--nx-white);
    border: none;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: inherit;
}

.nx-add-to-cart-btn:hover {
    background: var(--nx-black);
}

.nx-add-to-cart-btn:active {
    transform: translateY(0);
}

.nx-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Toast Notification ===== */
.nx-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 280px;
    max-width: 360px;
    background: var(--nx-dark);
    color: var(--nx-white);
    padding: 16px 18px;
    border-radius: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 99999;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.nx-toast-show {
    transform: translateY(0);
    opacity: 1;
}

.nx-toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.nx-toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.nx-toast-title {
    flex: 1;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--nx-white);
}

.nx-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
    font-family: inherit;
    transition: color 0.15s;
    margin-left: auto;
}

.nx-toast-close:hover {
    color: var(--nx-white);
}

.nx-toast-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.5;
}

.nx-toast-actions {
    display: flex;
    gap: 14px;
    margin-top: 10px;
}

.nx-toast-link {
    color: var(--nx-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    padding-left: 0;
    padding-right: 0;
    font-family: inherit;
    transition: border-color 0.15s;
}

.nx-toast-link:hover {
    border-bottom-color: var(--nx-white);
    color: var(--nx-white);
}

/* ===== Estilo del Carrito - Bundle agrupado ===== */
.nx-bundle-header {
    background: var(--nx-gray-100) !important;
}

.nx-bundle-header td {
    padding: 12px 16px !important;
    border-left: 2px solid var(--nx-dark) !important;
}

.nx-bundle-header-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nx-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nx-bundle-icon {
    font-size: 14px;
}

.nx-bundle-meta {
    color: var(--nx-gray-500);
    font-weight: 400;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

tr.nx-bundle-item {
    background: #FAFAFA !important;
}

tr.nx-bundle-item td {
    border-left: 2px solid var(--nx-dark) !important;
}

.nx-bundle-tag {
    display: inline-block;
    background: var(--nx-dark);
    color: var(--nx-white);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .nx-step {
        padding: 16px;
    }

    /* Botones de volumen: stack vertical en mobile */
    .nx-volume-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nx-volume-btn {
        flex: 1 1 100%;
        padding: 12px;
    }

    .nx-bundle-table th,
    .nx-bundle-table td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .nx-bundle-table .nx-th-qty,
    .nx-bundle-table .nx-th-subtotal {
        width: auto;
    }

    .nx-qty-controls .nx-qty-input {
        width: 32px;
    }

    .nx-qty-controls button {
        width: 24px;
        height: 28px;
    }

    .nx-color-dot {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }

    .nx-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 400px) {
    .nx-bundle-table th {
        font-size: 9px;
        letter-spacing: 1px;
    }
}

/* ===== Compatibilidad Divi (override sus botones) ===== */
.et_pb_module .nexthaz-bundle-wrapper button,
.et_pb_module .nexthaz-bundle-wrapper input {
    box-shadow: none;
}

.nexthaz-bundle-wrapper .nx-volume-btn:focus,
.nexthaz-bundle-wrapper .nx-add-to-cart-btn:focus,
.nexthaz-bundle-wrapper .nx-qty-controls button:focus {
    outline: 1px solid var(--nx-dark);
    outline-offset: 1px;
}

/* Reset de Divi para evitar herencia */
.nexthaz-bundle-wrapper button {
    line-height: normal;
}
