/* ===================================
   RESPONSIVE DESIGN - Casa de la Pólvora
   Mobile-first approach
   =================================== */

/* TABLETS Y MÓVILES (320px - 1200px) */
@media (min-width: 320px) and (max-width: 1200px) {
    body {
        padding: 0.5rem;
        font-size: 15px;
    }
    /*Estilos provisorios se deben borrar*/
    #amigos img {
        width: 90%;
    }

    #agenda h3 {
        font-size: 1.2rem;
    }

    #agenda img {
        width: 90%;
    }

    #amigos h3 {
        font-size: 1.2rem;
    }

    /*Se deben borrar hasta aca*/

    /* Header y navegación mobile */
    .navbar-collapse {
        background-color: #2f2f2f;
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    .navbar-toggler {
        background-color: #2f2f2f;
        border: 2px solid #f06529;
        z-index: 1001;
        margin-left: 0.6rem;
        padding: 0.5rem 0.75rem;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(240, 101, 41, 0.25);
    }

    header .navbar-nav {
        width: auto !important;
        align-items: center !important;
        margin-left: 5rem !important;
    }

    /* Botón de tema en tablets y móviles */
    .theme-toggle-btn {
        right: 90px;
        top: 25px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Hero / Carrusel mobile */
    #hero {
        margin-top: 0;
        width: 100%;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    #hero .carousel-item img {
        height: clamp(250px, 40vw, 350px);
        width: 100%;
        margin-top: 6rem;
    }

    /* Caption del carrusel en móviles */
    #hero .carousel-caption {
        display: block !important;
        padding: 0.75rem;
        bottom: 0.5rem;
    }

    #hero .carousel-caption h1 {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
        color: #fff;
        background-color: rgba(44, 44, 44, 0.8);
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        font-weight: 700;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
        line-height: 1.2;
    }

    #hero .carousel-caption p {
        color: #f5f0e6;
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        background-color: rgba(44, 44, 44, 0.8);
        border-radius: 6px;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }

    /* Botones responsive */
    .btn {
        font-size: clamp(0.85rem, 2vw, 1rem);
        padding: 0.5rem 1rem;
        border-radius: 6px;
    }

    .carousel-caption .btn-primary {
        padding: 0.5rem 1.25rem;
        font-size: clamp(0.8rem, 2vw, 0.9rem);
    }

    .col-md-3 .btn,
    .col-md-4 .btn,
    .col-md-6 .btn {
        width: 100%;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    /* Logos - ocultar en header mobile */
    .logo-cp,
    .logo-aa {
        display: none;
    }

    /* Identidad - mostrar en mobile */
    .identidad {
        width: 100%;
        margin-top: 0.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-radius: 8px;
        padding: 0.5rem;
        background-color: #2f2f2f;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }

    .identidad .logo-cp-2,
    .identidad .logo-aa-2 {
        max-height: clamp(50px, 10vw, 65px);
        width: auto;
    }

    .identidad .logo-cp-2 {
        border-radius: 6px;
    }

    .identidad .logo-aa-2 {
        border-radius: 50%;
    }

    /* Secciones */
    section {
        scroll-margin-top: 100px;
    }

    /* Cards responsive */
    .card {
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: clamp(1.1rem, 3vw, 1.25rem);
    }

    .card-text {
        font-size: clamp(0.9rem, 2vw, 1rem);
    }

    /* Botones de contacto */
    #contacto .buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        justify-content: center;
        margin-top: 1rem;
        width: 100%;
        max-width: 500px;
    }

    #contacto .buttons .btn {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Footer responsive */
    .logo-cp-ft,
    .logo-aa-ft {
        display: none;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        padding: 1.5rem 1rem;
    }

    footer .copy p {
        font-size: clamp(0.75rem, 2vw, 0.85rem);
    }
}

/* DESKTOP (> 1200px) */
@media (min-width: 1201px) {
    .identidad {
        display: none;
    }

    #hero {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* MÓVILES PEQUEÑOS (< 576px) */
@media (max-width: 576px) {
    body {
        font-size: 14px;
        padding: 0.25rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Botón de tema en móviles pequeños */
    .theme-toggle-btn {
        right: 75px;
        top: 22px;
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    #hero .carousel-item img {
        height: 220px;
        margin-top: 5.5rem;
    }

    #hero .carousel-caption {
        padding: 0.5rem;
        bottom: 0.25rem;
    }

    #hero .carousel-caption h1 {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
    }

    #hero .carousel-caption p {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .carousel-caption .btn-primary {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

/* MÓVILES MUY PEQUEÑOS (< 400px) */
@media (max-width: 400px) {
    body {
        font-size: 13px;
    }

    /* Botón de tema en móviles muy pequeños */
    .theme-toggle-btn {
        right: 70px;
        top: 20px;
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    #hero .carousel-item img {
        height: 200px;
    }

    #hero .carousel-caption h1 {
        font-size: 0.9rem;
    }

    #hero .carousel-caption p {
        font-size: 0.7rem;
    }

    .navbar-toggler {
        padding: 0.4rem 0.6rem;
    }
}
