/* Encapsular todos los estilos dentro de .catalog-page */
.catalog-page .catalog-header {
    background-color: #2c2c2c;
    padding: 1rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.catalog-page .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.catalog-page .back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 0;
    cursor: pointer;
}

    .catalog-page .back-btn:hover {
        color: #ccc;
    }

    .catalog-page .page-title {
        color: white;
        font-size: 1.3rem;
        font-weight: 600;
        margin: 0;
    }

.catalog-page .header-center {
    flex: 1;
    max-width: 600px;
    display: flex;
    justify-content: center;
}

.catalog-page .filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.catalog-page .filter-select {
    background-color: #2a2a3d;
    border: 1px solid #3a3a4d;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

    .catalog-page .filter-select:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
    }

    .catalog-page .filter-select option {
        background-color: #1e1e2e;
        color: #f1f1f1;
    }

.catalog-page .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.catalog-page .new-catalog-btn {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .catalog-page .new-catalog-btn:hover {
        background-color: #0056b3;
    }

.catalog-page .catalog-table {
    background-color: #2a2a3d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.catalog-page .table {
    margin: 0;
    color: #f1f1f1;
    background-color: transparent;
}

    .catalog-page .table thead th {
        background-color: #3a3a4d;
        border: none;
        padding: 1rem;
        font-weight: 600;
        color: #f1f1f1;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .catalog-page .table tbody td {
        background-color: #2a2a3d;
        padding: 1rem;
        vertical-align: middle;
        border-bottom: 1px solid #3a3a4d;
        color: #d1d1d1;
    }

    .catalog-page .table tbody tr:hover td {
        background-color: #3b3b55;
        color: #fff;
    }

.catalog-page .type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.catalog-page .type-repuesto {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.catalog-page .type-servicio {
    background-color: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid #007bff;
}

.catalog-page .stock-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.catalog-page .action-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.catalog-page .edit-btn:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.catalog-page .delete-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.catalog-page .text-center {
    text-align: center !important;
}

.catalog-page .text-muted {
    color: #888 !important;
}

/* Estilos para mensajes de alerta */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    position: relative;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    color: inherit;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

    .alert-dismissible .close:hover {
        opacity: 0.7;
    }

/* Modal Styles - SIN encapsular para que funcione correctamente */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

    .modal-overlay.show {
        opacity: 1 !important;
        visibility: visible !important;
    }

.modal-content {
    background-color: #2a2a3d !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    transform: translateY(-50px) !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.modal-overlay.show .modal-content {
    transform: translateY(0) !important;
}

.modal-header {
    padding: 1.5rem !important;
    border-bottom: 1px solid #3a3a4d !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.modal-title {
    color: #f1f1f1 !important;
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.modal-close {
    background: none !important;
    border: none !important;
    color: #b0b0c0 !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

    .modal-close:hover {
        background-color: #3b3b55 !important;
        color: #fff !important;
    }

.modal-body {
    padding: 1.5rem !important;
}

/* Secciones del formulario */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #3a3a4d;
}

.section-title {
    color: #f1f1f1;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.modal-form-group {
    margin-bottom: 1.25rem !important;
}

.modal-form-label {
    color: #f1f1f1 !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    font-size: 0.9rem !important;
}

.modal-form-control,
.modal-form-select {
    width: 100% !important;
    padding: 0.75rem !important;
    background-color: #1e1e2e !important;
    border: 1px solid #3a3a4d !important;
    border-radius: 8px !important;
    color: #f1f1f1 !important;
    font-size: 0.95rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

    .modal-form-control:focus,
    .modal-form-select:focus {
        outline: none !important;
        border-color: #007bff !important;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
    }

    .modal-form-control::placeholder {
        color: #888 !important;
    }

    .modal-form-control.error {
        border-color: #dc3545 !important;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
    }

    .modal-form-control[readonly] {
        background-color: #3a3a4d !important;
        color: #ccc !important;
    }

.modal-form-select {
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.75rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

    .modal-form-select option {
        background-color: #1e1e2e !important;
        color: #f1f1f1 !important;
    }

.modal-form-row {
    display: flex !important;
    gap: 1rem !important;
}

.modal-form-col {
    flex: 1 !important;
}

.modal-footer {
    padding: 1rem 1.5rem !important;
    border-top: 1px solid #3a3a4d !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 1rem !important;
}

.modal-btn {
    padding: 0.75rem 1.5rem !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.95rem !important;
}

    .modal-btn:disabled {
        opacity: 0.6 !important;
        cursor: not-allowed !important;
    }

.modal-btn-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

    .modal-btn-secondary:hover:not(:disabled) {
        background-color: #5a6268 !important;
    }

.modal-btn-primary {
    background-color: #007bff !important;
    color: white !important;
}

    .modal-btn-primary:hover:not(:disabled) {
        background-color: #0056b3 !important;
    }

@media (max-width: 768px) {
    .catalog-page .catalog-header {
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
    }

    .catalog-page .header-center {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .catalog-page .filters-row {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .catalog-page .filter-select {
        min-width: 100%;
    }

    .catalog-page .new-catalog-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .catalog-page .table {
        font-size: 0.9rem;
    }

        .catalog-page .table thead th,
        .catalog-page .table tbody td {
            padding: 0.75rem 0.5rem;
        }

    .modal-content {
        width: 95% !important;
        margin: 1rem !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem !important;
    }

    .modal-form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .catalog-page .catalog-header {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-page .header-left,
    .catalog-page .header-right {
        justify-content: space-between;
    }

    .catalog-page .catalog-table {
        border-radius: 8px;
    }

    .modal-footer {
        flex-direction: column !important;
    }

    .modal-btn {
        width: 100% !important;
    }
}
