/* ============================================
   ESTILOS DE MODAL SOLO PARA MÓVILES Y TABLETS
   No aplica en PC/Laptop
   ============================================ */

/* MODAL MÓVIL - Estructura General */
@media (max-width: 1024px) {
    #modal-detalles {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-contenido {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        overflow-y: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .btn-cerrar {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 1000 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        border: none !important;
        font-size: 28px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .detalles-libro {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
    }

    /* IMAGEN PRINCIPAL - ARRIBA */
    .libro-preview {
        width: 100% !important;
        order: -1 !important;
        margin-bottom: 0 !important;
    }

    .book-image-container {
        width: 100% !important;
        height: 280px !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    /* INFORMACIÓN - ABAJO */
    .libro-info {
        padding: 20px 18px 30px 18px !important;
        order: 1 !important;
        background: #ffffff !important;
        border-radius: 20px 20px 0 0 !important;
        margin-top: -20px !important;
        position: relative !important;
        z-index: 10 !important;
    }

    .libro-info h2 {
        font-size: 1.6rem !important;
        color: #020b6f !important;
        margin: 0 0 8px 0 !important;
        line-height: 1.2 !important;
    }

    .libro-info .subtitulo {
        font-size: 0.75rem !important;
        color: #7cb342 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
        font-weight: 700 !important;
        margin-bottom: 12px !important;
    }

    .libro-info .descripcion {
        font-size: 0.9rem !important;
        color: #44474e !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }

    /* CARACTERÍSTICAS */
    .caracteristicas-rapidas {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .caract {
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
        font-size: 0.9rem !important;
        color: #44474e !important;
    }

    .caract .icono {
        color: #7cb342 !important;
        font-weight: bold !important;
        flex-shrink: 0 !important;
        margin-top: 2px !important;
    }

    /* COLORES DISPONIBLES */
    .colores-disponibles {
        margin-bottom: 20px !important;
    }

    .colores-disponibles h4 {
        font-size: 0.95rem !important;
        color: #020b6f !important;
        margin: 0 0 12px 0 !important;
        font-weight: 700 !important;
    }

    .color-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
    }

    .color-card-item {
        cursor: pointer !important;
        text-align: center !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        border: 2px solid #e0e0e0 !important;
        transition: all 0.3s ease !important;
    }

    .color-card-item:hover,
    .color-card-item.selected {
        border-color: #020b6f !important;
        transform: scale(1.05) !important;
    }

    .color-card-item img {
        width: 100% !important;
        height: 70px !important;
        object-fit: cover !important;
        display: block !important;
    }

    .color-name {
        font-size: 0.7rem !important;
        color: #44474e !important;
        margin: 5px 0 0 0 !important;
        padding: 0 3px !important;
        word-break: break-word !important;
    }

    /* INFORMACIÓN DE ENTREGA */
    .info-entrega {
        background: #f5f5f5 !important;
        padding: 10px 12px !important;
        border-radius: 6px !important;
        font-size: 0.8rem !important;
        color: #666 !important;
        margin-bottom: 12px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* BOTONES */
    .btn-cotizar {
        display: block !important;
        width: 100% !important;
        padding: 14px 16px !important;
        margin-bottom: 10px !important;
        background: #020b6f !important;
        color: white !important;
        text-decoration: none !important;
        border: none !important;
        border-radius: 8px !important;
        font-weight: 700 !important;
        font-size: 0.9rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        text-align: center !important;
    }

    .btn-cotizar:hover {
        background: #202983 !important;
        transform: translateY(-2px) !important;
    }

    .btn-cotizar.btn-express {
        background: #d9512f !important;
        margin-bottom: 0 !important;
    }

    .btn-cotizar.btn-express:hover {
        background: #c23d1f !important;
    }
}

/* AJUSTES PARA TABLETS (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    .book-image-container {
        height: 320px !important;
    }

    .color-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .libro-info h2 {
        font-size: 1.8rem !important;
    }
}

/* AJUSTES PARA TELÉFONOS GRANDES (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .book-image-container {
        height: 280px !important;
    }

    .color-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .color-name {
        font-size: 0.65rem !important;
    }
}

/* AJUSTES PARA TELÉFONOS PEQUEÑOS (hasta 480px) */
@media (max-width: 480px) {
    .modal-contenido {
        max-height: 85vh !important;
    }

    .btn-cerrar {
        width: 36px !important;
        height: 36px !important;
        font-size: 24px !important;
    }

    .libro-info {
        padding: 16px 14px 24px 14px !important;
    }

    .libro-info h2 {
        font-size: 1.4rem !important;
        margin-bottom: 6px !important;
    }

    .libro-info .descripcion {
        font-size: 0.85rem !important;
        margin-bottom: 16px !important;
    }

    .caract {
        font-size: 0.8rem !important;
    }

    .color-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .color-card-item img {
        height: 60px !important;
    }

    .color-name {
        font-size: 0.6rem !important;
    }

    .btn-cotizar {
        padding: 12px 14px !important;
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
    }

    .caracteristicas-rapidas {
        gap: 8px !important;
    }
}

/* SCROLL SUAVE EN MODALES MÓVILES */
@media (max-width: 1024px) {
    .modal-contenido {
        scroll-behavior: smooth !important;
    }

    .modal-contenido::-webkit-scrollbar {
        width: 6px;
    }

    .modal-contenido::-webkit-scrollbar-track {
        background: transparent;
    }

    .modal-contenido::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 3px;
    }

    .modal-contenido::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
}
