/* ============================================================
   ModelShapes — styles.css
   Paleta: #16E7CF (accent) | #1570E6 (cards/btns) | #2D42C1 (primary) | #0E1C99 (secondary)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --accent:    #16E7CF;
  --card:      #1570E6;
  --primary:   #2D42C1;
  --secondary: #0E1C99;
  --bg:        #F8F9FC;
  --surface:   #FFFFFF;
  --text:      #1A1A2E;
  --text-muted:#6B7280;
  --radius:    16px;
  --shadow:    0 4px 24px rgba(45,66,193,0.10);
  --shadow-hover: 0 12px 40px rgba(45,66,193,0.22);
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Hero logo ──────────────────────────────────────────────── */
.ms-hero__logo {
  width: 512px;
  max-width: 80vw;
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
  /*filter: brightness(0) invert(1);*/
}

/* ── Hero ──────────────────────────────────────────────────── */
.ms-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 50%, var(--card) 100%);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}
.ms-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2316E7CF' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.ms-hero__content { position: relative; z-index: 1; }
.ms-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
}
.ms-accent { color: var(--accent); }
.ms-hero__subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.78);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Botones ───────────────────────────────────────────────── */
.ms-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.ms-btn--primary {
  background: var(--accent);
  color: var(--secondary);
}
.ms-btn--primary:hover {
  background: #0fd4bc;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22,231,207,0.4);
}
.ms-btn--ar {
  background: var(--card);
  color: #fff;
  width: 100%;
  justify-content: center;
  border-radius: var(--radius);
  padding: 13px 20px;
  font-size: 0.95rem;
}
.ms-btn--ar:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

/* ── Sección catálogo ──────────────────────────────────────── */
.ms-catalog { padding: 80px 0; }
.ms-section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--secondary);
  text-align: center;
  margin-bottom: 8px;
}
.ms-section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 48px;
}

/* ── Grid ──────────────────────────────────────────────────── */
.ms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 1024px) { .ms-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .ms-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ── Cards ─────────────────────────────────────────────────── */
.ms-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  opacity: 0;          /* animado por GSAP */
  transform: translateY(24px);
  cursor: pointer;
}
.ms-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-hover);
}
.ms-card:active { transform: scale(0.98); }

/* Skeleton */
.ms-card--skeleton {
  opacity: 1;
  transform: none;
  background: linear-gradient(90deg, #e8ecf4 25%, #f2f4f8 50%, #e8ecf4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 320px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Imagen */
.ms-card__img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, #eef1f8 0%, #e0e6f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ms-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  loading: lazy;
}
.ms-card:hover .ms-card__img { transform: scale(1.05); }

/* Placeholder sin imagen */
.ms-card__no-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 100%;
  height: 100%;
  padding: 24px;
}
.ms-card__no-img-icon {
  font-size: 3rem;
  opacity: 0.4;
}

/* Badge de tipo -->
.ms-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(45,66,193,0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

/* Cuerpo de la card */
.ms-card__body {
  padding: 18px 20px 20px;
}
.ms-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  text-transform: capitalize;
}
.ms-card__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Highlight accent (10% uso) ────────────────────────────── */
.ms-highlight {
  background: rgba(22,231,207,0.12);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--secondary);
  font-weight: 500;
  margin-bottom: 14px;
  display: inline-block;
}

/* ── Modal ─────────────────────────────────────────────────── */
.ms-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.ms-modal.is-open { display: flex; }
.ms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14,28,153,0.55);
  backdrop-filter: blur(6px);
}
.ms-modal__box {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 20px;
  width: min(92vw, 680px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(14,28,153,0.25);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(0.88) translateY(20px); }
  to   { opacity:1; transform: scale(1)    translateY(0);    }
}
.ms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(45,66,193,0.08);
}
.ms-modal__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: capitalize;
}
.ms-modal__close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.ms-modal__close:hover { background: #f0f0f5; }
.ms-modal__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: #f4f6fb;
}
.ms-modal__footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(45,66,193,0.08);
}

/* model-viewer dentro del modal */
.ms-model-viewer {
  width: 100%;
  height: 420px;
  background: transparent;
  --poster-color: transparent;
}

/* QR image en desktop */
.ms-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}
.ms-qr-wrap img {
  width: min(260px, 80vw);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(45,66,193,0.15);
}
.ms-qr-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}
.ms-qr-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
}

/* Loader del model-viewer */
.ms-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.ms-loader__ring {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(45,66,193,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ────────────────────────────────────────────────── */
.ms-footer {
  background: var(--secondary);
  padding: 48px 24px;
  text-align: center;
  opacity: 0; /* animado por GSAP ScrollTrigger */
}
.ms-footer__inner { max-width: 400px; margin: 0 auto; }
.ms-footer__logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin-bottom: 12px;
  opacity: 0.85;
}
.ms-footer__copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
}

/* ── Utilidades ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
