@layer components {
  /* ==========================================================================
   * KairSun Web v5 · Single Product Stage (#producto) — WS3
   * Encapsulates all 8 core modules inside a single interactive 28px squircle
   * with 1 .ks-device phone frame, module tabs, and auto-advancing sub-view
   * progress tabs (4800ms, GPU scaleX, pauses on hover/focus/hidden/offscreen).
   * ========================================================================== */

  .ks-producto {
    position: relative;
    padding-block: clamp(1.75rem, 3.5vw, 3rem);
  }

  .ks-producto__head {
    max-width: 720px;
    margin-bottom: 1.15rem;
  }

  .ks-producto__tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.4rem;
    border-radius: 22px;
    background: rgba(10, 15, 26, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.1rem;
  }

  .ks-producto__tab {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1rem;
    border-radius: 16px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ks-text-2, #A8B5C8);
    font-family: var(--ks-font-sans, "DM Sans", sans-serif);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition:
      color 160ms ease,
      background-color 160ms ease,
      border-color 160ms ease,
      transform 160ms ease;
  }

  .ks-producto__tab:hover,
  .ks-producto__tab:focus-visible {
    color: var(--ks-text-1, #F4F6FA);
    background: rgba(255, 255, 255, 0.05);
  }

  .ks-producto__tab[aria-selected="true"] {
    color: #161004;
    background: linear-gradient(135deg, #FFE28A 0%, #F2C14E 100%);
    border-color: rgba(255, 244, 204, 0.6);
    box-shadow: 0 8px 22px rgba(242, 193, 78, 0.28);
  }

  .ks-producto__squircle {
    position: relative;
    border-radius: 28px;
    padding: clamp(1.35rem, 3.2vw, 2.5rem);
    background:
      radial-gradient(640px 380px at 18% 15%, rgba(242, 193, 78, 0.11), transparent 70%),
      radial-gradient(560px 360px at 86% 82%, rgba(45, 212, 191, 0.09), transparent 72%),
      linear-gradient(180deg, rgba(15, 22, 36, 0.94), rgba(8, 12, 22, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      0 28px 72px rgba(0, 0, 0, 0.52),
      0 1px 0 rgba(255, 255, 255, 0.08) inset;
  }

  .ks-producto__grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3.5vw, 3rem);
    align-items: center;
  }

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

  .ks-producto__subtabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 360px;
  }

  .ks-producto__subtab {
    position: relative;
    flex: 1 1 auto;
    min-width: 96px;
    padding: 0.52rem 0.75rem 0.64rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--ks-text-2, #A8B5C8);
    font-family: var(--ks-font-sans, "DM Sans", sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    text-align: center;
    transition:
      color 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease;
  }

  .ks-producto__subtab[aria-selected="true"] {
    color: var(--ks-text-1, #F4F6FA);
    border-color: rgba(242, 193, 78, 0.52);
    background: rgba(242, 193, 78, 0.13);
  }

  .ks-producto__subtab-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #F2C14E, #2DD4BF);
    transform-origin: left center;
    transform: scaleX(var(--ks-subtab-progress, 0));
    opacity: 0;
    transition: opacity 150ms ease;
  }

  .ks-producto__subtab[aria-selected="true"] .ks-producto__subtab-bar {
    opacity: 1;
  }

  .ks-producto__panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .ks-producto__panel[hidden] {
    display: none;
  }

  .ks-producto__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    align-self: flex-start;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: rgba(242, 193, 78, 0.14);
    border: 1px solid rgba(242, 193, 78, 0.34);
    color: var(--ks-gold-400, #F2C14E);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
  }

  .ks-producto__title {
    font-family: var(--ks-font-display, "Cinzel", serif);
    font-size: clamp(1.38rem, 2.4vw, 1.95rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ks-text-1, #F4F6FA);
    margin: 0;
  }

  .ks-producto__desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ks-text-2, #A8B5C8);
    margin: 0;
  }

  .ks-producto__points {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.65rem;
  }

  .ks-producto__points li {
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--ks-text-2, #A8B5C8);
  }

  .ks-producto__points li strong {
    display: block;
    color: var(--ks-text-1, #F4F6FA);
    font-weight: 700;
    margin-bottom: 0.18rem;
  }

  .ks-producto__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.35rem;
  }

  .ks-producto__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.11);
    border: 1px solid rgba(45, 212, 191, 0.32);
    color: var(--ks-teal-400, #2DD4BF);
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
  }

  .ks-producto__links a:hover {
    background: rgba(45, 212, 191, 0.2);
    border-color: rgba(45, 212, 191, 0.55);
  }

  @media (max-width: 900px) {
    .ks-producto__grid {
      grid-template-columns: 1fr;
    }

    .ks-producto__tablist {
      flex-wrap: nowrap;
      overflow-x: auto;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }

    .ks-producto__tablist::-webkit-scrollbar {
      display: none;
    }

    .ks-producto__tab {
      flex: 0 0 auto;
      white-space: nowrap;
    }
  }
}
