/* static/css/services.css */
.services-section {
    /* Mismo criterio que summary/conocenos: a medida de su contenido por
       defecto, alto completo solo en desktop. */
    min-height: 0;
    height: auto;
    background-color: #ffffff;
    padding: 100px 20px 80px;
    color: #162640;
    position: relative;
    overflow: hidden;
  }

  @media (min-width: 901px) {
    .services-section {
      min-height: 100vh;
    }
  }
  
  .services-bg-shape {
    position: absolute;
    top: -80px;
    left: -120px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at 30% 30%, #16264022 60%, transparent 100%);
    z-index: 0;
    pointer-events: none;
  }

  .services-eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b61e25;
    margin-bottom: 14px;
  }

  .services-eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: #b61e25;
    display: inline-block;
  }
  
  .services-title {
    position: relative;
    z-index: 1;
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.1;
    text-align: center;
  }

  .services-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    background: #b61e25;
    border-radius: 2px;
    margin: 16px auto 48px;
  }

  /* ---------- Paneles ---------- */

  .services-panels {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .service-panel {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    color: #fff;
  }

  .service-panel.shippings { background-image: url('../../img/shipping.png'); }
  .service-panel.doortodoor { background-image: url('../../img/door_to_door.png'); }
  .service-panel.personalservices { background-image: url('../../img/personalized_services.png'); }
  .service-panel.consolidation { background-image: url('../../img/consolidation.png'); }

  .service-panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(15, 28, 51, 0.55) 0%, rgba(15, 28, 51, 0.9) 100%);
  }

  .service-panel-trigger {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    padding: 20px 22px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: #fff;
  }

  .service-panel-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
  }

  .service-panel-trigger .subt {
    flex: 1 1 auto;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin: 0;
  }

  .service-panel-caret {
    flex-shrink: 0;
    color: #fff;
    opacity: 0.8;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
  }

  .service-panel.is-open .service-panel-caret {
    transform: rotate(180deg);
  }

  /* Alto/ancho 100% CSS -- sin JS calculando px */
  .service-panel-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
  }

  .service-panel.is-open .service-panel-body {
    grid-template-rows: 1fr;
  }

  .service-panel-body-inner {
    overflow: hidden;
    min-height: 0;
  }

  .service-panel-body-inner p {
    padding: 0 22px 24px 80px;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.55;
    font-size: 0.95rem;
  }

  .services-cta {
    display: flex;
    width: fit-content;
    margin: 44px auto 0;
    position: relative;
    z-index: 1;
  }

  /* Responsive */
  @media (max-width: 1024px) {
    .service-panel-body-inner p {
      font-size: 0.92rem;
    }
  }

  /* ---------- Desktop: paneles lado a lado ---------- */
  @media (min-width: 901px) {
    .services-panels {
      flex-direction: row;
      align-items: stretch;
      height: 520px;
      max-width: 1100px;
      gap: 16px;
    }

    /* El panel es un flex-column con justify-content:center -- centra
       como GRUPO todo lo que tenga adentro (trigger + body), sea un
       ícono solo (reposo) o ícono+título+texto (abierto). Antes el
       trigger tenía height:100% y ocupaba el cuadro él solo, dejando el
       párrafo como bloque aparte pegado después sin centrarse con el
       resto -- por eso quedaba todo arriba con un vacío enorme abajo. */
    .service-panel {
      flex: 1;
      min-width: 90px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .service-panel:hover,
    .service-panel:focus-within {
      flex: 3.2;
    }

    /* is-open es un estado de acordeón (mobile); en desktop el único
       disparador es el hover real -- sin esto, el panel marcado is-open
       por defecto (para que el acordeón mobile no arranque vacío) se
       quedaba "abierto" todo el tiempo también en desktop. */
    .service-panel.is-open .service-panel-body {
      grid-template-rows: 0fr;
      opacity: 0;
      margin-top: 0;
    }
    .service-panel.is-open:hover .service-panel-body,
    .service-panel.is-open:focus-within .service-panel-body {
      grid-template-rows: 1fr;
      opacity: 1;
      margin-top: 18px;
    }

    /* Reposo: solo el ícono, grande y centrado */
    .service-panel-trigger {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 0 24px;
    }

    .service-panel-icon {
      width: 76px;
      height: 76px;
      font-size: 1.7rem;
      flex-shrink: 0;
      transition: width 0.4s ease, height 0.4s ease, font-size 0.4s ease, opacity 0.4s ease;
    }

    .service-panel-trigger .subt {
      font-size: 1.1rem;
      line-height: 1.3;
      min-width: 0;
      overflow-wrap: break-word;
      text-align: center;
      opacity: 0;
      max-height: 0;
      margin-top: 0;
      overflow: hidden;
      transition: opacity 0.3s ease, max-height 0.4s ease, margin-top 0.3s ease;
    }

    .service-panel-caret {
      display: none;
    }

    /* Hover: ícono se compacta un poco, título aparece con espacio debajo */
    .service-panel:hover .service-panel-icon,
    .service-panel:focus-within .service-panel-icon {
      width: 50px;
      height: 50px;
      font-size: 1.15rem;
    }

    .service-panel:hover .service-panel-trigger .subt,
    .service-panel:focus-within .service-panel-trigger .subt {
      opacity: 1;
      max-height: 120px;
      margin-top: 18px;
    }

    /* Cuando cualquier panel del grupo está en hover, los demás (no
       hovered) comprimen un poco su ícono -- señal visual de que el foco
       se movió, sin que se vea "roto" el que quedó chico. */
    .services-panels:hover .service-panel:not(:hover) .service-panel-icon {
      width: 52px;
      height: 52px;
      font-size: 1.15rem;
      opacity: 0.65;
    }

    .service-panel-body {
      width: 100%;
      grid-template-rows: 0fr;
      opacity: 0;
      margin-top: 0;
      transition: grid-template-rows 0.4s ease, opacity 0.3s ease, margin-top 0.4s ease;
    }

    .service-panel:hover .service-panel-body,
    .service-panel:focus-within .service-panel-body {
      grid-template-rows: 1fr;
      opacity: 1;
      margin-top: 18px;
    }

    .service-panel-body-inner p {
      padding: 0 24px;
      text-align: center;
    }
  }

  @media (max-width: 425px) {
    .services-title {
      font-size: 2rem;
    }
    .services-title::after {
      margin: 16px auto 32px;
    }
    .service-panel-trigger .subt {
      font-size: 0.98rem;
    }
    .service-panel-body-inner p {
      padding: 0 18px 20px 70px;
      font-size: 0.88rem;
    }
  }