/* Péptidos — Celeste, blanco, futurista */

:root {
  --celeste: #0ea5e9;
  --celeste-dark: #0284c7;
  --celeste-soft: #bae6fd;
  --white: #f8fafc;
  --white-pure: #ffffff;
  --bg-light: #e0f2fe;
  --surface: rgba(255, 255, 255, 0.95);
  --border: rgba(148, 163, 184, 0.4);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --success: #34d399;
  --error: #f87171;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(circle at top, #f0f9ff 0, #e0f2fe 35%, #bae6fd 70%, #e5f3ff 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Fondos y efectos — estilo referencia: azul/blanco, ondas, hexágonos, ECG */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #f0f9ff 0%,
    #e0f2fe 25%,
    #bae6fd 55%,
    #7dd3fc 80%,
    #38bdf8 100%
  );
}

.bg-hexagons {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='70' viewBox='0 0 80 70'%3E%3Cpath fill='none' stroke='%2338bdf8' stroke-width='0.8' d='M40,0 L60,17.3 L60,52 L40,69 L20,52 L20,17.3 Z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cpath fill='none' stroke='%230ea5e9' stroke-width='0.5' opacity='0.6' d='M60,0 L90,26 L90,78 L60,104 L30,78 L30,26 Z'/%3E%3C/svg%3E");
  background-size: 80px 70px, 120px 104px;
  background-position: 0 0, 40px 35px;
}

.bg-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  pointer-events: none;
}

.waves-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wave {
  opacity: 0.25;
}

.wave-1 { fill: rgba(56, 189, 248, 0.5); }
.wave-2 { fill: rgba(14, 165, 233, 0.4); }
.wave-3 { fill: rgba(2, 132, 199, 0.35); }

.bg-ecg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.ecg-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ecg-line {
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.5));
}

/* Auth (login/registro) */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.logo-icon {
  font-size: 2rem;
  color: var(--celeste);
  letter-spacing: 0.1em;
}

.logo h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: 0.05em;
}

.tagline {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  padding: 4px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-sm);
}

.tab {
  flex: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.tab:hover {
  color: var(--celeste-dark);
}

.tab.active {
  color: var(--white-pure);
  background: var(--celeste);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.panel-desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-form .field {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--celeste-dark);
}

.auth-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--celeste);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.auth-form input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  color: var(--white-pure);
  background: var(--celeste);
}

.btn-primary:hover:not(:disabled) {
  background: var(--celeste-dark);
  color: var(--white-pure);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-ghost {
  color: var(--celeste-soft);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(125, 211, 252, 0.1);
  color: var(--celeste);
}

.form-message {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--error);
}

/* Catálogo */
.catalog-page {
  padding-bottom: 4rem;
}

.catalog-bg .bg-ecg {
  height: 90px;
  opacity: 0.85;
}

.catalog-header {
  position: relative;
  z-index: 2;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.catalog-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-header .logo {
  flex-direction: row;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.catalog-header .logo:hover {
  color: var(--celeste);
}

.catalog-main {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
}

.catalog-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
  letter-spacing: 0.03em;
}

.catalog-subtitle {
  margin: 0 0 2rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.catalog-loading,
.catalog-error {
  font-size: 1rem;
  color: var(--text-muted);
}

.catalog-error {
  color: var(--error);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.product-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.1);
}

.product-card__image-wrap {
  flex: 0 0 auto;
  aspect-ratio: 1;
  background: transparent;
  overflow: hidden;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  min-height: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.product-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.product-card__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.45;
}

/* Modal popup péptido */
.peptide-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.peptide-modal.is-open {
  display: flex;
}
.peptide-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}
.peptide-modal__box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow: auto;
  background: var(--white-pure);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
}
.peptide-modal__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.peptide-modal__section {
  margin: 0 0 1rem;
}
.peptide-modal__section:last-child {
  margin-bottom: 0;
}
.peptide-modal__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--celeste-dark);
  margin: 0 0 0.35rem;
}
.peptide-modal__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}
.peptide-modal__list li {
  margin-bottom: 0.25rem;
}
.peptide-modal__desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.peptide-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: var(--bg-light);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.peptide-modal__close:hover {
  background: var(--celeste-soft);
}

.peptide-modal__contact {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.peptide-modal__input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
}

.peptide-modal__msg {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  min-height: 1.3em;
}

.peptide-modal__msg.success { color: var(--success); }
.peptide-modal__msg.error { color: var(--error); }

.peptide-modal__btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .auth-main {
    padding: 1.5rem;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}
