/* ==========================================================================
   INSTRUMENTAL QUIRÚRGICO — Catálogo de Productos
   Diseño "Quirúrgico": limpio, minimalista, alta gama
   Accent: Gris Acero / Azul Metálico #546e7a
   ========================================================================== */

/* ==========================================================================
   0. RESET & VARIABLES LOCALES
   ========================================================================== */

:root {
  --header-height: 72px;   /* ← Mide tu header y ajusta */
  --steel-900: #263238;
  --steel-800: #37474f;
  --steel-700: #455a64;
  --steel-600: #546e7a;
  --steel-500: #607d8b;
  --steel-400: #78909c;
  --steel-300: #90a4ae;
  --steel-200: #b0bec5;
  --steel-100: #cfd8dc;
  --steel-50:  #eceff1;
  --steel-25:  #f5f7f8;
  --gold-accent: #c9a84c;
  --gold-soft: rgba(201, 168, 76, 0.1);
  --gold-border: rgba(201, 168, 76, 0.25);
}

/* ==========================================================================
   1. HERO — Dark Surgical
   ========================================================================== */

.inst-hero {
  position: relative;
  padding: 80px 24px 64px;
  background: linear-gradient(145deg, var(--steel-900) 0%, var(--steel-800) 45%, var(--steel-700) 100%);
  overflow: hidden;
  text-align: center;
}

/* Subtle grid pattern */
.inst-hero__grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Decorative crosshair */
.inst-hero::before {
  content: '';
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.inst-hero::after {
  content: '';
  position: absolute;
  right: 79px;
  top: calc(50% - 160px);
  width: 1px;
  height: 320px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.04), transparent);
  pointer-events: none;
}

.inst-hero__content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.inst-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel-200);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  margin-bottom: 24px;
}

.inst-hero__badge i {
  font-size: 10px;
  color: var(--steel-400);
}

.inst-hero__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.inst-hero__subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(14px, 2.2vw, 16px);
  font-weight: 400;
  color: var(--steel-300);
  line-height: 1.65;
  margin: 0 0 40px;
}

.inst-hero__stats {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.inst-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.inst-hero__stat strong {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.inst-hero__stat span {
  font-size: 11px;
  font-weight: 500;
  color: var(--steel-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inst-hero__stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.1);
}

@media (min-width: 768px) {
  .inst-hero {
    padding: 100px 32px 80px;
  }
  .inst-hero::before {
    right: 40px;
    width: 340px;
    height: 340px;
  }
  .inst-hero::after {
    right: calc(40px + 169px);
  }
}


/* ==========================================================================
   2. FILTROS — Sticky Frosted Bar
   ========================================================================== */

/* ── NUEVO: Anclar el header por encima de los filtros ── */
.header {
  position: sticky;
  top: 0;
  z-index: 300;            /* Siempre por encima de los filtros */
  background: #ffffff;     /* Evita que el contenido se vea por debajo */
}

.inst-filters {
  position: sticky;
  top: var(--header-height);  
  z-index: 199;            /* ← ANTES era 200 — ahora queda por debajo del header */
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--steel-50);
  box-shadow: 0 1px 8px rgba(38, 50, 56, 0.04);
}

.inst-filters__scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.inst-filters__scroll::-webkit-scrollbar {
  display: none;
}

.inst-filters__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--steel-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.inst-filters__btn i {
  font-size: 11px;
}

.inst-filters__btn:hover {
  background: var(--steel-50);
  border-color: var(--steel-100);
  color: var(--steel-700);
}

.inst-filters__btn.active {
  background: var(--steel-600);
  border-color: var(--steel-600);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(84, 110, 122, 0.3);
}

@media (max-width: 767px) {
  /*.header {
    /* Si el header móvil es más bajo, ajústalo aquí }*/

  .inst-filters {
    top: 64px;             /* Altura del header en móvil, si es diferente */
  }

  .inst-filters__scroll {
    padding: 10px 16px;
    gap: 6px;
  }
}

@media (min-width: 768px) {
  .inst-filters__scroll {
    justify-content: center;
    padding: 14px 32px;
    gap: 6px;
  }
}


/* ==========================================================================
   3. MAIN CONTAINER
   ========================================================================== */

.inst-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

@media (min-width: 768px) {
  .inst-main {
    padding: 64px 32px 0;
  }
}

@media (min-width: 1024px) {
  .inst-main {
    padding: 80px 48px 0;
  }
}


/* ==========================================================================
   4. CATEGORY HEADERS
   ========================================================================== */

.inst-category {
  margin-bottom: 48px;
}

.inst-category__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--steel-50);
}

.inst-category__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--steel-600), var(--steel-500));
  color: #ffffff;
  border-radius: 12px;
  font-size: 16px;
  flex-shrink: 0;
  transform: rotate(-4deg);
  box-shadow: 0 4px 12px rgba(84, 110, 122, 0.25);
}

.inst-category__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: var(--steel-900);
  margin: 0 0 4px;
  line-height: 1.3;
}

.inst-category__subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--steel-400);
  margin: 0;
  line-height: 1.5;
}


/* ==========================================================================
   5. PRODUCT GRID
   ========================================================================== */

.inst-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 480px) {
  .inst-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .inst-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .inst-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1280px) {
  .inst-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ==========================================================================
   6. PRODUCT CARD — Surgical Ficha
   ========================================================================== */

.inst-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--steel-50);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease,
              border-color 0.25s ease;
}

.inst-card:hover {
  transform: translateY(-6px);
  border-color: var(--steel-200);
  box-shadow: 0 12px 40px rgba(38, 50, 56, 0.1),
              0 4px 12px rgba(38, 50, 56, 0.05);
}

/* Hidden state for filters */
.inst-card.is-hidden {
  display: none;
}


/* ==========================================================================
   7. CARD IMAGE — Clickable for Lightbox
   ========================================================================== */

.inst-card__image {
  position: relative;
  background: var(--steel-25);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 28px;
  cursor: zoom-in;
  overflow: hidden;
}

.inst-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.inst-card:hover .inst-card__image img {
  transform: scale(1.08);
}

/* Zoom overlay on hover */
.inst-card__zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(38, 50, 56, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.inst-card__image:hover .inst-card__zoom {
  opacity: 1;
}

.inst-card__zoom i {
  font-size: 24px;
  color: #ffffff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* Badge */
.inst-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel-600);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--steel-100);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

.inst-card__badge--gold {
  color: #92700c;
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--gold-border);
}

@media (min-width: 768px) {
  .inst-card__image {
    padding: 32px;
  }
}


/* ==========================================================================
   8. CARD BODY — Name, Code, Detail Button
   ========================================================================== */

.inst-card__body {
  padding: 18px 18px 20px;
}

.inst-card__name {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--steel-900);
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inst-card__code {
  display: block;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--steel-400);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .inst-card__body {
    padding: 20px 20px 22px;
  }
  .inst-card__name {
    font-size: 15px;
  }
  .inst-card__code {
    font-size: 11.5px;
    margin-bottom: 16px;
  }
}


/* ==========================================================================
   9. DETAIL BUTTON — Styled <summary>
   ========================================================================== */

.inst-card__detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--steel-500);
  background: transparent;
  border: 1px solid var(--steel-100);
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  transition: all 0.25s ease;
  user-select: none;
}

/* Remove default summary marker */
.inst-card__detail-btn::-webkit-details-marker {
  display: none;
}

.inst-card__detail-btn::marker {
  content: '';
}

.inst-card__detail-btn i {
  font-size: 10px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-card__detail-btn:hover {
  background: var(--steel-50);
  border-color: var(--steel-200);
  color: var(--steel-700);
}

/* Open state */
details[open] > .inst-card__detail-btn {
  background: var(--steel-600);
  border-color: var(--steel-600);
  color: #ffffff;
  border-radius: 10px 10px 0 0;
}

details[open] > .inst-card__detail-btn i {
  transform: rotate(180deg);
}

details[open] > .inst-card__detail-btn:hover {
  background: var(--steel-700);
  border-color: var(--steel-700);
}


/* ==========================================================================
   10. DETAILS CONTENT — Expanded Specs
   ========================================================================== */

.inst-card__details-content {
  padding: 18px;
  background: var(--steel-25);
  border: 1px solid var(--steel-100);
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.inst-card__details-content > p {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--steel-600);
  line-height: 1.6;
  margin: 0 0 14px;
}

.inst-card__details-content h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--steel-800);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 8px;
}

.inst-card__details-content h4:first-of-type {
  margin-top: 0;
}

.inst-card__details-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
}

.inst-card__details-content li {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--steel-600);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}

.inst-card__details-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--steel-400);
}

.inst-card__details-content li strong {
  color: var(--steel-800);
  font-weight: 600;
}


/* ==========================================================================
   11. LIGHTBOX — Fullscreen Image Modal
   ========================================================================== */

.inst-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.inst-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.inst-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 40, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.inst-lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.2s ease;
}

.inst-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.inst-lightbox__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 88vh;
}

.inst-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-lightbox.is-active .inst-lightbox__img {
  transform: scale(1);
}

.inst-lightbox__caption {
  margin-top: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--steel-300);
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

/* Mobile: close button repositioned */
@media (max-width: 480px) {
  .inst-lightbox__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .inst-lightbox__inner {
    max-width: 96vw;
    max-height: 90vh;
  }
  .inst-lightbox__img {
    max-height: 75vh;
    border-radius: 8px;
  }
  .inst-lightbox__caption {
    font-size: 12px;
    margin-top: 14px;
    padding: 0 16px;
  }
}


/* ==========================================================================
   13. GATED CONTENT — Lógica independiente de Instrumental
   ==========================================================================
   Visibilidad binaria basada en .is-logged-in en el <body>.
   El contenedor .inst-gated vive DENTRO de .inst-main para heredar
   max-width, padding y centrado horizontal automáticamente.
   Sin blur, sin overlays, sin dependencias del archivo global.
   ========================================================================== */

/* --- Estado por defecto (con sesión) --- */

.inst-gated .gated-banner {
  display: none;
}

.inst-gated .gated-content {
  display: block;
}

/* --- Spacing: solo margen superior, el resto lo da .inst-main --- */

.inst-gated {
  margin-top: 64px;
}


/* ==========================================================================
   13.1 Estado: SIN sesión
   ========================================================================== */

body:not(.is-logged-in) .inst-gated .gated-content {
  display: none;
}

/* Contenedor: centro vertical + horizontal */
body:not(.is-logged-in) .inst-gated {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

/* Banner expandido */
body:not(.is-logged-in) .inst-gated .gated-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 56px;
  background: #d9dad9;
  border: 1px solid #e8eaed;
  border-left: 4px solid var(--steel-600);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 4px 16px rgba(0, 0, 0, 0.03),
    0 16px 56px rgba(0, 0, 0, 0.06);
  text-align: center;
}


/* ==========================================================================
   13.2 Estado: CON sesión
   ========================================================================== */

body.is-logged-in .inst-gated .gated-banner {
  display: none;
}


/* ==========================================================================
   13.3 Componentes internos del banner
   ========================================================================== */

.gated-banner__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--steel-50), #e9ecef);
  border: 1px solid var(--steel-100);
  border-radius: 16px;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.gated-banner__icon svg {
  display: block;
}

.gated-banner__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--steel-900);
  margin: 0 0 14px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.gated-banner__text {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 400;
  color: var(--steel-400);
  line-height: 1.7;
  margin: 0 0 40px;
  max-width: 560px;
}

.gated-banner__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}


/* ==========================================================================
   13.4 Botones del banner
   ========================================================================== */

.gated-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Primario — Registro */
.gated-banner__btn--solid {
  color: #fff;
  background: var(--steel-600);
  border: 2px solid var(--steel-600);
}

.gated-banner__btn--solid:hover {
  background: var(--steel-800);
  border-color: var(--steel-800);
  box-shadow: 0 8px 24px rgba(84, 110, 122, 0.35);
  transform: translateY(-2px);
}

.gated-banner__btn--solid:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(84, 110, 122, 0.2);
}

/* Secundario — Login */
.gated-banner__btn--outline {
  color: var(--steel-600);
  background: transparent;
  border: 2px solid var(--steel-200);
}

.gated-banner__btn--outline:hover {
  border-color: var(--steel-600);
  background: var(--steel-600);
  color: #fff;
  box-shadow: 0 8px 24px rgba(84, 110, 122, 0.25);
  transform: translateY(-2px);
}

.gated-banner__btn--outline:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Accesibilidad */
.gated-banner__btn:focus-visible {
  outline: 2px solid var(--steel-600);
  outline-offset: 3px;
}


/* ==========================================================================
   13.5 Responsive del banner
   ========================================================================== */

@media (max-width: 768px) {
  body:not(.is-logged-in) .inst-gated {
    min-height: 420px;
  }

  body:not(.is-logged-in) .inst-gated .gated-banner {
    padding: 48px 32px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .inst-gated {
    margin-top: 48px;
  }

  body:not(.is-logged-in) .inst-gated {
    min-height: 380px;
  }

  body:not(.is-logged-in) .inst-gated .gated-banner {
    padding: 40px 20px;
  }

  .gated-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .gated-banner__btn {
    width: 100%;
    padding: 14px 24px;
  }
}

/* ==========================================================================
   14. ANIMATIONS — Subtle entrance for cards
   ========================================================================== */

@keyframes inst-card-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inst-card {
  animation: inst-card-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger delay via nth-child */
.inst-grid .inst-card:nth-child(1)  { animation-delay: 0.02s; }
.inst-grid .inst-card:nth-child(2)  { animation-delay: 0.06s; }
.inst-grid .inst-card:nth-child(3)  { animation-delay: 0.10s; }
.inst-grid .inst-card:nth-child(4)  { animation-delay: 0.14s; }
.inst-grid .inst-card:nth-child(5)  { animation-delay: 0.18s; }
.inst-grid .inst-card:nth-child(6)  { animation-delay: 0.22s; }
.inst-grid .inst-card:nth-child(7)  { animation-delay: 0.26s; }
.inst-grid .inst-card:nth-child(8)  { animation-delay: 0.30s; }


/* ==========================================================================
   15. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .inst-card {
    animation: none;
  }
  .inst-card,
  .inst-card__image img,
  .inst-lightbox__img,
  .inst-lightbox__close,
  .inst-filters__btn,
  .inst-card__detail-btn,
  .inst-card__detail-btn i,
  .inst-whatsapp {
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================================================
   16. FOCUS STATES — Accessibility
   ========================================================================== */

.inst-filters__btn:focus-visible,
.inst-card__detail-btn:focus-visible,
.inst-lightbox__close:focus-visible,
.inst-whatsapp:focus-visible {
  outline: 2px solid var(--steel-600);
  outline-offset: 2px;
}

.inst-card__image:focus-visible {
  outline: 2px solid var(--steel-600);
  outline-offset: -2px;
}



/* ==========================================================================
   17. CARD PURCHASE — Price & Add to Cart (Gated)
   ========================================================================== */

/* Contenedor principal de compra */
.inst-card__purchase {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--steel-50);
}

/* Precio */
.inst-card__price {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--steel-900);
  margin-bottom: 12px;
}

/* Fila de Stepper + Botón */
.inst-card__cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stepper idéntico al de suturas pero adaptado visualmente */
.prod__qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--steel-100);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.prod__qty-btn {
  width: 32px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--steel-25);
  border: none;
  color: var(--steel-600);
  font-size: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.prod__qty-btn:hover {
  background: var(--steel-100);
  color: var(--steel-900);
}

.prod__qty-input {
  width: 36px;
  height: 34px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--steel-100);
  border-right: 1px solid var(--steel-100);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--steel-900);
  background: #fff;
  appearance: textfield;
}

.prod__qty-input::-webkit-inner-spin-button,
.prod__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Botón Añadir al carrito */
.btn-add-cart {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: var(--steel-600);
  color: #ffffff;
  border: 1px solid var(--steel-600);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-add-cart:hover {
  background: var(--steel-800);
  border-color: var(--steel-800);
  box-shadow: 0 4px 12px rgba(84, 110, 122, 0.3);
  transform: translateY(-1px);
}

.btn-add-cart:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-add-cart i {
  font-size: 12px;
}

/* --- Lógica Gated: Ocultar precios y carro si no hay sesión --- */
body:not(.is-logged-in) .inst-card__purchase {
  display: none;
}

/* Mensaje sutil para usuarios sin sesión */
.inst-card__login-msg {
  display: none;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--steel-400);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--steel-50);
}

body:not(.is-logged-in) .inst-card__login-msg {
  display: block;
}

.inst-card__login-msg a {
  color: var(--steel-600);
  text-decoration: underline;
  font-weight: 500;
}

.inst-card__login-msg a:hover {
  color: var(--steel-800);
}

/* --- Ajustes Responsive --- */
@media (max-width: 480px) {
  .inst-card__cart-row {
    flex-direction: column;
    gap: 10px;
  }
  .prod__qty-stepper, .btn-add-cart {
    width: 100%;
  }
  .btn-add-cart {
    height: 38px;
  }
}