/* ============================
📱 RESPONSIVE MOBILE
============================ */
.subaros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
    padding: 0 15px;
    margin-top: 10px;
}

.subaros-grid .item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.subaros-grid .item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.subaros-grid .item img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 8px;
}

.subaros-grid .item p {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin: 0;
}

/* Ocultar swiper en mobile vertical cuando hay grid */
@media (max-width: 768px) and (orientation: portrait) {
    #contenidoSecundario:has(.subaros-grid) .swiper {
        display: none !important;
    }
    
    #contenidoSecundario:has(.subaros-grid) .subaros-grid {
        display: grid !important;
    }
}

/* Mostrar swiper en landscape y desktop */
@media (min-width: 769px), (orientation: landscape) {
    #contenidoSecundario:has(.subaros-grid) .subaros-grid {
        display: none !important;
    }
    
    #contenidoSecundario:has(.subaros-grid) .swiper {
        display: block !important;
    }
}

/* ============================
   🖥️ DESKTOP (min-width: 1025px)
============================ */
@media (min-width: 1025px) {
    .subaros-grid {
        display: none !important;
    }
    
    #contenidoSecundario:has(.subaros-grid) .swiper {
        display: block !important;
    }
}

/* ============================
📱➡️💻 MOBILE LARGE
============================ */
@media (min-width: 481px) and (max-width: 767px) {
    .car-container img {
        max-width: 85%;
    }

    /* Menú principal */
    .menu-principal {
        gap: 1.5rem;
    }

    .boton img {
        width: 120px;
        height: 90px;
    }

    .boton p {
        font-size: 0.85rem;
    }

    /* Swiper */
    .swiper-slide img {
        width: 120px;
        height: 120px;
    }

    /* Flechas Swiper */
    .swiper-button-next,
    .swiper-button-prev {
        width: 34px;
        height: 34px;
    }

    .swiper-button-next svg,
    .swiper-button-prev svg {
        width: 14px !important;
        height: 14px !important;
    }

    #contenidoSecundario {
        gap: 20px;
        padding: 15px 30px;
    }

    .menu-secundario .item img {
        width: 180px;
        height: 130px;
    }
    .aro-info {
        font-size: 13px;
        padding: 10px 16px;
        max-width: 350px;
    }
    .contenido-secundario-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
        padding: 0 15px;
    }

    /*Sub-aros en tablet*/
    .subaros-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
        padding: 0 20px;
    }
    
    .subaros-grid .item img {
        width: 120px;
        height: 120px;
    }
}

/* ============================
📱 MOBILE (max-width: 480px)
============================ */
@media (max-width: 480px) {
    body {
        height: 100vh;
        overflow: hidden; /* Evita scroll del body */
    }

    .content-logo-principal {
        position: absolute;
        left: 11px;
        top: 13px;
    }

    .logo-principal {
        width: 175px;
    }


    .content-logo img {
        width: 350px;
    }

    .content-title {
        max-width: 470px;
        width: 450px;
        padding: 10px 12px;
    }

    .content-title h1 {
        font-size: 24px;
        line-height: 25px;
    }

    .bg-fondo {
        min-height: 100vh !important;
        height: auto !important;
        background-size: cover !important;
        background-position: center !important;
        justify-content: normal;
    }
    .aro-info {
        font-size: 14px;
        padding: 10px 14px;
        max-width: 300px;
        margin-bottom: 15px;
        line-height: 1.3;
    }
    .contenido-secundario-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
        padding: 0 10px;
    }

    /*Sub-aros en mobile*/
    .subaros-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
        padding: 0 10px;
    }

    .subaros-grid .item img {
        width: 100px;
        height: 100px;
    }

    .subaros-grid .item p {
        font-size: 0.75rem;
    }

    .menu-secundario .item[data-tipo="llantas"] img {
        width: 130px;
        height: 130px;
    }
    .content-name {
        margin-top: 5px;
    }

    .menu-secundario .item #cars-models {
        margin-top: -17px;
    }

    /* Mantener el auto principal visible solo en mobile */
    .car-container {
        position: sticky;
        top: 0;
        left: 0;
        z-index: 5;
        background: transparent;
        padding-top: 0px;
        margin-top: 60px;
        padding-bottom: 12px;
    }

    .car-color-overlay,
    .car-wheel-overlay {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Solo el contenido secundario hace scroll en mobile */
    .menu-secundario .contenido-secundario {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 18px;
        box-sizing: border-box;
    }

    .car-container img {
        max-width: 100%;
    }

    .menus-container {
        margin-top: 10px;
        min-height: 400px;
    }

    /* Menú principal */
    .menu-principal {
        gap: 1rem;
        padding-top: 30px;
    }

    .boton {
        padding: 10px 15px;
        border-radius: 10px;
    }

    .boton img {
        width: 120px;
        height: 90px;
    }

    .boton p {
        font-size: 1rem;
    }

    /* Swiper */
    .swiper.mySwiper {
        width: 100% !important;
        padding: 10px 0;
        margin: 0;
    }

    .swiper-wrapper {
        padding: 0 10px;
    }

    .swiper-slide {
        width: 120px !important; /* Ancho fijo */
        flex-shrink: 0;
    }

    .swiper-slide img {
        width: 90px;
        height: 90px;
    }

    /* Flechas Swiper */
    .swiper-button-next,
    .swiper-button-prev {
        width: 28px;
        height: 28px;
    }

    .swiper-button-next svg,
    .swiper-button-prev svg {
        width: 12px !important;
        height: 12px !important;
    }

    .swiper-slide p {
        font-size: 0.7rem;
        line-height: 1.2;
        margin-top: 5px;
    }

    /* Área de contenido con Swiper */
    #contenidoSecundario:has(.swiper) {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        padding: 15px 5px;
    }

    /* Contenido secundario */
    #contenidoSecundario {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
        padding: 30px 0;
    }

    #contenidoSecundario:has(.aro-info) {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .menu-secundario .item img {
        width: 170px;
        height: 120px;
    }

    .cerrar {
        padding: 10px;
        border-radius: 10px;
    }

    .musica-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 18px;
    }

    /*===== BOTONES DE COMPARTIR =====*/
    .action-buttons {
        top: auto;
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }

    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-content h3 {
        font-size: 1.2rem;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }

    .social-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* ============================
📱 MOBILE (max-width: 360px)
============================ */
@media (max-width: 360px) {
    body {
        height: 100vh;
        overflow: hidden; /* Evita scroll del body */
    }

    .content-logo-principal {
        position: absolute;
        left: 11px;
        top: 13px;
    }

    .logo-principal {
        width: 175px;
    }

    .content-logo img {
        width: 300px;
    }

    .content-title {
        max-width: 355px;
        width: 330px;
        padding: 10px 12px;
    }

    .content-title h1 {
        font-size: 20px;
        line-height: 25px;
    }

    .bg-fondo {
        min-height: 100vh !important;
        height: auto !important;
        background-size: cover !important;
        background-position: center !important;
        justify-content: center;
    }

    .aro-info {
        background-color: #fff;
        color: #000;
        width: 90%;
        font-size: 0.75rem;
        max-width: 300px;
        text-align: center;
        padding: 8px 10px;
        line-height: 1.3;
    }

    #contenidoSecundario:has(.aro-info) {
        display: flex;
        flex-direction: column;
        align-items: start;
        justify-content: flex-start;
        gap: 0;
    }

    .contenido-secundario-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
        padding: 0 10px;
    }

    /*Sub-aros en mobile pequeño*/
    .subaros-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
        padding: 0 10px;
    }

    .subaros-grid .item {
        padding: 8px;
    }
    
    .subaros-grid .item img {
        width: 90px;
        height: 90px;
    }
    
    .subaros-grid .item p {
        font-size: 0.7rem;
    }

    .content-name {
        margin-top: 5px;
        font-size: 0.7rem;  
    }

    .menu-secundario .item #cars-models {
        margin-top: -17px;
    }

    .musica-btn {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 20px;
        min-width: 44px;  /* Área táctil mínima iOS */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mantener el auto principal visible solo en mobile */
    .car-container {
        position: sticky;
        top: 0;
        left: 0;
        z-index: 5;
        background: transparent;
        padding-top: 0px;
        margin-top: 0px;
        padding-bottom: 0px;
    }

    .car-color-overlay,
    .car-wheel-overlay {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Solo el contenido secundario hace scroll en mobile */
    .menu-secundario .contenido-secundario {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 18px;
        box-sizing: border-box;
    }
    .car-container img {
        max-width: 100%;
    }

    .menus-container {
        margin-top: 10px;
        min-height: 400px;
    }

    /* Menú principal */
    .menu-principal {
        gap: 1rem;
        padding-top: 30px;
    }

    .boton {
        padding: 10px 15px;
        border-radius: 10px;
    }

    .boton img {
        width: 120px;
        height: 90px;
    }

    .boton p {
        font-size: 1rem;
    }

    /* Swiper */
    .swiper.mySwiper {
        width: 100% !important;
        padding: 10px 0;
        margin: 0;
        overflow: visible;
    }

    .swiper-wrapper {
        padding: 0 5px;
        display: flex;
        align-items: center;
    }

    .swiper-slide {
        width: 110px !important;
        min-width: 110px !important;
        flex-shrink: 0;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .swiper-slide img {
        width: 85px !important;
        height: 85px !important;
        object-fit: contain;
    }

    .swiper-slide p {
        font-size: 0.65rem;
        line-height: 1.1;
        margin-top: 5px;
        text-align: center;
        word-wrap: break-word;
        max-width: 100%;
    }

    /* Contenido secundario */
    #contenidoSecundario {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
        padding: 30px 0;
    }

    #contenidoSecundario:has(.swiper),
    #contenidoSecundario.swiper-mode {
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 5px;
        padding: 15px 5px;
    }


    .menu-secundario .item img {
        width: 150px;
        height: 100px;
    }

    .cerrar {
        padding: 10px;
        border-radius: 10px;
        font-size: 0.85rem;
    }

    .musica-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 18px;
    }

    .action-buttons {
        top: auto;
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }

    .action-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}