/* ===================================
   ESCANDALLO - ESTILOS GENERALES
   =================================== */

.escandallo-container {
    width: 100%;
    padding: 15px 20px;
}

/* ===================================
   BUSCADOR
   =================================== */

.escandallo-search-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.escandallo-search-form {
    max-width: 500px;
    margin: 0 auto;
}

.escandallo-search-input {
    height: 36px;
    font-size: 14px;
    border: none;
    border-radius: 18px 0 0 18px;
    padding-left: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.escandallo-search-input:focus {
    outline: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

.escandallo-search-btn {
    height: 36px;
    padding: 0 20px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 0 18px 18px 0;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.escandallo-search-btn:hover {
    background: #f8f9fa;
    color: #5568d3;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.escandallo-search-btn .fa {
    margin-right: 5px;
}

/* ===================================
   NAVEGACIÓN
   =================================== */

.escandallo-navigation {
    margin-bottom: 15px;
}

.escandallo-btn-back {
    background: #667eea;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.escandallo-btn-back:hover {
    background: #5568d3;
    color: #fff;
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.escandallo-btn-back .fa {
    vertical-align: middle;
    margin-right: 5px;
    font-size: 16px;
}

/* ===================================
   TÍTULOS
   =================================== */

.escandallo-page-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.escandallo-subtitle {
    font-size: 15px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

/* ===================================
   GRID DE PRINCIPALES
   =================================== */

.escandallo-principales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.escandallo-principal-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.escandallo-principal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.escandallo-card-image {
    position: relative;
    width: 100%;
    padding-top: 70%;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.escandallo-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.escandallo-principal-card:hover .escandallo-card-image img {
    transform: scale(1.08);
}

.escandallo-card-body {
    padding: 15px;
    text-align: center;
}

.escandallo-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.escandallo-btn-view {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.escandallo-btn-view:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ===================================
   GRID DE PARTES
   =================================== */

.escandallo-partes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.escandallo-parte-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.escandallo-parte-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

/* ===================================
   IMAGEN DEL DIAGRAMA TÉCNICO
   =================================== */

.escandallo-diagram-container {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.escandallo-diagram-image {
    max-width: 300px !important;
    width: 100% !important;
    height: auto !important;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    cursor: zoom-in;
    transition: all 0.3s ease;
}

/* Sobrescribir .img-fluid del theme */
.escandallo-diagram-container .escandallo-diagram-image.img-fluid {
    max-width: 300px !important;
}

.escandallo-diagram-image:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

/* ===================================
   TABLA DE PRODUCTOS
   =================================== */

.escandallo-productos-table-container {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.escandallo-productos-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 14px;
}

.escandallo-productos-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.escandallo-productos-table thead th {
    font-weight: 600;
    color: #fff;
    border: none;
    padding: 12px 10px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.escandallo-productos-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.escandallo-productos-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.escandallo-productos-table td {
    vertical-align: middle;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.escandallo-producto-ref {
    font-size: 18px;
    color: #667eea;
    font-weight: 700;
    text-align: center;
    width: 70px;
}

.escandallo-producto-code {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 13px;
}

.escandallo-producto-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.escandallo-producto-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.escandallo-producto-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.escandallo-producto-price {
    font-size: 16px;
    color: #28a745;
    font-weight: 700;
}

/* ===================================
   BADGES DE STOCK
   =================================== */

.escandallo-stock-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
}

.escandallo-stock-available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #28a745;
}

.escandallo-stock-available .fa {
    font-size: 18px;
    line-height: 28px;
}

.escandallo-stock-unavailable {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #dc3545;
}

.escandallo-stock-unavailable .fa {
    font-size: 18px;
    line-height: 28px;
}

/* ===================================
   BOTONES DE ACCIONES
   =================================== */

.escandallo-producto-actions {
    white-space: nowrap;
}

.escandallo-btn-ver,
.escandallo-btn-ver-imagen {
    padding: 6px 14px;
    font-size: 12px;
    margin-right: 6px;
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.escandallo-btn-ver:hover,
.escandallo-btn-ver-imagen:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.escandallo-btn-add-cart {
    padding: 6px 14px;
    font-size: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.escandallo-btn-add-cart:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===================================
   TABLA DE BÚSQUEDA
   =================================== */

.escandallo-search-results {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.escandallo-search-table {
    width: 100%;
    font-size: 14px;
}

.escandallo-search-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.escandallo-search-table thead th {
    font-weight: 600;
    color: #fff;
    padding: 12px;
    text-transform: uppercase;
    font-size: 11px;
    border: none;
}

.escandallo-search-table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.escandallo-search-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.escandallo-search-image img {
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.escandallo-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.escandallo-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .escandallo-container {
        padding: 10px;
    }

    .escandallo-page-title {
        font-size: 22px;
    }

    .escandallo-subtitle {
        font-size: 14px;
    }

    .escandallo-principales-grid,
    .escandallo-partes-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .escandallo-search-bar {
        position: relative;
        top: 0;
        padding: 12px 15px;
    }

    .escandallo-search-input,
    .escandallo-search-btn {
        height: 40px;
        font-size: 14px;
    }

    .escandallo-productos-table-container {
        padding: 12px;
        overflow-x: auto;
    }

    .escandallo-productos-table {
        font-size: 12px;
    }

    .escandallo-productos-table td,
    .escandallo-productos-table th {
        padding: 8px 6px;
    }

    .escandallo-producto-actions {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .escandallo-btn-ver,
    .escandallo-btn-ver-imagen,
    .escandallo-btn-add-cart {
        width: 100%;
        margin-right: 0;
        font-size: 11px;
        padding: 5px 10px;
    }

    .escandallo-card-body {
        padding: 12px;
    }

    .escandallo-card-title {
        font-size: 14px;
        min-height: 35px;
    }
}

@media (max-width: 480px) {
    .escandallo-principales-grid,
    .escandallo-partes-grid {
        grid-template-columns: 1fr;
    }

    .escandallo-search-input {
        font-size: 13px;
        padding-left: 15px;
    }

    .escandallo-btn-view {
        padding: 8px 20px;
        font-size: 12px;
    }

    .escandallo-page-title {
        font-size: 20px;
    }
}

/* ===================================
   ANIMACIONES
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.escandallo-principal-card,
.escandallo-parte-card {
    animation: fadeIn 0.5s ease forwards;
}

/* ===================================
   UTILIDADES
   =================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ===================================
   MODAL DE IMAGEN SIMPLIFICADO
   =================================== */

.escandallo-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.escandallo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.escandallo-modal-content {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.escandallo-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
}

.escandallo-modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.escandallo-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.escandallo-modal-header h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
}

.escandallo-modal-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.escandallo-modal-body {
    padding: 20px;
    text-align: center;
    background: white;
}

.escandallo-modal-body img {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    width: auto;
}

@media (max-width: 768px) {
    .escandallo-modal-content {
        max-width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }

    .escandallo-modal-body img {
        max-height: 50vh;
    }
}

/* ===================================
   NOTIFICACIONES TOAST
   =================================== */

.escandallo-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.escandallo-toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.escandallo-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.escandallo-toast-success {
    border-left: 4px solid #28a745;
}

.escandallo-toast-error {
    border-left: 4px solid #dc3545;
}

.escandallo-toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}

.escandallo-toast-message {
    font-size: 13px;
    color: #666;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .escandallo-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .escandallo-toast {
        min-width: auto;
        max-width: none;
    }
}