/* ===================================
   COMPARADOR DE PALAS - ESTILOS
   =================================== */

:root {
    --primary: #00A651;
    --primary-dark: #008241;
    --secondary: #FF6B35;
    --accent: #4ECDC4;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --border: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 25px rgba(0,0,0,0.15);
}

.comparador-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* HEADER */
.comparador-header {
    text-align: center;
    margin-bottom: 40px;
}

.comparador-header h2 {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 800;
}

.comparador-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* BUSCADOR */
.buscador-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.btn-search {
    padding: 15px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* FILTROS */
.filtros-avanzados {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.filtro-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark);
    font-size: 0.9rem;
}

.filtro-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
}

.btn-toggle-filtros {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle-filtros:hover {
    background: var(--primary);
    color: white;
}

/* RECOMENDADOR */
.recomendador-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.recomendador-header {
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.recomendador-header:hover {
    background: rgba(255,255,255,0.1);
}

.recomendador-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.toggle-icon.active {
    transform: rotate(180deg);
}

.recomendador-content {
    padding: 30px;
    background: rgba(255,255,255,0.95);
    color: var(--dark);
}

.quiz-question {
    margin-bottom: 25px;
}

.quiz-question label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.radio-group label:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.radio-group input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-group label:has(input:checked) {
    border-color: var(--primary);
    background: #f0fdf4;
    font-weight: 600;
}

/* RESULTADOS */
.resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pala-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.pala-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pala-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.pala-card-body {
    padding: 20px;
}

.pala-marca {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.pala-modelo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.pala-precio {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 15px;
}

.pala-specs-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.spec-badge {
    background: var(--light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--dark);
}

.btn-agregar {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-agregar:hover {
    background: var(--primary-dark);
}

.btn-agregar:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* SLOTS DE COMPARACIÓN */
.comparacion-slots {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.comparacion-slots h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--dark);
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.slot-card {
    border: 3px dashed var(--border);
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.slot-card.filled {
    border-style: solid;
    border-color: var(--primary);
    background: #f0fdf4;
}

.slot-empty {
    text-align: center;
    color: #95a5a6;
}

.slot-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.slot-content {
    padding: 15px;
    text-align: center;
}

.slot-marca {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-weight: 600;
}

.slot-modelo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin: 5px 0;
}

.slot-precio {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-remover {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-remover:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.comparar-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

/* TABLA COMPARACIÓN */
.tabla-comparacion-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.tabla-comparacion-container h3 {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--dark);
    font-size: 1.8rem;
}

.grafico-container {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 20px;
    background: var(--light);
    border-radius: 12px;
}

.tabla-scroll {
    overflow-x: auto;
    margin-bottom: 30px;
    -webkit-overflow-scrolling: touch;
}

.tabla-specs {
    width: 100%;
    border-collapse: collapse;
}

.tabla-specs th,
.tabla-specs td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tabla-specs th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tabla-specs tbody tr:hover {
    background: var(--light);
}

.tabla-specs .row-label {
    font-weight: 600;
    color: var(--dark);
    background: var(--light);
}

/* ANÁLISIS IA */
.analisis-ia-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.analisis-ia-box h4 {
    margin-top: 0;
    font-size: 1.4rem;
}

.analisis-item {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.analisis-item:last-child {
    margin-bottom: 0;
}

.analisis-titulo {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* FOOTER */
.comparacion-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

/* BOTONES */
.btn-primary,
.btn-secondary,
.btn-success {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.1rem;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    width: 100%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--dark);
}

/* LOADING */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* NOTIFICACIONES */
.comparador-notificacion {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    z-index: 999999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 350px;
}

.comparador-notificacion.mostrar,
.comparador-notificacion.show {
    transform: translateX(0);
    opacity: 1;
}

.comparador-notificacion.success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.comparador-notificacion.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.comparador-notificacion.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

/* ===================================
   RESPONSIVE OPTIMIZADO PARA MÓVILES
   =================================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .comparador-wrapper {
        padding: 15px;
        margin: 20px auto;
    }
    
    .buscador-section,
    .comparacion-slots,
    .tabla-comparacion-container {
        padding: 20px;
    }
    
    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .resultados-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
}

/* Móviles - pantallas pequeñas */
@media (max-width: 768px) {
    .comparador-wrapper {
        padding: 10px;
        margin: 10px auto;
    }
    
    /* Header */
    .comparador-header {
        margin-bottom: 25px;
    }
    
    .comparador-header h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .comparador-subtitle {
        font-size: 0.95rem;
    }
    
    /* Buscador */
    .buscador-section {
        padding: 15px;
        border-radius: 10px;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        padding: 12px 15px;
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    .btn-search {
        padding: 12px 20px;
        width: 100%;
    }
    
    /* Filtros */
    .filtros-avanzados {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .filtro-group select {
        font-size: 16px; /* Prevenir zoom en iOS */
        padding: 12px;
    }
    
    .btn-toggle-filtros {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* Recomendador */
    .recomendador-header {
        padding: 15px 20px;
    }
    
    .recomendador-header h3 {
        font-size: 1.1rem;
    }
    
    .recomendador-content {
        padding: 20px 15px;
    }
    
    .quiz-question label {
        font-size: 1rem;
    }
    
    .radio-group label {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    /* Resultados Grid */
    .resultados-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pala-card-body {
        padding: 15px;
    }
    
    .pala-modelo {
        font-size: 1.1rem;
    }
    
    .pala-precio {
        font-size: 1.3rem;
    }
    
    /* Slots de comparación */
    .comparacion-slots {
        padding: 15px;
        border-radius: 10px;
    }
    
    .comparacion-slots h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .slots-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .slot-card {
        min-height: 160px;
    }
    
    .slot-icon {
        font-size: 2.5rem;
    }
    
    .slot-modelo {
        font-size: 0.95rem;
    }
    
    .slot-precio {
        font-size: 1rem;
    }
    
    /* Acciones */
    .comparar-actions,
    .comparacion-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success {
        width: 100%;
        padding: 12px 20px;
    }
    
    .btn-lg {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    /* Tabla comparación */
    .tabla-comparacion-container {
        padding: 15px;
        border-radius: 10px;
    }
    
    .tabla-comparacion-container h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .grafico-container {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .tabla-scroll {
        margin: 0 -15px 20px -15px;
        padding: 0 15px;
    }
    
    .tabla-specs th,
    .tabla-specs td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    .tabla-specs th {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Análisis IA */
    .analisis-ia-box {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .analisis-ia-box h4 {
        font-size: 1.2rem;
    }
    
    .analisis-item {
        padding: 12px;
    }
    
    .analisis-titulo {
        font-size: 1rem;
    }
    
    /* Modal */
    .modal {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .modal-content {
        padding: 25px 15px;
        margin: 20px 0;
        max-height: none;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
    
    /* Notificaciones */
    .comparador-notificacion {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        transform: translateY(-100px);
    }
    
    .comparador-notificacion.mostrar,
    .comparador-notificacion.show {
        transform: translateY(0);
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .comparador-header h2 {
        font-size: 1.3rem;
    }
    
    .comparador-subtitle {
        font-size: 0.9rem;
    }
    
    .buscador-section,
    .comparacion-slots,
    .tabla-comparacion-container,
    .analisis-ia-box {
        padding: 12px;
    }
    
    .pala-modelo {
        font-size: 1rem;
    }
    
    .pala-precio {
        font-size: 1.2rem;
    }
    
    .spec-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .tabla-specs th,
    .tabla-specs td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .modal-content {
        padding: 20px 12px;
    }
}

/* Landscape móviles */
@media (max-width: 896px) and (orientation: landscape) {
    .modal {
        align-items: flex-start;
    }
    
    .modal-content {
        margin: 10px 0;
        max-height: 85vh;
    }
    
    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ESTILOS DE IMPRESIÓN / PDF */
@media print {
    header,
    .site-header,
    .main-header,
    .navbar,
    nav,
    .navigation,
    .menu,
    .breadcrumb,
    footer,
    .site-footer,
    .main-footer,
    .footer-widgets,
    .copyright,
    aside,
    .sidebar,
    .widget,
    .comparador-header,
    .buscador-section,
    .resultados-grid,
    .comparacion-slots,
    .comparacion-footer,
    .btn-remover,
    .modal,
    button {
        display: none !important;
    }
    
    .tabla-comparacion-container {
        display: block !important;
        margin: 0;
        padding: 0;
    }
    
    .tabla-specs th,
    .tabla-specs td {
        padding: 8px 10px;
        border: 1px solid #ddd;
    }
    
    .tabla-comparacion-container::before {
        content: "DigitalPadel.net - Comparación de Paletas";
        display: block;
        text-align: center;
        font-size: 14pt;
        color: #00a651;
        font-weight: bold;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #00a651;
    }
    
    body {
        background: white !important;
    }
}

@page {
    size: A4 landscape;
    margin: 1.5cm;
}