/* ===== Sanor — Sistema de diseño ===== */
:root {
  --color-primary: #1576c3;
  --color-primary-dark: #0f5a97;
  --color-primary-light: #e8f2fb;
  --color-text: #333333;
  --color-text-soft: #575757;
  --color-border: #e1e5ea;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f9fb;
  --color-whatsapp: #25d366;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
  --max-width: 1200px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand img {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  transition: color 0.15s;
}

.main-nav a:hover {
  color: var(--color-primary);
}

.btn-clientes {
  background: var(--color-primary-light);
  color: var(--color-primary-dark) !important;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700 !important;
  transition: background 0.15s;
}

.btn-clientes:hover {
  background: var(--color-primary);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-primary-dark);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 16px;
    transform: translateY(-120%);
    transition: transform 0.2s ease;
  }
  .main-nav.open {
    transform: translateY(0);
  }
  .main-nav a {
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }
  .btn-clientes {
    margin-top: 8px;
    text-align: center;
  }
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 64px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin: 0 0 12px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto;
  text-wrap: balance;
}

.hero-badge {
  display: inline-block;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Sections ===== */
.section {
  padding: 56px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  text-align: center;
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-soft);
  margin: 0 0 36px;
}

/* ===== Category cards (home) ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 860px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}

.category-card .category-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.section-cta {
  text-align: center;
  margin-top: 36px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.15s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ===== Catálogo ===== */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
}

.catalog-filters {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 18px;
}

.catalog-filters h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-soft);
}

.catalog-filters ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.catalog-filters li a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--color-text);
}

.catalog-filters li a:hover,
.catalog-filters li a.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.product-card .product-image {
  aspect-ratio: 1 / 1;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card .product-info {
  padding: 12px 14px;
}

.product-card .product-code {
  font-size: 0.78rem;
  color: var(--color-text-soft);
  font-weight: 600;
}

.product-card .product-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 4px 0 2px;
}

.product-card .product-category {
  font-size: 0.8rem;
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  color: var(--color-text-soft);
  padding: 60px 20px;
}

/* ===== Ficha de producto ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 760px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.product-gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.product-gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
}

.product-gallery-thumbs img.active {
  border-color: var(--color-primary);
}

.product-detail-code {
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.03em;
}

.product-detail h1 {
  margin: 6px 0 16px;
}

.detail-row {
  border-top: 1px solid var(--color-border);
  padding: 14px 0;
}

.detail-row .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-soft);
  margin-bottom: 4px;
}

.multiline {
  white-space: pre-line;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== Clientes / login ===== */
.login-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 36px;
}

.login-card h1 {
  margin-top: 0;
  font-size: 1.5rem;
  text-align: center;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 1rem;
}

.field input:focus {
  outline: 2px solid var(--color-primary);
  border-color: var(--color-primary);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-soft);
  cursor: pointer;
}

.toggle-password:hover {
  color: var(--color-primary);
}

.login-error {
  color: #c0392b;
  font-size: 0.88rem;
  margin-top: 4px;
  min-height: 1.2em;
}

.client-panel {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.client-panel .btn {
  margin-top: 20px;
}

.logout-link {
  display: block;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--color-text-soft);
}

/* ===== Contacto / footer ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 700px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 20px;
}

.contact-card .icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.contact-card h3 {
  margin: 0 0 6px;
}

.contact-card a {
  color: var(--color-primary);
  font-weight: 600;
}

.site-footer {
  background: #1c2b36;
  color: #cfd8dd;
  padding: 40px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand img {
  height: 38px;
  margin-bottom: 10px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  max-width: 320px;
  font-size: 0.88rem;
  color: #9fb0ba;
}

.footer-col h4 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 0.9rem;
}

.footer-col a {
  display: block;
  font-size: 0.88rem;
  padding: 4px 0;
  color: #cfd8dd;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  font-size: 0.78rem;
  color: #6f838d;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #2c3e4a;
}

/* ===== Botón flotante de WhatsApp ===== */
.whatsapp-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.whatsapp-float:hover {
  transform: scale(1.07);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

/* ===== Loader ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-text-soft);
}
