/* ============================================================
   RAGAR — Gasóleo a domicilio Valencia
   Diseño limpio · Verde (energía) + Azul marino del logo
   ============================================================ */

:root {
  --green:      #7cc243;   /* verde claro principal (acento) */
  --green-dark: #5aa22f;
  --navy:       #16264d;   /* azul marino del logo */
  --red:        #e11f26;   /* rojo de la gota */
  --ink:        #1c2536;   /* texto principal */
  --muted:      #5f6b7a;   /* texto secundario */
  --soft:       #f4f9ee;   /* fondo verde muy suave */
  --line:       #e8ece4;
  --white:      #ffffff;
  --radius:     16px;
  --shadow:     0 10px 40px rgba(22, 38, 77, .08);
  --max:        1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 22px; }

h1, h2, h3, h4 { line-height: 1.18; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .5em; }
h3 { font-size: 1.25rem; margin: 1.8em 0 .5em; }
h4 { font-size: 1.05rem; }
p  { margin-bottom: 1em; color: var(--muted); }
p strong { color: var(--ink); }
a  { color: var(--green-dark); text-decoration: none; }

.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green-dark);
  margin-bottom: .8em;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-weight: 700; border-radius: 999px; padding: .85em 1.6em; cursor: pointer;
  border: 2px solid transparent; transition: .18s ease; font-size: 1rem; line-height: 1;
}
.btn-lg { padding: 1.05em 1.9em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.14); }
.btn-phone-nav { background: var(--navy); color: var(--white); padding: .6em 1.2em; font-size: .95rem; }
.btn-phone-nav:hover { background: #0f1c3a; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding-block: .75rem; }

/* Logo */
.logo { display: flex; align-items: center; gap: .65rem; }
.logo-drop { width: 34px; height: auto; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font-weight: 800; font-size: 1.35rem; color: var(--navy); letter-spacing: .04em; }
.logo-tag  { font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; gap: 1.4rem; margin-left: auto; }
.nav a { color: var(--ink); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--green-dark); }

/* ---------- Hero ---------- */
.hero { position: relative; color: var(--white); overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; background: linear-gradient(130deg, var(--navy), #24406f); }

/* Capas de imagen que se funden en bucle */
.hero-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; will-change: opacity, transform;
}
.hero-layer-base { opacity: 1; animation: heroBase 16s ease-in-out infinite; }
.hero-layer-tank { opacity: 0; animation: heroTank 16s ease-in-out infinite; }

/* Manguera SVG que se despliega sobre la escena del depósito */
.hero-hose { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.hose-line   { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: hoseDraw 16s ease-in-out infinite; }
.hose-flow   { stroke-dasharray: 16 46; opacity: 0; animation: flowMove 1s linear infinite, flowFade 16s ease-in-out infinite; }
.hose-nozzle { opacity: 0; animation: nozzleShow 16s ease-in-out infinite; }

@keyframes heroBase {
  0%   { opacity: 1; transform: scale(1.06) translateX(0); }
  12%  { opacity: 1; transform: scale(1.10) translateX(0); }
  24%  { opacity: 0; transform: scale(1.13) translateX(-5%); }
  74%  { opacity: 0; transform: scale(1.13) translateX(-5%); }
  86%  { opacity: 1; transform: scale(1.08) translateX(0); }
  100% { opacity: 1; transform: scale(1.06) translateX(0); }
}
@keyframes heroTank {
  0%   { opacity: 0; transform: scale(1.10) translateX(4%); }
  14%  { opacity: 0; transform: scale(1.10) translateX(4%); }
  26%  { opacity: 1; transform: scale(1.08) translateX(0); }
  46%  { opacity: 1; transform: scale(1.05) translateX(0); }
  72%  { opacity: 1; transform: scale(1.02) translateX(0); }
  84%  { opacity: 0; transform: scale(1.02) translateX(0); }
  100% { opacity: 0; transform: scale(1.10) translateX(4%); }
}
@keyframes hoseDraw {
  0%, 28% { opacity: 0; stroke-dashoffset: 1; }
  30%     { opacity: 1; stroke-dashoffset: 1; }
  44%     { opacity: 1; stroke-dashoffset: 0; }
  82%     { opacity: 1; stroke-dashoffset: 0; }
  86%     { opacity: 0; stroke-dashoffset: 0; }
  100%    { opacity: 0; stroke-dashoffset: 1; }
}
@keyframes nozzleShow {
  0%, 30% { opacity: 0; }
  34%     { opacity: 1; }
  82%     { opacity: 1; }
  86%     { opacity: 0; }
  100%    { opacity: 0; }
}
@keyframes flowMove { from { stroke-dashoffset: 62; } to { stroke-dashoffset: 0; } }
@keyframes flowFade {
  0%, 46% { opacity: 0; }
  50%     { opacity: .9; }
  80%     { opacity: .9; }
  84%     { opacity: 0; }
  100%    { opacity: 0; }
}

.hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(120deg, rgba(22,38,77,.78) 0%, rgba(22,38,77,.42) 100%); }
.hero-content { position: relative; z-index: 5; padding-block: clamp(4.5rem, 12vw, 8rem); max-width: 720px; }

/* Accesibilidad: sin animación, mostramos la escena del depósito ya conectado */
@media (prefers-reduced-motion: reduce) {
  .hero-layer-base { opacity: 0; animation: none; }
  .hero-layer-tank { opacity: 1; animation: none; transform: none; }
  .hose-line { opacity: 1; stroke-dashoffset: 0; animation: none; }
  .hose-nozzle { opacity: 1; animation: none; }
  .hose-flow { opacity: 0; animation: none; }
}
.hero h1 { color: var(--white); font-size: clamp(2.2rem, 5.2vw, 3.6rem); margin-bottom: .35em; }
.hero-tagline { font-size: clamp(1.05rem, 2.1vw, 1.3rem); color: rgba(255,255,255,.92); margin-bottom: 1.7em; }
.hero-contacts { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.8rem; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem; font-weight: 600; }
.hero-badges li { color: rgba(255,255,255,.92); font-size: .95rem; }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--soft); }
.section p { max-width: 66ch; }
.note {
  background: var(--soft); border-left: 4px solid var(--green);
  padding: 1em 1.3em; border-radius: 10px; margin-top: 1.6em; color: var(--ink);
}
.note strong { color: var(--navy); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.card h4 { color: var(--navy); margin-bottom: .4em; }
.card p { margin-bottom: 0; font-size: .95rem; }

/* ---------- Productos ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.3rem; margin-top: 1.2rem; }
.product {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem; position: relative; overflow: hidden; transition: .18s ease;
}
.product::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--green); }
.product:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-tag {
  display: inline-block; background: var(--soft); color: var(--green-dark);
  font-weight: 700; font-size: .8rem; padding: .35em .9em; border-radius: 999px; margin-bottom: .7em;
}
.product h3 { margin: 0 0 .4em; }
.product p { margin-bottom: 0; font-size: .95rem; }

/* ---------- Chips ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.chips li { background: var(--soft); color: var(--navy); font-weight: 600; padding: .5em 1em; border-radius: 999px; font-size: .9rem; }

/* ---------- Zona / municipios ---------- */
.towns { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: 1.5rem 0; }
.towns li { padding: .55em .9em; background: var(--white); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.towns li::before { content: "📍 "; }

/* ---------- Contacto ---------- */
.section-contact { background: var(--soft); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.5rem; align-items: start; }
.contact-phone {
  display: inline-flex; flex-direction: column; background: var(--navy); color: var(--white);
  padding: 1rem 1.7rem; border-radius: var(--radius); margin: 1.2rem 0 1.6rem;
}
.contact-phone:hover { background: #0f1c3a; }
.contact-phone-label { font-size: .8rem; opacity: .85; font-weight: 600; }
.contact-phone-number { font-size: 1.7rem; font-weight: 800; letter-spacing: .01em; }
.contact-details { list-style: none; display: grid; gap: .55rem; }
.contact-details li { color: var(--muted); font-size: .95rem; }
.contact-details a { font-weight: 600; }

/* ---------- Formulario ---------- */
.contact-form-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; box-shadow: var(--shadow); }
.contact-form-wrap h3 { margin-top: 0; }
.contact-form { display: grid; gap: 1rem; margin-top: 1.1rem; }
.form-row { display: grid; gap: .35rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row label, .form-row-2 label { font-weight: 600; font-size: .88rem; color: var(--ink); }
input, select, textarea {
  font-family: inherit; font-size: 1rem; padding: .72em .95em; width: 100%;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); transition: .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(124,194,67,.22); }
.form-check { display: flex; align-items: flex-start; gap: .6em; font-size: .86rem; color: var(--muted); }
.form-check input { width: auto; margin-top: .25em; }
.form-status { font-weight: 600; font-size: .95rem; min-height: 1.2em; }
.form-status.ok { color: var(--green-dark); }
.form-status.error { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.82); padding-block: 2.4rem 1.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer-contact { display: flex; flex-direction: column; gap: .35rem; }
.footer-contact a { color: var(--green); font-weight: 700; font-size: 1.1rem; }
.footer-legal { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.14); font-size: .84rem; color: rgba(255,255,255,.55); }

/* ---------- FAB llamada ---------- */
.fab-call {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 56px; height: 56px;
  border-radius: 50%; background: var(--green); color: var(--white); display: none;
  align-items: center; justify-content: center; font-size: 1.45rem; box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.fab-call:hover { background: var(--green-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .nav { display: none; }
  .btn-phone-nav { margin-left: auto; }
  .fab-call { display: flex; }
  .form-row-2 { grid-template-columns: 1fr; }
  .logo-tag { display: none; }
}
