/*
 * GB Estepona 0.3.1 — ritmo comercial, superficies y herramientas.
 * Capa posterior al sistema comercial V1; no depende del CSS adicional del sitio.
 */

:root {
  --gb-rhythm-bg: var(--gb-color-canvas, #f7f8f6);
  --gb-rhythm-alt: var(--gb-color-mint-muted, #eef3ee);
  --gb-rhythm-surface: var(--gb-color-surface-raised, #fbfcf9);
  --gb-rhythm-deep: var(--gb-color-structure-soft, #173f35);
  --gb-rhythm-deep-alt: var(--gb-color-structure-alt, #1d4b3e);
  --gb-rhythm-green: var(--gb-color-accent, #19c37d);
  --gb-rhythm-ink: var(--gb-color-ink, #10211b);
  --gb-rhythm-muted: var(--gb-color-muted, #52665d);
  --gb-rhythm-line: var(--gb-color-border, #dfe7e2);
  --gb-rhythm-shadow: 0 12px 36px rgba(23, 63, 53, .11);
}

body {
  background:
    radial-gradient(circle at 9% 2%, rgba(25, 195, 125, .055), transparent 30rem),
    var(--gb-rhythm-bg);
  color: var(--gb-rhythm-ink);
}

.gb-premium-home {
  background: var(--gb-rhythm-bg);
}

.gb-premium-home > .gb-commerce-section {
  border: 0;
  box-sizing: border-box;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

.gb-premium-home > .gb-category-showcase,
.gb-premium-home > .gb-editorial-new,
.gb-premium-home > .gb-premium-brands {
  background: var(--gb-rhythm-alt);
}

.gb-premium-home > .gb-product-carousel,
.gb-premium-home > .gb-tools,
.gb-premium-home > .gb-recommendations,
.gb-premium-home > .gb-guide-section {
  background: var(--gb-rhythm-bg);
}

.gb-premium-home > .gb-advantages-section,
.gb-premium-home > .gb-cbd-information {
  background: color-mix(in srgb, var(--gb-rhythm-alt), var(--gb-rhythm-surface) 45%);
}

.gb-store-visit {
  background: var(--gb-rhythm-surface);
}

/* El parche remoto temporal deja de ser necesario: centrado sin transformación. */
.gb-premium-slider__controls {
  bottom: clamp(.8rem, 2vw, 1.4rem);
  justify-content: center;
  left: 0;
  pointer-events: none;
  right: 0;
  transform: none;
}

.gb-premium-slider__controls > * {
  pointer-events: auto;
}

.gb-premium-slider {
  background: var(--gb-rhythm-deep);
}

.gb-premium-slide::after {
  background:
    linear-gradient(90deg, rgba(23, 63, 53, .94) 0%, rgba(23, 63, 53, .76) 40%, rgba(23, 63, 53, .1) 76%),
    linear-gradient(0deg, rgba(23, 63, 53, .26), transparent 58%);
}

.gb-premium-slide--light::after {
  background:
    linear-gradient(90deg, rgba(243, 244, 239, .97) 0%, rgba(243, 244, 239, .82) 42%, rgba(243, 244, 239, .1) 78%),
    linear-gradient(0deg, rgba(238, 243, 238, .22), transparent 58%);
}

/* Destacados: cuatro tarjetas legibles y flechas pegadas al carrusel. */
.gb-product-carousel__viewport {
  position: relative;
}

.gb-product-carousel .gb-product-track {
  gap: clamp(.85rem, 1.6vw, 1.25rem);
  grid-auto-columns: calc((100% - 3.75rem) / 4);
  padding: .3rem 3.25rem 1.2rem;
  scroll-padding-inline: 3.25rem;
}

.gb-carousel-side {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(251, 252, 249, .9);
  border: 1px solid rgba(23, 63, 53, .16);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(23, 63, 53, .16);
  color: var(--gb-rhythm-deep);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.15rem;
  height: 46px;
  justify-content: center;
  min-height: 46px;
  min-width: 46px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  z-index: 4;
}

.gb-carousel-side--prev {
  left: .1rem;
}

.gb-carousel-side--next {
  right: .1rem;
}

.gb-carousel-side:disabled {
  cursor: default;
  opacity: .34;
}

.gb-carousel-side:focus-visible,
.gb-recommendations__tabs button:focus-visible,
.gb-lighting-calculator input:focus-visible,
.gb-lighting-calculator select:focus-visible,
.gb-lighting-calculator button:focus-visible,
.gb-tools a:focus-visible,
.gb-cbd-information a:focus-visible,
.gb-quick-help__whatsapp:focus-visible {
  outline: 3px solid #8be7b9;
  outline-offset: 3px;
}

/* Ventajas compactas. */
.gb-advantages-section .gb-advantages {
  background: transparent;
  border: 1px solid var(--gb-rhythm-line);
  border-radius: 18px;
  box-shadow: none;
  gap: 0;
  overflow: hidden;
}

.gb-advantages-section .gb-advantages article {
  background: var(--gb-rhythm-surface);
  min-height: 104px;
  padding: 1rem;
}

.gb-advantages-section .gb-advantages article + article {
  border-left: 1px solid var(--gb-rhythm-line);
}

.gb-advantages-section .gb-advantages article > span {
  background: #dff6e9;
  color: #0b7048;
}

/* Herramientas y motor de reglas. */
.gb-tools__layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
}

.gb-lighting-calculator {
  background: var(--gb-rhythm-deep-alt);
  border-radius: 24px;
  color: #fff;
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.gb-lighting-calculator h3,
.gb-lighting-calculator p {
  color: inherit;
  margin: .2rem 0 0;
}

.gb-tool-icon {
  align-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.gb-lighting-calculator__fields {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gb-lighting-calculator label {
  color: #fff;
  display: grid;
  font-size: .8rem;
  font-weight: 750;
  gap: .35rem;
}

.gb-lighting-calculator input,
.gb-lighting-calculator select {
  background: var(--gb-rhythm-surface);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--gb-rhythm-ink);
  min-height: 46px;
  padding: .65rem .7rem;
  width: 100%;
}

.gb-lighting-calculator > button {
  background: var(--gb-rhythm-green);
  border: 0;
  border-radius: 999px;
  color: #092a20;
  cursor: pointer;
  font-weight: 850;
  justify-self: start;
  min-height: 46px;
  padding: .7rem 1.2rem;
}

.gb-lighting-calculator__result {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  font-weight: 700;
  min-height: 1.5rem;
  padding: .8rem;
}

.gb-tool-disclaimer {
  font-size: .76rem;
  opacity: .88;
}

.gb-tools__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.gb-tools__actions a {
  color: #fff;
  font-weight: 800;
  min-height: 44px;
}

.gb-tools__guides {
  display: grid;
  gap: .7rem;
}

.gb-tools__guides article {
  align-items: start;
  background: var(--gb-rhythm-surface);
  border: 1px solid var(--gb-rhythm-line);
  border-radius: 16px;
  display: grid;
  gap: .8rem;
  grid-template-columns: 38px 1fr;
  padding: 1rem;
}

.gb-tools__guides article > span {
  align-items: center;
  background: #e4f6eb;
  border-radius: 10px;
  color: #0b7048;
  display: flex;
  height: 38px;
  justify-content: center;
}

.gb-tools__guides h3,
.gb-tools__guides p {
  margin: 0 0 .3rem;
}

.gb-tools__guides p {
  color: var(--gb-rhythm-muted);
  font-size: .82rem;
  line-height: 1.45;
}

.gb-tools__guides a {
  color: #0b7048;
  font-size: .8rem;
  font-weight: 800;
}

/* Novedades: mosaico editorial, no carrusel ni tarjeta de conversión. */
.gb-editorial-new__grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gb-editorial-new__card {
  background: var(--gb-rhythm-surface);
  border: 1px solid var(--gb-rhythm-line);
  border-radius: 17px;
  overflow: hidden;
}

.gb-editorial-new__card > a {
  color: var(--gb-rhythm-ink);
  display: grid;
  grid-template-columns: minmax(112px, 38%) 1fr;
  height: 100%;
  text-decoration: none;
}

.gb-editorial-new__card img {
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  width: 100%;
}

.gb-editorial-new__card > a > div {
  align-content: center;
  display: grid;
  padding: .9rem;
}

.gb-editorial-new__card h3 {
  display: -webkit-box;
  font-size: 1rem;
  line-height: 1.25;
  margin: .25rem 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gb-editorial-new__card p {
  color: var(--gb-rhythm-muted);
  display: -webkit-box;
  font-size: .78rem;
  line-height: 1.45;
  margin: .2rem 0 .65rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.gb-editorial-new__discover {
  color: #0b7048;
  font-size: .78rem;
  font-weight: 850;
}

/* CBD informativo: navegación y explicación, nunca otro carrusel. */
.gb-cbd-information {
  align-items: stretch;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
}

.gb-cbd-information__copy {
  align-content: center;
  display: grid;
  padding: clamp(1rem, 3vw, 2rem);
}

.gb-cbd-information__copy h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  margin: .3rem 0;
}

.gb-cbd-information__copy > p:not(.gb-kicker) {
  color: var(--gb-rhythm-muted);
  line-height: 1.65;
}

.gb-cbd-information nav {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .7rem;
}

.gb-cbd-information nav a {
  background: var(--gb-rhythm-surface);
  border: 1px solid var(--gb-rhythm-line);
  border-radius: 999px;
  color: #0b7048;
  font-size: .82rem;
  font-weight: 800;
  min-height: 42px;
  padding: .65rem .9rem;
  text-decoration: none;
}

.gb-cbd-information__media {
  align-items: center;
  background: linear-gradient(145deg, #d7efe1, #bfe5cf);
  border-radius: 22px;
  display: flex;
  justify-content: center;
  min-height: 290px;
  overflow: hidden;
}

.gb-cbd-information__media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.gb-cbd-information__media > span {
  color: rgba(23, 63, 53, .42);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: -.08em;
}

/* Único módulo de recomendaciones. */
.gb-recommendations {
  background: var(--gb-rhythm-bg);
}

.gb-recommendations__tabs {
  background: #e3ebe4;
  border: 1px solid var(--gb-rhythm-line);
  border-radius: 999px;
  display: inline-flex;
  gap: .25rem;
  margin-bottom: 1rem;
  padding: .3rem;
}

.gb-recommendations__tabs button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--gb-rhythm-deep);
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: .65rem 1rem;
}

.gb-recommendations__tabs button[aria-selected="true"] {
  background: var(--gb-rhythm-deep-alt);
  color: #fff;
}

.gb-recommendations__panel[hidden] {
  display: none;
}

.gb-recommendations__intro {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: .8rem;
}

.gb-recommendations__intro h3,
.gb-recommendations__intro p {
  margin: 0;
}

.gb-recommendations__intro p {
  color: var(--gb-rhythm-muted);
  margin-top: .25rem;
}

.gb-recommendations__intro > a {
  color: #0b7048;
  font-size: .82rem;
  font-weight: 850;
  min-height: 44px;
}

.gb-recommendations__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gb-recommendations__grid .gb-premium-product-card {
  min-width: 0;
}

.gb-quick-help__whatsapp {
  background: #e4f6eb;
  border-color: #9fd8b9;
}

@media (max-width: 1279px) {
  .gb-product-carousel .gb-product-track {
    grid-auto-columns: calc((100% - 2rem) / 3);
  }
}

@media (max-width: 900px) {
  .gb-product-carousel .gb-product-track {
    grid-auto-columns: calc((100% - 1rem) / 2);
  }
  .gb-tools__layout,
  .gb-cbd-information {
    grid-template-columns: 1fr;
  }
  .gb-editorial-new__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gb-recommendations__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gb-advantages-section .gb-advantages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gb-advantages-section .gb-advantages article:nth-child(3) {
    border-left: 0;
  }
  .gb-advantages-section .gb-advantages article:nth-child(n+3) {
    border-top: 1px solid var(--gb-rhythm-line);
  }
}

@media (max-width: 767px) {
  .gb-premium-slide::after,
  .gb-premium-slide--light::after {
    background: linear-gradient(0deg, rgba(23,63,53,.97) 0%, rgba(23,63,53,.8) 60%, rgba(23,63,53,.12) 100%);
  }
  .gb-premium-slider__controls {
    left: 0;
    right: 0;
  }
  .gb-product-carousel .gb-product-track {
    grid-auto-columns: min(84%, 306px);
    margin-right: 0;
    padding-inline: .25rem 18%;
    scroll-padding-inline: .25rem;
  }
  .gb-carousel-side {
    display: none;
  }
  .gb-lighting-calculator__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gb-lighting-calculator__fields label:last-child {
    grid-column: 1 / -1;
  }
  .gb-editorial-new__card > a {
    grid-template-columns: 92px 1fr;
  }
  .gb-editorial-new__card img {
    min-height: 154px;
  }
  .gb-editorial-new__card > a > div {
    padding: .75rem;
  }
  .gb-editorial-new__card p {
    -webkit-line-clamp: 2;
  }
  .gb-recommendations__tabs {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
  .gb-recommendations__tabs button {
    padding-inline: .45rem;
  }
  .gb-recommendations__intro {
    align-items: start;
    display: grid;
  }
  .gb-recommendations__grid {
    gap: .65rem;
  }
  .gb-recommendations__grid .gb-premium-product-card__body {
    padding: .7rem;
  }
  .gb-recommendations__grid .gb-premium-product-card h3 {
    font-size: .88rem;
  }
  .gb-recommendations__grid .gb-product-card-action {
    font-size: .7rem;
    padding-inline: .4rem;
  }
  .gb-cbd-information__media {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  .gb-editorial-new__grid {
    gap: .65rem;
  }
  .gb-editorial-new__card > a {
    grid-template-columns: 1fr;
  }
  .gb-editorial-new__card img {
    aspect-ratio: 1.45 / 1;
    min-height: 0;
  }
  .gb-lighting-calculator__fields {
    grid-template-columns: 1fr;
  }
  .gb-lighting-calculator__fields label:last-child {
    grid-column: auto;
  }
}

@media (max-width: 359px) {
  .gb-editorial-new__grid,
  .gb-recommendations__grid {
    grid-template-columns: 1fr;
  }
}

/* Novedades comerciales: más variedad visible y tarjetas sin altura artificial. */
.gb-product-carousel--new-arrivals {
  padding-block: clamp(1.8rem, 3.5vw, 3rem);
}

.gb-product-carousel--new-arrivals .gb-section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.gb-product-carousel--new-arrivals .gb-product-track {
  align-items: start;
  grid-auto-columns: calc((100% - 4.25rem) / 6);
}

.gb-product-carousel--new-arrivals .gb-premium-product-card {
  align-self: start;
  height: auto;
  min-height: 0;
}

.gb-product-carousel--new-arrivals .gb-premium-product-card__media {
  aspect-ratio: 1 / .78;
  min-height: 0;
}

.gb-product-carousel--new-arrivals .gb-premium-product-card__media img {
  object-fit: contain;
}

.gb-product-carousel--new-arrivals .gb-premium-product-card__body {
  flex: 0 0 auto;
  gap: .3rem;
  min-height: 188px;
  padding: .72rem;
}

.gb-product-carousel--new-arrivals .gb-premium-product-card h3 {
  font-size: .88rem;
}

.gb-product-carousel--new-arrivals .gb-product-price {
  font-size: 1.05rem;
  margin-top: .2rem;
}

.gb-product-carousel--new-arrivals .gb-product-availability {
  display: -webkit-box;
  line-height: 1.25;
  min-height: 2.5em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gb-product-carousel--new-arrivals .gb-product-card__action-row {
  margin-top: .25rem;
  padding-top: .5rem;
}

.gb-product-carousel--new-arrivals .gb-product-card-action {
  min-height: 38px;
  padding-block: .48rem;
}

@media (max-width: 1279px) {
  .gb-product-carousel--new-arrivals .gb-product-track {
    grid-auto-columns: calc((100% - 3rem) / 4);
  }
}

@media (max-width: 900px) {
  .gb-product-carousel--new-arrivals .gb-product-track {
    grid-auto-columns: calc((100% - 1.3rem) / 3);
  }
}

@media (max-width: 767px) {
  .gb-product-carousel--new-arrivals .gb-product-track {
    gap: .65rem;
    grid-auto-columns: calc((100% - .65rem) / 2);
    padding-inline: .2rem;
    scroll-padding-inline: .2rem;
  }

  .gb-product-carousel--new-arrivals .gb-premium-product-card__body {
    min-height: 178px;
    padding: .62rem;
  }

  .gb-product-carousel--new-arrivals .gb-product-brand {
    font-size: .6rem;
  }

  .gb-product-carousel--new-arrivals .gb-premium-product-card h3 {
    font-size: .8rem;
  }

  .gb-product-carousel--new-arrivals .gb-product-card-action {
    font-size: .68rem;
    padding-inline: .35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gb-carousel-side,
  .gb-recommendations__tabs button {
    transition: none;
  }
}
