/* Estilos DermaLabs — comparativa de skincare con enlaces de afiliado de Amazon.
   Sin dependencias externas, sin frameworks. Compatible con cualquier hosting PHP simple. */

:root {
  --color-bg: #faf6f3;
  --color-card: #ffffff;
  --color-text: #2b2622;
  --color-muted: #79706a;
  --color-accent: #c17a63;       /* terracota cálido, marca propia (no naranja Amazon) */
  --color-accent-dark: #a5624d;
  --color-sage: #8a9a7b;         /* verde salvia para acentos secundarios */
  --color-border: #ece3dc;
  --color-accent-light: #f8ece6;
  --radius: 12px;
  --max-width: 900px;
  --max-width-wide: 1140px;
}

* { box-sizing: border-box; }

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

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

header.site-header {
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo {
  height: 46px;
  width: 46px;
  object-fit: cover;
  border-radius: 50%;
}

.site-brand .site-name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--color-accent-dark);
  font-family: Georgia, "Times New Roman", serif;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent);
}

.site-nav a.lang-switch {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-muted);
}

.site-nav a.lang-switch:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

h1.page-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin: 24px 0 8px;
}

p.page-intro {
  color: var(--color-muted);
  margin-bottom: 24px;
}

.disclosure {
  background: #fdf3ec;
  border: 1px solid #f0dcc9;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #6b4a30;
  margin: 20px 0;
}

.draft-notice {
  background: #f2f0ea;
  border: 1px dashed #c9c0b3;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 20px 0;
}

.safety-notice {
  background: #fbecec;
  border: 1px solid #eecaca;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #8a3a3a;
  margin: 32px 0 8px;
}

.safety-notice strong {
  color: #7a2e2e;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
  margin: 24px 0;
}

.empty-state code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Hero (home / piel / productos) ---------- */

.hero {
  background-image:
    linear-gradient(180deg, rgba(43, 38, 34, 0.35), rgba(43, 38, 34, 0.5)),
    url('/img/hero-slider.png'),
    linear-gradient(135deg, #e8d9cd, #cdd4bf);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 55% 30%;
  color: #fff;
  height: 72vh;
  display: flex;
  align-items: center;
  padding: 48px 16px;
  overflow: hidden;
}

.hero-piel {
  background-image:
    linear-gradient(180deg, rgba(43, 38, 34, 0.35), rgba(43, 38, 34, 0.5)),
    url('/img/piel1.jpg'),
    linear-gradient(135deg, #e8d9cd, #cdd4bf);
  background-position: 45% 62%;
}

.hero-productos {
  background-image:
    linear-gradient(180deg, rgba(43, 38, 34, 0.35), rgba(43, 38, 34, 0.5)),
    url('/img/rubia1.jpg'),
    linear-gradient(135deg, #e8d9cd, #cdd4bf);
  background-position: 56% 55%;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.25;
  margin: 0 0 18px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

.hero p {
  font-size: 1.15rem;
  max-width: 580px;
  margin: 0 auto 28px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.cta-large {
  padding: 14px 32px;
  font-size: 1rem;
}

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

/* ---------- Secciones de contenido (home) ---------- */

.content-section {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 48px 16px;
}

.content-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 12px;
}

.section-intro {
  color: var(--color-muted);
  max-width: 640px;
  margin-bottom: 28px;
}

.skin-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.skin-type-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

.skin-type-card h3 {
  margin: 0 0 10px;
  color: var(--color-accent-dark);
  font-family: Georgia, "Times New Roman", serif;
}

.skin-type-card p {
  font-size: 0.92rem;
  margin: 0 0 10px;
}

.skin-type-card-wide {
  grid-column: 1 / -1;
}

.self-test {
  background: #f2ede5;
}

.self-test-steps {
  max-width: 700px;
  padding-left: 22px;
}

.self-test-steps li {
  margin-bottom: 10px;
}

.why-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.why-image img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.why-text p {
  margin-bottom: 16px;
}

.why-text .cta-button {
  margin-top: 8px;
}

.why-section-reverse .why-image {
  order: 2;
}

.why-section-reverse .why-text {
  order: 1;
}

@media (max-width: 720px) {
  .why-section { grid-template-columns: 1fr; }
  .why-image img { max-height: 280px; }
  .hero { background-position: 75% 30%; }
  .hero-piel { background-position: 25% 62%; }
  .hero-productos { background-position: 56% 38%; }
}

/* ---------- Filtros de productos ---------- */

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0 8px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.filter-field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.filter-field select {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}

.filter-reset {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-reset:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.filter-count {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 8px 0 4px;
  min-height: 1.2em;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-accent-dark);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Grid de productos ---------- */

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

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

.product-tile:hover {
  box-shadow: 0 6px 18px rgba(43, 38, 34, 0.1);
  transform: translateY(-2px);
}

.product-tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.product-badge-tile {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  margin: 0;
}

.product-tile-image {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

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

.product-tile-body {
  padding: 14px 16px 18px;
}

.product-tile-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 2px 0 6px;
  line-height: 1.3;
}

/* ---------- Página de detalle de producto ---------- */

.back-link {
  display: inline-block;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin: 20px 0;
}

.back-link:hover { color: var(--color-accent-dark); }

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.product-gallery-main {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 340px;
  padding: 20px;
}

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

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

.product-gallery-thumbs .thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
}

.product-gallery-thumbs .thumb.active,
.product-gallery-thumbs .thumb:hover {
  border-color: var(--color-accent);
}

.product-detail-name {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 8px 0 6px;
  line-height: 1.3;
}

.product-price-lg {
  font-size: 1.4rem;
}

.pros-cons-detail {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.radar-section {
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.radar-wrap-detail {
  margin: 0 auto;
}

@media (max-width: 720px) {
  .product-detail-grid { grid-template-columns: 1fr; }
  .product-gallery-main { height: 260px; }
}

.product-category {
  display: inline-block;
  color: var(--color-sage);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.product-badge {
  display: inline-block;
  background: #f2ede2;
  color: #5c6b4c;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 0 0 6px 8px;
}

.product-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.product-rating {
  color: var(--color-accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.product-price {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.product-desc {
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.pros-cons {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.pros-cons ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.pros-cons .pros-title { color: #4a7a3f; font-weight: 600; }
.pros-cons .cons-title { color: #a13030; font-weight: 600; }

/* ---------- Radar de recomendación por tipo de piel ---------- */

.radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  margin-bottom: 16px;
  max-width: 400px;
}

.radar-chart {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 1;
}

.radar-axis {
  stroke: var(--color-border);
  stroke-width: 1;
}

.radar-data {
  fill: var(--color-accent);
  fill-opacity: 0.28;
  stroke: var(--color-accent-dark);
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-dot {
  fill: var(--color-accent-dark);
}

.radar-label {
  font-size: 9px;
  fill: var(--color-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.radar-caption {
  font-size: 0.82rem;
  color: var(--color-text);
  text-align: center;
  margin-top: 6px;
}

.radar-caption strong {
  color: var(--color-sage);
}

/* ---------- CTA ---------- */

.cta-button {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.cta-button:hover { background: var(--color-accent-dark); }

.price-note {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 6px;
}

.cta-amazon {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(180deg, #f7b733, #e8930a);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  padding: 15px 24px;
  border-radius: 999px;
  border: 1px solid #d17f00;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.cta-amazon:hover {
  background: linear-gradient(180deg, #f5aa1f, #d98600);
}

.cta-amazon::after {
  content: " ↗";
}

footer.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 16px;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 40px;
}

.site-footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.footer-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: var(--color-accent-dark);
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.footer-disclosure {
  margin-top: 8px;
}

@media (max-width: 560px) {
  .radar-wrap { max-width: 100%; }
  .site-header-inner { flex-wrap: wrap; }
  .site-nav { gap: 16px; }
  .hero { height: 58vh; padding: 40px 16px; background-position: 88% 30%; }
  .hero-piel { background-position: 12% 62%; }
  .hero-productos { background-position: 56% 38%; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-field { min-width: 0; }
}

/* ---------- Widget de diagnóstico de piel (página Piel) ---------- */

.skin-widget {
  background: var(--color-card);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px -10px rgba(43, 38, 34, 0.08);
  overflow: hidden;
}

.skin-header {
  padding: 24px 32px 0 32px;
}

.skin-header h3 {
  margin: 0 0 6px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  font-family: Georgia, "Times New Roman", serif;
}

.skin-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.skin-nav {
  display: flex;
  gap: 8px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.skin-tab {
  background: transparent;
  border: 1px solid var(--color-border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.skin-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.skin-tab.active {
  background: var(--color-accent-dark);
  color: #ffffff;
  border-color: var(--color-accent-dark);
}

.skin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 32px;
  align-items: center;
}

.face-container {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--color-border);
  position: relative;
}

.face-svg {
  width: 100%;
  height: auto;
  max-width: 180px;
}

.layer {
  transition: opacity 0.4s ease, fill 0.4s ease;
  opacity: 0;
}

.type-normal .layer-base { opacity: 1; }
.type-seca .layer-dry { opacity: 0.55; }
.type-grasa .layer-shine-full { opacity: 0.65; }
.type-mixta .layer-shine-t { opacity: 0.7; }
.type-mixta .layer-dry-cheeks { opacity: 0.35; }
.type-sensible .layer-redness { opacity: 0.55; }

.skin-info h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  color: var(--color-text);
  font-family: Georgia, "Times New Roman", serif;
}

.skin-desc {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.skin-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--color-bg);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.skin-recommendation {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: var(--color-accent-dark);
  line-height: 1.4;
}

.skin-recommendation strong {
  display: block;
  margin-bottom: 2px;
}

@media (max-width: 640px) {
  .skin-body {
    grid-template-columns: 1fr;
  }
  .face-container {
    max-width: 200px;
    margin: 0 auto;
  }
}
