/* =======================================
   CONFIGURACIÓN BASE PARA IPHONE / IOS
   ======================================= */
/* <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> */

/* =======================================
   GRID DE TEMAS (TU HTML REAL)
   ======================================= */
.theme-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, 1fr);
}

/* Tablets */
@media (max-width: 1024px) {
    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .theme-grid {
        gap: 10px;
    }
}

/* =======================================
   CONTENEDOR (CLAVE PARA CUADRADO)
   ======================================= */
.theme-box {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

/* 🔥 CUADRADOS SOLO EN MÓVIL */
@media (max-width: 768px) {
    .theme-box {
        aspect-ratio: 1 / 1 !important;
    }
}

/* =======================================
   IMÁGENES
   ======================================= */
.theme-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 🔥 EN MÓVIL: LLENA EL CUADRADO */
@media (max-width: 768px) {
    .theme-box img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
}

/* Hover suave */
.theme-box:hover img {
    transform: scale(1.03);
}

/* =======================================
   BOTÓN (MEJOR POSICIONADO)
   ======================================= */
.theme-box .btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
}

/* =======================================
   ESTILOS GENERALES (TU SISTEMA)
   ======================================= */
.btn-draggable {
    cursor: move !important;
    cursor: -webkit-grab !important;
    cursor: grab !important;
}

.cursor-pointer {
    cursor: pointer;
}

.text-strike {
    text-decoration: line-through;
}

.select2-container {
    display: block !important;
    width: 100% !important;
}

.system-logos {
    max-width: 100%;
    max-height: 100%;
}

.navbar-logos {
    padding: 10px;
    max-height: 59px;
}

.code img {
    width: 100%;
    height: auto;
    padding: 25px;
}

/* =======================================
   IPHONE / TOUCH OPTIMIZACIÓN
   ======================================= */
input, select, textarea {
    font-size: 16px;
}

.theme-box,
.cursor-pointer {
    touch-action: manipulation;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* =======================================
   FALLBACK PARA NAVEGADORES ANTIGUOS
   ======================================= */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .theme-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .theme-box {
        width: 23%;
        margin-bottom: 20px;
    }

    @media (max-width: 1024px) {
        .theme-box { width: 31%; }
    }

    @media (max-width: 768px) {
        .theme-box { width: 48%; }
    }

    .theme-box img {
        height: auto;
    }
}