/* ==========================================================================
   WagglyPetMania — main.css
   --------------------------------------------------------------------------
   Estilos GLOBALES: variables de diseño, reseteo, tipografía, botones,
   utilidades y componentes reutilizables (tarjetas de producto, badges...).
   Inspiración estética: granplusperu.com (limpia, moderna y corporativa).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES DE DISEÑO (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta de colores */
  --primary:        #153a5e;   /* Azul corporativo profundo */
  --primary-800:    #0f2a46;
  --primary-900:    #0a1f36;
  --accent:         #722f37;   /* Vino para llamadas a la acción */
  --accent-600:     #5c2630;
  --accent-800:     #4a1a25;
  --accent-100:     #f5e8ea;

  --bg:             #f6f8fb;   /* Gris muy claro de fondo */
  --surface:        #ffffff;
  --surface-2:      #eef3f9;

  --text:           #1c2b39;   /* Tipografía oscura de alta legibilidad */
  --text-muted:     #5d6f80;
  --text-light:     #94a3b3;
  --border:         #e5eaf1;
  --white:          #ffffff;
  --danger:         #d64545;
  --star:           #f5a623;

  /* Sombras y radios */
  --shadow-sm: 0 2px 10px rgba(21, 58, 94, 0.07);
  --shadow-md: 0 12px 32px rgba(21, 58, 94, 0.12);
  --shadow-lg: 0 28px 64px rgba(21, 58, 94, 0.16);
  --radius:     14px;
  --radius-lg:  22px;
  --radius-full: 999px;

  /* Layout */
  --container-w: 1200px;
  --header-h:    76px;
  --transition:  0.25s ease;

  /* Tipografía */
  --font-body: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Montserrat', var(--font-body);
}

/* --------------------------------------------------------------------------
   2. RESETEO MODERNO (CSS Reset)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

ul, ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

/* Barra de desplazamiento sutil */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: #c6d2de; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --------------------------------------------------------------------------
   3. TIPOGRAFÍA (Jerarquía clara)
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--primary-900);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }

p { color: var(--text-muted); }

.text-accent { color: var(--accent-600); }
.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   4. LAYOUT / CONTENEDOR
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2.5rem, var(--container-w));
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

/* Encabezado de sección reutilizable */
.section-head {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-600);
  background: var(--accent-100);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.section-head h2 { margin-bottom: 0.75rem; }
.section-head p { font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   5. BOTONES (llamadas a la acción)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), color var(--transition);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(114, 47, 55, 0.35);
}
.btn-primary:hover {
  background: var(--accent-600);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(114, 47, 55, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-light {
  background: var(--white);
  color: var(--primary-800);
}
.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-lg { padding: 1rem 2.2rem; font-size: 1rem; }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   6. COMPONENTE REUTILIZABLE: TARJETA DE PRODUCTO
   -------------------------------------------------------------------------- */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-media img { transform: scale(1.06); }

.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.tag-popular { background: var(--primary); }
.tag-nuevo   { background: var(--accent); }
.tag-oferta  { background: #e2634b; }

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.product-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-600);
}

.product-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-900);
  line-height: 1.35;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stars { color: var(--star); letter-spacing: 2px; }

.product-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-price { display: flex; flex-direction: column; }

.price-now {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-900);
}

.price-before {
  font-size: 0.8rem;
  color: var(--text-light);
  text-decoration: line-through;
}

/* --------------------------------------------------------------------------
   7. PAGE-HERO (encabezado compartido en subpáginas)
   -------------------------------------------------------------------------- */
.page-hero {
  padding: 3.5rem 0 3rem;
  background:
    radial-gradient(700px 300px at 90% -10%, var(--accent-100), transparent 60%),
    linear-gradient(180deg, #eef3f9, var(--bg));
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--accent-600); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-light); }

.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero p { max-width: 56ch; }

/* --------------------------------------------------------------------------
   8. BADGES / ETIQUETAS AUXILIARES
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   8. ANIMACIONES REUTILIZABLES (revelado al hacer scroll)
   -------------------------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Preferencia de usuarios: sin movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE GLOBAL
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .container { width: min(100% - 2rem, var(--container-w)); }
}
