/* =========================================================
   MM CCTV — página Productos (/productos)
   Usa las variables y piezas de style.css; acá va solo lo propio.
   ========================================================= */

.shop { min-height: 60vh; padding-top: clamp(2.5rem, 5vw, 4rem); }
.shop__title { font-size: clamp(2rem, 5vw, 3.1rem); }
.shop .shead { margin-bottom: 2rem; }
.shop__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav__links > a.is-here:not(.btn) { color: #fff; }
.nav__links > a.is-here:not(.btn)::after { width: 100%; }

/* ---------------- buscador y categoría ---------------- */
.shop__tools { display: grid; grid-template-columns: 1fr minmax(0, 260px) minmax(0, 200px); gap: .8rem; margin-bottom: 1rem; }
.shop__search { position: relative; display: block; }
.shop__search .ico { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.shop__search input, .shop__cat select {
  width: 100%; min-height: 48px; background: #0d0d11; border: 1px solid var(--line-2);
  color: var(--txt); border-radius: 999px; padding: .7rem 1.1rem; font: inherit; font-size: .95rem;
  transition: border-color .18s, box-shadow .18s;
}
.shop__search input { padding-left: 2.7rem; }
.shop__cat { display: block; }
.shop__cat[hidden] { display: none; }
.shop__cat select { appearance: none; padding-right: 2.4rem; cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - .95rem) 50%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
.shop__cat select option { background: #15151b; color: var(--txt); }
.shop__search input:focus, .shop__cat select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 31, 38, .16); }

.shop__meta { color: var(--muted); font-size: .86rem; margin: 0 0 .4rem; }
.shop__status { color: var(--muted); font-size: .86rem; margin: 0 0 1.2rem; min-height: 1.2em; }
.shop__loading, .shop__closed { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.shop__closed p { max-width: 46ch; margin: 0 auto 1.2rem; }
.shop__empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2.5rem 0; }
.shop__empty button { margin-top: 1rem; }
.shop__more { display: flex; justify-content: center; margin-top: 1.8rem; }
/* .btn de style.css pone display: sin esto, el botón escondido se sigue viendo */
.shop__more .btn[hidden] { display: none; }

/* ---------------- tarjetas ---------------- */
.shop__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.shop__grid.is-stale { opacity: .55; }

.prod {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color .2s, box-shadow .2s;
}
.prod:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.prod.is-in { border-color: rgba(37, 211, 102, .45); }
.prod__media { position: relative; aspect-ratio: 4 / 3; background: #0e0e12; overflow: hidden; }
.prod__media img { width: 100%; height: 100%; object-fit: cover; }
/* sin foto propia: la ilustración del tipo de producto, entera y con su aclaración */
.prod__media--ill {
  background:
    radial-gradient(circle at 50% 46%, rgba(224, 31, 38, .13), transparent 64%),
    repeating-linear-gradient(45deg, #0f0f14 0 14px, #121218 14px 28px);
}
.prod__media img.prod__ill { object-fit: contain; padding: 6% 6% 11%; }
.prod__note {
  position: absolute; right: .55rem; bottom: .45rem; pointer-events: none;
  background: rgba(11, 11, 13, .66); border-radius: 999px; padding: .12rem .5rem;
  font-size: .66rem; letter-spacing: .02em; color: var(--muted); white-space: nowrap;
}
.prod__ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(224, 31, 38, .16), transparent 62%),
    repeating-linear-gradient(45deg, #0f0f14 0 14px, #121218 14px 28px);
}
.prod__ph svg { width: 54px; height: 54px; fill: rgba(224, 31, 38, .42); }
.prod__tag {
  position: absolute; left: .7rem; top: .7rem; background: rgba(224, 31, 38, .92);
  border-radius: 999px; padding: .22rem .7rem; font-size: .7rem; font-weight: 600; letter-spacing: .03em;
}
.prod__body { padding: 1.05rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.prod__cat { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.prod__brand { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); overflow-wrap: anywhere; }
.prod__name { font-family: var(--body); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-transform: none; margin: 0; overflow-wrap: anywhere; }
.prod__detail { font-size: .84rem; color: var(--muted); margin: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prod__code { font-size: .78rem; color: #8b8b96; margin: 0; overflow-wrap: anywhere; }
.prod__buy { margin-top: auto; padding-top: .8rem; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .7rem; }
.prod__price { display: grid; line-height: 1.15; }
.prod__price b { font-family: var(--head); font-size: 1.75rem; letter-spacing: .01em; }
.prod__price small { font-size: .74rem; color: var(--muted); }
.prod__add { padding: .65rem 1.1rem; min-height: 44px; }

/* sumar y restar: en la tarjeta y en Mi pedido */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .03); }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--txt); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.qty button:hover { background: var(--red-dim); }
.qty output { min-width: 2.2rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- Mi pedido: botón fijo ---------------- */
.cartbar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 75;
  display: inline-flex; align-items: center; gap: .7rem; max-width: calc(100vw - 28px);
  min-height: 54px; padding: .7rem 1.3rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--wa); color: #06240f; font: inherit; font-weight: 700; box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.cartbar[hidden] { display: none; }
.cartbar__count { background: #06240f; color: #fff; border-radius: 999px; min-width: 1.7rem; padding: .1rem .5rem; text-align: center; font-size: .86rem; }
.cartbar__total { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* con el pedido a la vista, el botón redondo de WhatsApp le deja el lugar y la página guarda aire abajo */
.shop-page.has-cart .wafab { display: none; }
.shop-page.has-cart .foot { padding-bottom: 76px; }

/* ---------------- Mi pedido: panel ---------------- */
.cart { position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .72); display: flex; justify-content: flex-end; }
.cart[hidden] { display: none; }
.cart__panel {
  width: min(460px, 100%); height: 100%; background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: var(--shadow); outline: none;
}
.cart__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.cart__head h2 { font-size: 1.6rem; margin: 0; }
.cart__x { width: 44px; height: 44px; background: none; border: 0; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.cart__x:hover { background: rgba(255, 255, 255, .08); }
.cart__body { flex: 1; overflow-y: auto; padding: .4rem 1.2rem; }
.cart__list { list-style: none; margin: 0; padding: 0; }
.cart__item { display: grid; grid-template-columns: 1fr auto; gap: .5rem .8rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.cart__name { font-weight: 600; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.cart__code { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.cart__unit { font-size: .84rem; color: var(--muted); }
.cart__sub { font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart__row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.cart__remove { background: none; border: 0; color: var(--muted); font: inherit; font-size: .84rem; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .3rem; }
.cart__remove:hover { color: var(--red-2); }
.cart__item.is-gone .cart__name { text-decoration: line-through; color: var(--muted); }
.cart__gone { grid-column: 1 / -1; font-size: .84rem; color: var(--red-2); margin: 0; }
.cart__empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.cart__foot { padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--line); background: #0c0c10; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 .3rem; }
.cart__total b { font-family: var(--head); font-size: 1.9rem; }
.cart__note { font-size: .8rem; color: var(--muted); margin: 0 0 .9rem; }
.cart__foot .btn--block { min-height: 52px; white-space: normal; text-align: center; }
.cart__foot .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.cart__clear[hidden], .cart__confirm[hidden] { display: none; }
.cart__confirm { margin: .8rem 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
.cart__confirm p { margin: 0 0 .5rem; }
.cart__confirm div { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.cart__confirm .btn { min-height: 44px; padding: .55rem 1.1rem; }
.cart__clear { display: block; margin: .6rem auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: .84rem; text-decoration: underline; cursor: pointer; min-height: 44px; }

@media (max-width: 760px) {
  .shop__tools { grid-template-columns: 1fr; }
  .shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .prod__body { padding: .8rem .8rem .9rem; }
  .prod__name { font-size: .92rem; }
  .prod__note { right: .4rem; bottom: .35rem; font-size: .62rem; }
  .prod__media img.prod__ill { padding: 5% 5% 15%; }
  .prod__price b { font-size: 1.45rem; }
  .prod__buy { flex-direction: column; align-items: stretch; }
  .prod__add { width: 100%; }
  .prod__buy .qty { justify-content: space-between; }
  .cartbar { bottom: 12px; width: calc(100vw - 24px); justify-content: center; }
}
@media (max-width: 380px) {
  .prod__detail { -webkit-line-clamp: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .prod { transition: none; }
}

/* ---------------- kits armados ---------------- */
.kits { margin-bottom: 2.2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.kits__title { font-family: var(--head); font-size: clamp(1.5rem, 3.4vw, 2rem); text-transform: uppercase; letter-spacing: .02em; margin: 0 0 .35rem; }
.kits__lead { color: var(--muted); margin: 0 0 1.1rem; max-width: 68ch; }
.kits__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.kits__note { margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }
.kits__note a { color: var(--wa); font-weight: 600; }
.kit { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); }
.kit__head { display: flex; gap: .9rem; align-items: center; }
.kit__img { flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: var(--card-2); border-radius: var(--radius-sm); }
.kit__img img, .kit__img svg { width: 48px; height: 48px; fill: var(--muted); }
.kit__name { font-size: 1.08rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.kit__desc { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.kit__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; color: #d4d4da; }
.kit__list li { overflow-wrap: anywhere; }
.kit__list b { color: var(--txt); }
.kit__install { margin: 0; font-size: .82rem; color: var(--muted); }
.kit__buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.kit__add { min-height: 44px; padding: .65rem 1.1rem; }
@media (max-width: 760px) {
  .kits__grid { grid-template-columns: 1fr; }
  .kit__add { width: 100%; }
}
