/* ===== Página Merchandising (usa styles.css como base) ===== */


/* ---------- HERO ---------- */
.m-hero {
  position: relative;
  display: flex; align-items: center;
  min-height: 640px;
  padding-top: 78px;
  background: var(--black) url("../images/merchandising/portadaMerchan.png") 70% center / cover no-repeat;
  overflow: hidden;
}
.m-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,.92) 0%, rgba(10,10,10,.75) 30%, rgba(10,10,10,.15) 55%, transparent 70%);
}
.m-hero-text {
  position: relative; z-index: 2;
  max-width: 600px;
  padding: 80px 40px 80px 60px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.m-eyebrow {
  font-size: 14px; font-weight: 600; letter-spacing: .12em;
  padding-bottom: 14px; margin-bottom: 26px;
  position: relative;
}
.m-eyebrow::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 3px; background: var(--orange);
}
.m-hero h1 {
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.m-hero h1 span { color: var(--orange); }
.m-hero-text p { font-size: 17px; color: #ccc; line-height: 1.55; max-width: 420px; margin-bottom: 34px; }

.m-stripe {
  position: absolute; top: 0; bottom: 0; right: 0; z-index: 1;
  width: 9%;
  background: var(--orange);
  clip-path: polygon(70% 0, 100% 0, 100% 100%, 0 100%);
}

/* ---------- BENEFICIOS ---------- */
.m-features {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #f7f5f2; color: var(--black);
  padding: 26px 40px;
}
.feat {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 16px;
  border-right: 1px solid #ddd;
  font-size: 15px; font-weight: 500; line-height: 1.25;
}
.feat:last-child { border-right: none; }
.feat svg {
  width: 40px; height: 40px; flex-shrink: 0;
  fill: none; stroke: var(--orange); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- CATEGORÍAS ---------- */
.m-cats { background: var(--white); color: var(--black); padding: 80px 60px; }
.m-title {
  text-align: center;
  font-size: clamp(28px, 3.2vw, 42px); font-weight: 800; letter-spacing: -.01em;
  margin-bottom: 50px; position: relative; padding-bottom: 16px;
}
.m-title::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 64px; height: 3px; background: var(--orange);
}
/* 5 categorías por renglón; las que sobran bajan centradas */
.cat-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; max-width: 1320px; margin: 0 auto; }
.cat-grid .cat { flex: 0 0 calc((100% - 18px * 4) / 5); }
.cat {
  border-radius: 12px; overflow: hidden;
  background: #f1f1f1;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.cat:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(0,0,0,.12); }
.cat-img { position: relative; aspect-ratio: 1 / .9; background: #ececec; padding: 22px 22px 34px; }
.cat-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: inherit; box-sizing: border-box;
  object-fit: contain; mix-blend-mode: multiply; transition: transform .4s;
}

/* Varias fotos de gorros traen fondo gris: se difuminan los bordes */
img[src*="/gorros/"] {
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at center, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at center, #000 60%, transparent 100%);
}
.cat:hover .cat-img img { transform: scale(1.06); }
.cat-label {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  margin: -18px 10px 10px; padding: 14px 10px;
  border-radius: 10px; position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  font-size: 14px; font-weight: 500; line-height: 1.2;
}
.cat-label svg {
  width: 30px; height: 30px; flex-shrink: 0;
  fill: none; stroke: var(--orange); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.cat-label span { flex: 1; }
.cat-label i {
  font-style: normal; font-weight: 700;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--orange); color: var(--white);
  display: grid; place-items: center; font-size: 14px;
  transition: transform .25s;
}
.cat:hover .cat-label i { transform: translateX(3px); }

/* Productos: fondo blanco en este sitio */
#productos .card-img { background: #f1f1f1; }
#productos .card-img img { mix-blend-mode: multiply; }

/* ---------- CTA ---------- */
.m-cta-wrap { background: var(--light); padding: 0 60px 90px; }
.m-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  background:
    linear-gradient(110deg, transparent 70%, rgba(241,90,31,.25) 70% 72%, transparent 72%),
    #1a1a1a;
  color: var(--white);
  border-radius: 14px;
  padding: 44px 50px;
}
.m-cta-text { border-left: 3px solid var(--orange); padding-left: 26px; }
.m-cta h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; line-height: 1.15; margin-bottom: 10px; }
.m-cta p { color: #bbb; font-size: 15px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .m-features { grid-template-columns: repeat(2, 1fr); gap: 14px 0; }
  .feat:nth-child(2) { border-right: none; }
  /* tablet y celular: categorías en una fila deslizable */
  .cat-grid { flex-wrap: nowrap; justify-content: flex-start; gap: 12px; overflow-x: auto; padding: 8px 2px 14px; scrollbar-width: none; }
  .cat-grid::-webkit-scrollbar { display: none; }
  .cat-grid .cat { flex: 0 0 26%; }

}

@media (max-width: 820px) {
  .m-hero { padding-top: 64px; }
  .m-hero-text { padding: 50px 16px 40px; }
  .m-hero { min-height: 560px; align-items: flex-end; background-position: 62% center; }
  .m-hero::before { background: linear-gradient(0deg, rgba(10,10,10,.95) 25%, rgba(10,10,10,.4) 65%, rgba(10,10,10,.2) 100%); }
  .m-stripe { width: 14%; }
  .m-features { padding: 20px 8px; }
  .feat { justify-content: flex-start; gap: 10px; font-size: 13px; padding: 8px; }
  .feat svg { width: 30px; height: 30px; }
  .m-cats { padding: 60px 16px; }
  /* una al lado de la otra: fila deslizable */
  .cat-grid .cat { flex-basis: 42%; }
  .cat-img { padding: 10px 10px 22px; }
  .cat-label { font-size: 13px; gap: 8px; padding: 10px; }
  .cat-label svg { width: 22px; height: 22px; }
  .m-cta-wrap { padding: 0 16px 60px; }
  .m-cta { padding: 30px 22px; }
}

@media (max-width: 480px) {
  .feat { flex-direction: column; text-align: center; border-right: none; }
  .cat-label { margin: -14px 6px 6px; padding: 8px; font-size: 12px; }
  .cat-label svg { display: none; }
  .cat-label i { width: 22px; height: 22px; font-size: 12px; }
}


/* ---------- NUESTROS CLIENTES ---------- */
.m-clients {
  background: var(--black);
  padding: 90px 60px;
  position: relative; overflow: hidden;
}
.m-clients::before { /* franja naranja diagonal de fondo */
  content: ""; position: absolute; top: 0; right: -60px; bottom: 0; width: 140px;
  background: var(--orange); opacity: .9;
  clip-path: polygon(60% 0, 100% 0, 100% 100%, 0 100%);
}
.m-clients-head { position: relative; max-width: 620px; margin-bottom: 44px; }
.m-clients-head .m-eyebrow { display: inline-block; }
.client-img img.zoom { transform: scale(1.6); }
.client:hover .client-img img.zoom { transform: scale(1.7); }
.m-clients-head h2 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.m-clients-head p { color: #aaa; font-size: 16px; line-height: 1.55; }

.clients-grid {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
}
/* 5 clientes por renglón; los que sobran bajan centrados */
.clients-grid .client { flex: 0 0 calc((100% - 18px * 4) / 5); }
.client {
  margin: 0;
  background: #1b1b1b;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.client:hover { transform: translateY(-6px); border-color: var(--orange); }
.client-img { aspect-ratio: 1; background: #f3f3f3; padding: 16px; }
.client-img img {
  width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply; transition: transform .5s;
}
.client:hover .client-img img { transform: scale(1.07); }
.client figcaption { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.client strong { font-size: 15px; font-weight: 700; }
.client span { font-size: 12px; color: var(--grey-light); }

@media (max-width: 1100px) {
  .clients-grid .client { flex-basis: calc((100% - 18px * 2) / 3); }
}
@media (max-width: 820px) {
  .m-clients { padding: 64px 16px; }
  .m-clients::before { width: 70px; right: -30px; }
  /* en celular: fila deslizable */
  .clients-grid {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 12px;
    scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px;
  }
  .clients-grid::-webkit-scrollbar { display: none; }
  .clients-grid .client { flex: 0 0 62%; scroll-snap-align: start; }
}
/* ---------- CARRUSELES DE PRODUCTOS (uno por categoría) ---------- */
#productos .products { display: block; }
.carousel { margin-bottom: 48px; }
.carousel:last-child { margin-bottom: 0; }
.carousel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
}
.carousel-head h3 {
  font-size: 22px; font-weight: 800; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.carousel-head h3::before {
  content: ""; width: 6px; height: 22px; background: var(--orange);
}
.carousel-head h3 span {
  font-size: 12px; font-weight: 700; color: var(--white);
  background: var(--black); padding: 3px 8px; border-radius: 20px;
}
.carousel-nav { display: flex; gap: 8px; }
.c-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid #ccc; background: var(--white); color: var(--black);
  font-size: 24px; line-height: 1; display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.c-btn:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); color: var(--white); }
.c-btn:disabled { opacity: .3; cursor: default; }
.carousel.no-scroll .carousel-nav { visibility: hidden; }

.carousel-track {
  display: flex; gap: 18px;
  overflow-x: auto;

  scroll-behavior: auto;
  padding: 4px 2px 18px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .card {
  flex: 0 0 calc((100% - 18px * 4) / 5);

}

@media (max-width: 1100px) {
  .carousel-track .card { flex-basis: calc((100% - 18px * 2) / 3); }
}
@media (max-width: 820px) {
  .carousel-track { gap: 12px; }
  .carousel-track .card { flex-basis: 62%; }
  .carousel-head h3 { font-size: 18px; }
  .c-btn { width: 36px; height: 36px; font-size: 20px; }
}

/* Fotos con fondo propio */
#productos .card-img.con-fondo img { mix-blend-mode: normal; }
.client-img:has(img.con-fondo) { padding: 0; overflow: hidden; }
.client-img img.con-fondo { object-fit: cover; mix-blend-mode: normal; }

/* Nuestros clientes con pocas tarjetas (Ropa de trabajo): texto a la izquierda, tarjetas a la derecha */
@media (min-width: 821px) {
  .m-clients-pocos { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; }
  .m-clients-pocos .m-clients-head { margin-bottom: 0; }
  .m-clients-pocos .clients-grid { justify-content: flex-start; }
  .m-clients-pocos .clients-grid .client { flex: 0 1 340px; }
}

/* ---------- NUESTROS CLIENTES: CARRUSEL 3D ---------- */
.clients-grid.clients-3d {
  display: block; overflow: visible; padding: 0;
  height: 440px;
  perspective: 1400px;
  touch-action: pan-y;
  --ancho: 300px;
}
.clients-grid.clients-3d .client {
  position: absolute; left: 50%; top: 10px;
  width: var(--ancho); margin-left: calc(var(--ancho) / -2);
  cursor: pointer; user-select: none;
  transform: translateX(var(--x, 0)) rotateY(var(--giro, 0deg)) scale(var(--zoom, 1));
  /* la curva pasa de largo y vuelve: da el rebote */
  transition: transform .85s cubic-bezier(.34, 1.45, .5, 1), opacity .6s, filter .6s, border-color .3s;
}
.clients-grid.clients-3d .client.sin-transicion { transition: none; }
.clients-grid.clients-3d .client.activo {
  border-color: var(--orange);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(241, 90, 31, .25);
}
.clients-3d .client img { -webkit-user-drag: none; }
.clients-3d .client.activo .client-img { overflow: hidden; }
.clients-3d .client.activo .client-img img { animation: clienteRebote 1s cubic-bezier(.34, 1.45, .5, 1); }
.clients-3d .client.activo .client-img img.zoom { animation-name: clienteReboteZoom; }
@keyframes clienteRebote {
  0% { transform: scale(.7) rotate(-10deg); }
  45% { transform: scale(1.12) rotate(5deg); }
  70% { transform: scale(.97) rotate(-2deg); }
  100% { transform: none; }
}
@keyframes clienteReboteZoom {
  0% { transform: scale(1.1) rotate(-10deg); }
  45% { transform: scale(1.75) rotate(5deg); }
  70% { transform: scale(1.55) rotate(-2deg); }
  100% { transform: scale(1.6); }
}
.clients-dots { position: relative; display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.clients-dots button { width: 24px; height: 24px; padding: 0; border: none; background: none; display: grid; place-items: center; }
.clients-dots button::before {
  content: ""; width: 9px; height: 9px; border-radius: 9px; background: #555;
  transition: width .3s, background .3s;
}
.clients-dots button.activo::before { width: 22px; background: var(--orange); }

@media (max-width: 820px) {
  .clients-grid.clients-3d { height: 360px; --ancho: 220px; }
}
