/* Secciones de productos de la home */

.gd-secciones { box-sizing: border-box; width: 100%; padding: 0 clamp(16px, 4.5vw, 90px) 48px; color: #1c1d21; scroll-margin-top: 130px; }
.gd-secciones *, .gd-secciones *::before { box-sizing: border-box; }
.gd-secciones [hidden] { display: none !important; }
.gd-secciones__oculto { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }

/* Pestañas: en móvil se deslizan en horizontal */
.gd-secciones__pestanas { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 32px; margin-bottom: 28px; border-bottom: 1px solid #e4e5e9; }
.gd-secciones__pestana { margin-bottom: -1px; padding: 8px 2px 12px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #6c6f78; font-family: inherit; font-size: clamp(20px, 2vw, 26px); font-weight: 500; line-height: 1.25; cursor: pointer; transition: border-color .2s, color .2s; }
.gd-secciones__pestana:hover { color: #1c1d21; }
.gd-secciones__pestana.is-activa { border-bottom-color: #f75900; color: #1c1d21; }
.gd-secciones__pestana:focus-visible, .gd-secciones__reintentar:focus-visible, .gd-seccion-ficha a:focus-visible, .gd-seccion-ficha button:focus-visible { outline: 2px solid #1c1d21; outline-offset: 2px; }

/* Línea final: la misma que hay bajo los títulos */
.gd-secciones::after { content: ""; display: block; margin-top: 28px; border-bottom: 1px solid #e4e5e9; }

.gd-secciones__rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.gd-secciones__hueco { aspect-ratio: 3 / 4; border-radius: 14px; background: linear-gradient(100deg, #f3f4f6 30%, #fafafb 50%, #f3f4f6 70%); background-size: 200% 100%; animation: gd-secciones-brillo 1.4s linear infinite; }
/* Máximo inicial: 8 en ordenador y 4 en móvil. Con esto no se ven de más mientras carga el JS. */
.gd-secciones__rejilla:not([data-gds-listo]) > .gd-seccion-ficha:nth-child(n+9) { display: none; }

.gd-secciones__mas { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 28px; }
.gd-secciones__vermas { padding: 10px 30px; border: 1px solid #f75900; border-radius: 30px; background: #fff; color: #f75900; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; cursor: pointer; transition: background-color .2s, color .2s; }
.gd-secciones__vermas:hover { background: #f75900; color: #fff; }
.gd-secciones__vermas:focus-visible { outline: 2px solid #1c1d21; outline-offset: 2px; }

@keyframes gd-secciones-brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .gd-secciones__hueco { animation: none; } }

.gd-secciones__error { padding: 32px 16px; text-align: center; }
.gd-secciones__error p { margin: 0 0 12px; color: #1c1d21; font-size: 15px; }
.gd-secciones__reintentar { padding: 9px 24px; border: 1px solid #f75900; border-radius: 30px; background: #fff; color: #f75900; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.gd-secciones__reintentar:hover { background: #f75900; color: #fff; }

/* Ficha */
.gd-seccion-ficha { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #e4e5e9; border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.gd-seccion-ficha:hover { border-color: #d5d6da; box-shadow: 0 10px 24px rgba(0, 0, 0, .08); transform: translateY(-3px); }
.gd-seccion-ficha__foto { display: flex; align-items: center; justify-content: center; padding: 16px; background: #fff; }
.gd-seccion-ficha__foto img { display: block; width: auto; max-width: 100%; height: auto; max-height: 260px; transition: transform .25s ease; }
.gd-seccion-ficha:hover .gd-seccion-ficha__foto img { transform: scale(1.03); }
.gd-seccion-ficha__cuerpo { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; padding: 4px 16px 16px; }
.gd-seccion-ficha__marca { margin: 0; color: #6c6f78; font-size: 12px; font-weight: 500; letter-spacing: .02em; line-height: 1.3; text-transform: uppercase; }
.gd-seccion-ficha__nombre { margin: 0; color: #1c1d21; font-size: 17px; font-weight: 500; line-height: 1.35; text-transform: none; }
.gd-seccion-ficha__nombre a { display: -webkit-box; overflow: hidden; color: #1c1d21 !important; text-decoration: none !important; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.gd-seccion-ficha__nombre a:hover { color: #f75900 !important; }

/* Fila de compra (con sesión): igual que la ficha de gdpages */
.gd-seccion-ficha__compra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
.gd-seccion-ficha__precio { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0; }
.gd-seccion-ficha__precio strong { color: #e67e22; font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.gd-seccion-ficha__precio s { color: #6c6f78; font-size: 13px; }
.gd-seccion-ficha__form { display: flex; flex: none; align-items: center; gap: 10px; margin: 0 0 0 auto; }
.gd-seccion-ficha__cantidad { display: flex; align-items: center; overflow: hidden; border: 1px solid #ddd; border-radius: 4px; }
.gd-seccion-ficha__cantidad button { width: 28px; height: 32px; padding: 0; border: 0; border-radius: 0; background: #fff; color: #555; font-family: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.gd-seccion-ficha__cantidad button:hover { background: #f5f5f5; }
.gd-seccion-ficha__cantidad input { width: 34px; height: 32px; margin: 0; padding: 0; border: 0; border-right: 1px solid #ddd; border-left: 1px solid #ddd; border-radius: 0; background: #fff; color: #1c1d21; font-family: inherit; font-size: 14px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.gd-seccion-ficha__cantidad input:focus { outline: 0; background: #fffaf6; }
.gd-seccion-ficha__cantidad input::-webkit-outer-spin-button, .gd-seccion-ficha__cantidad input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.gd-seccion-ficha__carrito { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; min-width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #f75900; color: #fff; cursor: pointer; font-size: 15px; transition: background-color .2s; }
.gd-seccion-ficha__carrito:hover { background: #d94e00; }

/* Solo 4 o 2 columnas: así cada «Ver más» (4 productos) completa filas enteras. */
@media (max-width: 900px) { .gd-secciones__rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .gd-secciones__rejilla:not([data-gds-listo]) > .gd-seccion-ficha:nth-child(n+5), .gd-secciones__hueco:nth-child(n+5) { display: none; }
  .gd-secciones__rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gd-secciones__pestanas { flex-wrap: nowrap; justify-content: safe center; gap: 24px; margin-right: -16px; margin-bottom: 20px; margin-left: -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .gd-secciones__pestana { flex: none; padding: 6px 2px 10px; font-size: 19px; white-space: nowrap; }
  .gd-secciones::after { margin: 20px -16px 0; }
  .gd-seccion-ficha__foto { padding: 10px; }
  .gd-seccion-ficha__foto img { max-height: 180px; }
  .gd-seccion-ficha__cuerpo { padding: 2px 10px 12px; }
  .gd-seccion-ficha__nombre { font-size: 15px; }
}
