 * {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* ELIMINA SCROLL HORIZONTAL */
    margin: 0;
    padding: 0;
}
 /* HERO */
    .hero-header {
       width: 100%;
  padding-top: 25%;           /* altura proporcional al ancho */
  background-image: url('images/imjuci.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
    }

    .hero-header h1 {
        font-size: 2.5rem;
        font-weight: 700;
    }

    
    #main-wrapper {
        display: flex;
        max-width: 1600px;
        margin: 0 auto;
        padding: 20px 10px 40px 10px;
        gap: 20px;
    }

    /* SIDEBAR */
    #sidebar {
     width: 320px;
      
        flex-shrink: 0;
        position: sticky;
        top: 20px;
        align-self: flex-start;
      
     
        border-radius: 10px;
        color: #eee;
       overflow-y: auto;
        z-index: 100;
        transition: all 0.3s ease;
    }
    .main-content {
   margin-left: 340px; /* espacio para sidebar */
  padding: 2rem;
  padding-bottom: 2rem; /* mucho más ligero */
  margin-bottom: 400px;
     }

    .magic-menu {
       border-radius: 1rem;
        overflow: hidden;
        transition: background 1s ease, background-position 20s linear;
     }

    .accordion-button {
           border-radius: 0.5rem;
        color: #fff;
        font-weight: 600;
        transition: all 0.3s;
    }

    .accordion-button:not(.collapsed) {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .magic-link {
        display: block;
        position: relative;
        padding: 0.5rem 1rem;
        font-weight: 500;
        overflow: hidden;
        border-radius: 0.3rem;
        transition: all 0.4s ease;
        cursor: pointer;
    }

    .magic-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-size: cover;
        background-position: center;
        opacity: 0;
        transition: opacity 0.4s ease, transform 0.4s ease;
        z-index: 0;
    }

    .magic-link:hover::before {
        opacity: 0.2;
        transform: scale(1.05) translateY(-3px);
    }

    .img-hover-zoom {
        transition: transform 0.3s ease;
    }

    .img-hover-zoom:hover {
        transform: scale(1.05);
    }

   
    #content {
         display: grid;
   grid-template-columns: repeat(4, 1fr); /* 5 tarjetas por fila */
    }

    .card-container {
        padding: 5px;
    }

    .card {
             border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 400px; /* altura reducida */
    max-height: 400px;
    }

    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    }
    

    .card-bg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    .card-image {
            position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-size: cover;
        background-position: center;
        opacity: 0;
        transition: opacity 0.5s ease;
        z-index: 1;
    }

    .card:hover .card-image {
        opacity: 0.3;
    }

    .card-content {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 50px;
        position: relative;
        z-index: 3;
          justify-content: center;  /* centra verticalmente */
  align-items: center;      /* centra horizontalmente */
  text-align: center;       /* centra el texto */
    }

    .card-title {
             font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #fff;
    line-height: 1.4;
    min-height: auto;
    }

    .card-buttons {
        margin-top: auto;
    }

    .btn-card {
        background-color: #a57c4a;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 0.6rem;
        font-weight: 600;
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
        transition: all 0.3s;
    }

    .btn-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        color: #fff;
    }

   
    .gradient-1 .card-bg {
        background: linear-gradient(135deg, #611232 0%, #8a1c48ff 100%);
    }

    .gradient-2 .card-bg {
        background: linear-gradient(135deg, #13322e 0%, #225750ff 100%);
    }

    .gradient-3 .card-bg {
        background: linear-gradient(135deg, #a57f2c 0%, #423419ff 100%);
    }

    .gradient-4 .card-bg {
        background: linear-gradient(135deg, #9D2449 0%, #50363eff 100%);
    }


    /* Responsive */

 @media (max-width: 1024px) {
      .sidebar {width: 280px; }

        #content {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .card-content {
        padding: 25px;
    }
      .main-content { margin-left: 260px; }
    }



    @media(max-width:991px) {
       #main-wrapper {
        flex-direction: column;
        padding: 15px 10px 30px 10px;
        gap: 15px;
    }

    #sidebar {
        position: relative;
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
        top: 0;
    }

    #content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .hero-header {
        padding-top: 30%;
    }
}

   
/* Móviles */
@media (max-width: 768px) {
    #content {
        grid-template-columns: 1fr; /* Una columna en móviles */
        gap: 15px;
    }
    
    .card {
        height: 350px; /* Altura reducida para móviles */
        max-height: 350px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .hero-header {
        padding-top: 40%;
    }
    
    .hero-header h1 {
        font-size: 2rem;
    }
}
/* Móviles pequeños */
@media (max-width: 480px) {
    #main-wrapper {
        padding: 10px 5px 20px 5px;
        gap: 10px;
    }
    
    .card {
        height: 300px;
        max-height: 300px;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .btn-card {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .hero-header {
        padding-top: 50%;
    }
    
    .hero-header h1 {
        font-size: 1.7rem;
    }
}