/* ===============================
   VARIABLES
================================== */
:root {
   /* Colors */
   --text-color: #37383e;
   --text-secondary-color: rgba(55, 56, 62, 0.64);
   --green: #96b675;
   --purple: #8189d8;

   /* Gradients */
   --bg-color: linear-gradient(190.33deg, rgba(129, 137, 216, 0.1) 17.54%, rgba(150, 182, 117, 0.1) 170.89%), #FFFFFF;
   --bg-gradient: linear-gradient(white, white) padding-box,
      linear-gradient(91.53deg, #96b675 2.47%, #8189d8 99.87%) border-box;

   /* Shadows */
   --shadow: 2px 2px 10px -1px rgba(0, 0, 0, 0.20)
}

/* ===============================
   RESET & BASE
 ================================== */

html {
   font-size: 62.5%;
   color: var(--text-color);
   scroll-behavior: smooth;
   margin: 0;
   padding: 0;
}

body {
   box-sizing: border-box;
   margin: 0;
   padding: 0;
   padding-top: 78px;
   font-family: "Metropolis", sans-serif;
   background-color: white;
}

/* ===============================
   ACCESSIBILITY
 ================================== */
.skip-link {
   position: absolute;
   top: -40px;
   left: 6px;
   background: var(--green);
   color: white;
   padding: 8px;
   text-decoration: none;
   border-radius: 4px;
   font-weight: bold;
   z-index: 1000;
   transition: top 0.3s;
}

.skip-link:focus {
   top: 6px;
}

.visually-hidden {
   position: absolute !important;
   width: 1px !important;
   height: 1px !important;
   padding: 0 !important;
   margin: -1px !important;
   overflow: hidden !important;
   clip: rect(0, 0, 0, 0) !important;
   white-space: nowrap !important;
   border: 0 !important;
}



/* High contrast mode support */
@media (prefers-contrast: high) {
   :root {
      --text-color: #000000;
      --green: #006600;
   }
}


@media (prefers-reduced-motion: reduce) {
   * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
   }

   html {
      scroll-behavior: auto;
   }
}

h1,
h2,
h3,
h4 {
   margin: 2.4rem 0;
   padding: 0;
   line-height: 1.2;
}

p,
a {
   font-size: 1.6rem;
   color: var(--text-color);
   line-height: 1.6;
}

a {
   text-decoration: none;
}

li {
   list-style: none;
   line-height: 1.4;
   margin-bottom: 0.8rem;
}

.page-width {
   max-width: 132rem;
   margin-inline: auto;
   padding: 0 16rem;
}

.header {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   margin: 0;
   padding: 0;
   background: #ffffff;
   z-index: 1000;
   box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.header__container {
   max-width: 120rem;
   margin: 0 auto;
   padding: 15px 50px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 24px;
   box-sizing: border-box;
}

.header__container__logo a {
   display: inline-flex;
   align-items: center;
}

.header__container__logo img {
   display: block;
   height: 48px;
   width: auto;
}

.hamburger {
   display: none;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   width: 32px;
   height: 32px;
   gap: 4px;
   margin: 0 20px 0 0;
   background: transparent;
   border: none;
   cursor: pointer;
   padding: 0;
   z-index: 1001;
   transition: transform 0.3s ease;
}

.hamburger__line {
   width: 20px;
   height: 3px;
   background-color: #37383e;
   border-radius: 999px;
   transition: all 0.3s ease;
   /* Asegura que no haya border ni box-shadow extra */
   border: none;
   box-shadow: none;
}

.hamburger--active .hamburger__line:nth-child(1) {
   transform: translateY(6px) rotate(45deg);
}

.hamburger--active .hamburger__line:nth-child(2) {
   opacity: 0;
}

.hamburger--active .hamburger__line:nth-child(3) {
   transform: translateY(-6px) rotate(-45deg);
}

.header__navigation {
   display: none;
}

.header__navigation__list {
   list-style: none;
   display: flex;
   gap: 2.4rem;
   margin: 0;
   padding: 0;
}

.header__navigation__list li {
   margin: 0;
}

.header__navigation__list a {
   font-weight: 500;
   font-size: 1.6rem;
   color: var(--text-color);
   text-decoration: none;
   position: relative;
   padding-bottom: 4px;
}

.header__navigation__list a::after {
   content: "";
   position: absolute;
   left: 0;
   bottom: 0;
   width: 0;
   height: 2px;
   background: var(--green);
   transition: width 0.2s ease;
}

.header__navigation__list a:hover::after,
.header__navigation__list a.active::after {
   width: 100%;
}

.mobile-menu {
   position: fixed;
   top: 70px;
   right: 30px;
   width: 254px;
   background: #ffffff;
   padding: 12px;
   border-radius: 15px;
   box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
   opacity: 0;
   visibility: hidden;
   transform: translateY(-20px) scale(0.95);
   transition: all 0.3s ease;
   pointer-events: none;
   display: flex;
   flex-direction: column;
   gap: 8px;
   z-index: 99999;
}

.mobile-menu__link {
   text-decoration: none;
   color: #37383E;
   width: 100%;
   display: block;
   position: relative;
}

.mobile-menu__link::after {
   content: "";
   position: absolute;
   bottom: 0;
   left: 0;
   width: 100%;
   height: 0.5px;
   background-color: #000000;
}

.mobile-menu__link:last-child::after {
   display: none;
}

.menu-header {
   padding: 20px;
   border-bottom: none;
   font-size: 16px;
   position: relative;
}

.mobile-menu__link.active .menu-header::before {
   content: "";
   position: absolute;
   left: 0;
   top: 50%;
   transform: translateY(-50%);
   width: 4px;
   height: 20px;
   background-color: #96B675;
   border-radius: 2px;
}

.mobile-menu--active {
   opacity: 1;
   visibility: visible;
   transform: translateY(0) scale(1);
   pointer-events: auto;
}

.mobile-menu--active .mobile-menu__link {
   pointer-events: auto;
}

.overlay {
   opacity: 0;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: transparent;
   z-index: 100;
   pointer-events: none !important;
   transition: all 0.3s ease;
}

.overlay--active {
   opacity: 0;
   visibility: visible;
   pointer-events: none !important;
}



.header__navigation__list a.active::before {
   content: "";
   position: absolute;
   left: 0;
   top: 50%;
   transform: translateY(-50%);
   width: 4px;
   height: 20px;
   background-color: var(--green);
   border-radius: 2px;
}

.header__navigation__list a:hover::before {
   width: 0.5rem;
}

.search__section {
   margin: 4.8rem 1rem 2.4rem;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 3.2rem;

   .search__section__form {
      display: flex;
      max-width: 62rem;
      width: 100%;

      .section__form__input {
         background: white;
         border-radius: 2.4rem 0 0 2.4rem;
         border: 1px solid var(--text-color);
         border-right: none;
         max-width: 54rem;
         padding: 1.6rem;
         font-size: 1.6rem;
         width: 100%;
      }

      .section__form__submit {
         border-radius: 0 2.4rem 2.4rem 0;
         padding: 0.8rem 1rem;
         background: linear-gradient(91.53deg, #96b675 2.47%, #8189d8 99.87%);
         color: white;
         border: none;
         font-size: 1.6rem;
         cursor: pointer;

         .desktop__submit-text {
            display: none;
         }

         .mobile__submit-icon {
            display: block;
         }

      }
   }
}


.category__section {
   margin: 5rem 0 8rem;

   .category__name a {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      border-bottom: 2px solid white;
      font-size: 3.2rem;

      &:hover {
         border-bottom: 2px solid var(--green);
      }
   }

   .categories__grid {
      margin-top: 2.4rem;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      gap: 2.4rem;
   }

   .category__card {
      margin-bottom: 0rem;
      background-color: white;
      padding: 2.4rem;
      border-radius: 1.6rem;
      box-shadow: var(--shadow);

      &:hover {
         background-color: #f6f6f6;
      }

      .category__card__title {
         font-size: 2rem;
         font-weight: 400;
         margin: 0 0 1.6rem;
      }

      .category__card__description {
         display: -webkit-box;
         font-size: 1.4rem;
         color: var(--text-secondary-color);
         margin-bottom: 0.8rem;
         -webkit-line-clamp: var(--lines, 2);
         -webkit-box-orient: vertical;
         overflow: hidden;
         text-overflow: ellipsis;
      }

      .category__card__count {
         font-size: 1.3rem;
         color: var(--green);
         font-weight: 600;
      }
   }
}

.footer {
   padding: 2rem 1.6rem;
   background-color: #f8f9fa;
   border-top: 1px solid #e9ecef;
   margin-top: 4rem;

   .footer__content {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
   }

   p,
   a {
      text-align: center;
      font-size: 1.3rem;
      margin: 0;
   }

   a {
      color: var(--green);
      text-decoration: underline;

      &:hover {
         text-decoration: none;
      }
   }
}

.footer__nav {
   a {
      font-size: 1.2rem;
      color: var(--text-color);
      text-decoration: none;
      transition: color 0.3s ease;

      &:hover {
         color: var(--green);
         text-decoration: underline;
      }
   }
}

.category__description {
   font-size: 1.4rem;
   color: #666;
   margin-bottom: 2rem;
   text-align: center;
   max-width: 600px;
   margin-left: auto;
   margin-right: auto;
}

@media (max-width: 738px) {

   html {
      font-size: 56%;
      overflow-x: hidden;
   }

   body {
      overflow-x: hidden;
      width: 100%;
      padding-top: 60px;
   }

   h1 {
      font-size: 2.4rem;
   }

   h2 {
      font-size: 2rem;
   }

   .page-width {
      padding: 0 2.5rem;
      overflow-x: hidden;
   }

   .header {
      padding: 0;
      background: #ffffff;
   }

   .header__container {
      padding: 15px 20px;
   }

   .header__container__logo img {
      height: 30px;
   }

   .header__navigation {
      display: none;
   }

   .hamburger {
      display: flex;
   }

   .mobile-menu {
      right: 20px;
      width: 230px;
   }

   .mobile-menu__link {
      opacity: 0;
      transform: translateX(-20px);
      transition: all 0.3s ease;
   }

   .mobile-menu--active .mobile-menu__link {
      opacity: 1;
      transform: translateX(0);
   }

   .search__section {
      margin: 3.2rem 1rem 2.4rem;
      gap: 2.4rem;

      .search__section__form {
         flex-direction: row;

         .section__form__input {
            font-size: 1.4rem;
            padding: 1.2rem;
         }

         .section__form__submit {
            padding: 1.2rem;
            min-width: 44px;
            min-height: 44px;
         }
      }
   }

   .category__section {
      margin: 2rem 0 4rem;

      .category__name {
         font-size: 2.4rem;
         margin-bottom: 1.6rem;

         a {
            font-size: 2.4rem;
         }
      }

      .categories__grid {
         grid-template-columns: 1fr !important;
         gap: 1.6rem;
         margin-top: 1.6rem;
      }

      .category__card {
         padding: 2.4rem;

         .category__card__title {
            font-size: 2rem;
            margin: 0 0 1.2rem;
         }

         .category__card__description {
            font-size: 1.6rem;
            margin-bottom: 1rem;
         }

         .category__card__count {
            font-size: 1.4rem;
         }
      }
   }

   button,
   .header__navigation__list a {
      min-height: 44px;
      min-width: 44px;
   }
}

@media (max-width: 480px) {

   html {
      font-size: 54%;
      overflow-x: hidden;
   }

   body {
      overflow-x: hidden;
      width: 100%;
      padding-top: 60px;
   }

   .page-width {
      padding: 0 2.5rem;
      overflow-x: hidden;
   }

   .category__section {
      padding: 0 2.5rem;

      .category__card {
         padding: 2.4rem;

         .category__card__title {
            font-size: 2rem;
         }

         .category__card__description {
            font-size: 1.6rem;
            -webkit-line-clamp: 3;
         }
      }
   }
}

/* Media queries específicos para móvil (576px) */
@media screen and (max-width: 576px) {
   .header {
      padding: 0;
      background: #ffffff;
   }

   .header__container {
      padding: 15px 20px;
   }

   .header__container__logo img {
      height: 30px;
   }

   .hamburger {
      display: flex;
      margin-right: 3px;
      margin-left: auto;
   }

   .mobile-menu {
      right: 20px;
      width: 230px;
   }

   .mobile-menu__link {
      opacity: 0;
      transform: translateX(-20px);
      transition: all 0.3s ease;
   }

   .mobile-menu--active .mobile-menu__link {
      opacity: 1;
      transform: translateX(0);
   }

   .mobile-menu__link:nth-child(1) {
      transition-delay: 0.05s;
   }

   .mobile-menu__link:nth-child(2) {
      transition-delay: 0.1s;
   }

   .mobile-menu__link:nth-child(3) {
      transition-delay: 0.15s;
   }

   .mobile-menu__link:nth-child(4) {
      transition-delay: 0.2s;
   }

   .menu-header {
      font-size: 16px;
   }

   .mobile-menu__link:hover .menu-header {
      background: #f5f5f5;
      border-radius: 12px;
   }

   .overlay {
      position: fixed;
      z-index: 9998;
   }
}

@media (min-width: 1024px) {

   h1 {
      font-size: 3.2rem;
   }

   body {
      padding-top: 88px;
   }

   .page-width {
      padding: 0 16rem;
   }

   .header {
      padding: 0;
      background: #ffffff;
   }

   .header__container {
      padding: 20px 50px;
   }

   .header__container__logo img {
      height: 48px;
   }

   .overlay {
      display: none;
   }

   .hamburger {
      display: none;
   }

   .mobile-menu {
      display: none;
   }

   .header__navigation {
      display: block;
      position: static;
      background: none;
      box-shadow: none;
      border-radius: 0;
      transform: translateY(0);
      opacity: 1;
      visibility: visible;
      z-index: auto;
      padding: 0;
      overflow: auto;
      max-width: none;
      width: fit-content;
   }

   .header__navigation__list {
      display: flex;
      flex-direction: row;
      gap: 2.4rem;
   }

   .header__navigation__list li {
      transition: none;
      border-bottom: none;
      padding-bottom: 0;
   }

   .search__section {
      margin-top: 6.4rem;

      .search__section__form {

         .section__form__submit {
            padding: 1.6rem;

            .desktop__submit-text {
               display: block;
            }

            .mobile__submit-icon {
               display: none;
            }

         }
      }
   }

   .category__section {
      margin: 5rem 0 8rem;

      .categories__grid {
         grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      }
   }
}

@media (min-width: 1024px) {
   .category__section {
      .categories__grid {
         grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      }
   }
}

@media (min-width: 1239px) {
   .page-width {
      padding: 0 14rem;
   }
}

/* === TABLET DESIGN (739px - 1023px) === */
@media screen and (min-width: 739px) and (max-width: 1023px) {
   body {
      padding-top: 70px;
   }

   .header__container {
      padding: 18px 30px;
      height: auto;
   }

   .header__container__logo img {
      height: 30px !important;
      width: 139.53px !important;
      object-fit: contain;
      object-position: center;
      max-width: 100%;
      min-width: 0;
   }

   .hamburger {
      display: flex !important;
      margin-right: 3px;
      margin-left: auto;
   }

   .header__navigation {
      display: none !important;
   }

   .mobile-menu {
      display: flex !important;
      position: fixed;
      top: 70px;
      right: 30px;
      width: 254px;
      background: #ffffff;
      padding: 12px;
      border-radius: 15px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
      z-index: 99999;
      flex-direction: column;
      gap: 8px;
   }

   .page-width {
      padding: 0 2.5rem !important;
   }

   .category__section {
      margin: 3rem 0 5rem;
      padding: 0 2.5rem;
   }

   .categories__grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 2rem;
      margin-top: 2rem;
   }

   .category__card {
      margin-bottom: 1.5rem;
      background-color: white;
      padding: 1.8rem 1.2rem;
      border-radius: 1.6rem;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      min-width: 0;
   }

   .category__card__title {
      font-size: 1.7rem;
      font-weight: 400;
      margin: 0 0 1.2rem;
   }

   .category__card__description {
      font-size: 1.3rem;
      color: var(--text-secondary-color);
      margin-bottom: 0.6rem;
   }

   .category__card__count {
      font-size: 1.2rem;
      color: var(--green);
      font-weight: 600;
   }
}