/* ============================================================
   PicShopJR — Ocean Pastel Style
   Paleta: Ocean Pastel — azules suaves, frescos y acogedores
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ============================================================
   Temas: Claro (default) y Oscuro
   ============================================================ */

:root {
  /* Paleta Ocean Pastel — azules suaves (TEMA CLARO) */
  --primary: #7ab8d4;        /* Sky Blue - CTAs, botones primarios */
  --primary-hover: #a3d0e4;  /* Sky Blue claro - hover primario */
  --primary-dark: #7ab8d4;   /* (mantenido para compatibilidad) */
  --secondary: #8baec4;      /* Steel Blue - botones secundarios, acentos */
  --secondary-hover: #b0ccdb;/* Steel Blue claro - hover secundario */
  --secondary-dark: #8baec4; /* (mantenido para compatibilidad) */
  --success: #a3d6e0;        /* Soft Cyan - checklists, éxito */
  --success-hover: #bde4eb;  /* Soft Cyan claro - hover éxito */
  --bg-body: #e8f0f5;        /* Ice Blue - fondo principal */
  --bg-surface: #f0f6fa;     /* Soft Sky - fondos de tarjetas, modales */
  --bg-light: #e8f0f5;      /* (mantenido para compatibilidad) */
  --bg-dark: #e8f0f5;       /* (mantenido para compatibilidad) */
  --text-primary: #2c3e50;   /* Deep Navy - texto principal */
  --text-secondary: #7a9bb5; /* Muted Blue - texto secundario, fechas */
  --text-light: #2c3e50;    /* (mantenido para compatibilidad) */
  --text-dark: #2c3e50;     /* (mantenido para compatibilidad) */
  --text-muted: #a0b8c8;    /* Gris azulado suave - texto muy secundario */
  --border: #d6e4ed;         /* Soft Blue Gray - bordes, separadores */
  --border-light: #d6e4ed;   /* Alias de border para compatibilidad */
  --bg-soft: #e8f0f5;        /* Alias de bg-body para compatibilidad */
  --surface: #f0f6fa;        /* Alias de bg-surface para compatibilidad */
  --accent: #7ab8d4;         /* Alias de primary para compatibilidad */
  --text: #2c3e50;           /* Alias de text-primary para compatibilidad */
  --shadow: rgba(0, 0, 0, 0.05); /* Sombra sutil */

  /* Bordes y sombras suaves */
  --border-radius: 8px;
  --shadow-sm: 2px 2px 0px 0px rgba(0, 0, 0, 0.05);
  --shadow-md: 4px 4px 0px 0px rgba(0, 0, 0, 0.05);
  --shadow-lg: 6px 6px 0px 0px rgba(0, 0, 0, 0.05);

  /* Tipografías profesionales */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* Sistema de espaciado (múltiplos de 8px) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
}

/* ============================================================
   Dark Mode — tonos oscuros azulados
   ============================================================ */

html.dark-mode {
  --primary: #5a9ab8;        /* Sky Blue más apagado para dark */
  --primary-hover: #7ab8d4;  /* Sky Blue claro - hover primario */
  --primary-dark: #5a9ab8;
  --secondary: #6a8fa8;      /* Steel Blue más oscuro */
  --secondary-hover: #8baec4;
  --secondary-dark: #6a8fa8;
  --success: #4a8a94;        /* Soft Cyan más oscuro */
  --success-hover: #6aaab4;
  --bg-body: #0f1a24;        /* Azul marino muy oscuro - fondo principal */
  --bg-surface: #1a2a38;     /* Azul oscuro - fondos de tarjetas, modales */
  --bg-light: #1a2a38;
  --bg-dark: #0f1a24;
  --text-primary: #d6e4ed;   /* Azul muy claro - texto principal */
  --text-secondary: #8baec4; /* Muted Blue - texto secundario */
  --text-light: #d6e4ed;
  --text-dark: #d6e4ed;
  --text-muted: #5a7a8e;    /* Gris azulado oscuro - texto muy secundario */
  --border: #2a3f4f;         /* Azul grisáceo oscuro - bordes */
  --border-light: #2a3f4f;   /* Alias de border para compatibilidad */
  --bg-soft: #0f1a24;        /* Alias de bg-body para compatibilidad */
  --surface: #1a2a38;        /* Alias de bg-surface para compatibilidad */
  --accent: #5a9ab8;         /* Alias de primary para compatibilidad */
  --text: #d6e4ed;           /* Alias de text-primary para compatibilidad */
  --shadow: rgba(0, 0, 0, 0.3); /* Sombra más pronunciada */

  /* Sombras más marcadas en dark mode */
  --shadow-sm: 2px 2px 0px 0px rgba(0, 0, 0, 0.3);
  --shadow-md: 4px 4px 0px 0px rgba(0, 0, 0, 0.3);
  --shadow-lg: 6px 6px 0px 0px rgba(0, 0, 0, 0.3);
}


/* ============================================================
   Reset & Base
   ============================================================ */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.1s ease;
}

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================================
   Container
   ============================================================ */

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: var(--space-md) var(--space-xl);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border: 2px solid var(--secondary);
  border-radius: var(--border-radius);
  transition: box-shadow 0.2s;
}

.brand:hover .brand-logo {
  box-shadow: 0 0 12px rgba(139, 174, 196, 0.5);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* ============================================================
   Navigation
   ============================================================ */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  transition: all 0.1s ease;
  letter-spacing: -0.2px;
}

.nav-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  background: rgba(122, 184, 212, 0.1);
}

.nav-link.is-active {
  background: var(--primary);
  color: var(--text-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: var(--primary);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0 0.4rem;
  margin-left: 0.3rem;
  border: 1px solid var(--text-secondary);
  border-radius: var(--border-radius);
}

/* Badge de notificación para nav-links (amigos, tareas) */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  vertical-align: super;
  line-height: 1;
}

/* ============================================================
   Theme Toggle Button
   ============================================================ */

.theme-toggle-btn {
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.3rem 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  line-height: 1;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(122, 184, 212, 0.1);
}

/* ============================================================
   User Area
   ============================================================ */

.user-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}


.user-info {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.guest-badge {
  background: var(--bg-surface);
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
}

/* ============================================================
   Guest Banner
   ============================================================ */

.guest-banner {
  background: var(--bg-surface);
  border-top: 2px solid var(--secondary);
  padding: 0.7rem 0;
  font-size: 0.85rem;
  font-family: var(--font-body);
  text-align: center;
  color: var(--text-secondary);
}

.guest-banner a {
  color: var(--primary);
}

/* ============================================================
   Main
   ============================================================ */

.site-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 2px solid var(--border);
  background: var(--bg-surface);
  margin-top: auto;
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  color: var(--text-secondary);
}

.footer-inner {
  padding: 1.2rem 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-img {
  width: 120px;
  height: auto;
  opacity: 0.8;
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  transition: opacity 0.2s;
}

.footer-img:hover {
  opacity: 1;
}

/* ============================================================
   Hero Banner (imagen decorativa superior)
   ============================================================ */

.hero-banner {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.hero-banner img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

/* ============================================================
   Hero / Welcome
   ============================================================ */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-badge {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(122, 184, 212, 0.15);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--primary);
  border-radius: 100px;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.hero-lead {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
  max-width: 50ch;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.3rem;
}

.hero-trust span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ============================================================
   Hero Phone Mockup
   ============================================================ */

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-phone {
  width: 240px;
  background: var(--bg-body);
  border: 3px solid var(--text-secondary);
  border-radius: 24px;
  padding: 10px;
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(0,0,0,0.08);
  position: relative;
}

.hero-phone::before {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--text-secondary);
  border-radius: 4px;
  margin: 0 auto 8px;
}

.hero-phone-screen {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
}

.phone-header {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--text-primary);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.phone-item {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: background 0.1s;
}

.phone-item .phone-check {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.phone-item.phone-item-active {
  background: rgba(122, 184, 212, 0.12);
  font-weight: 600;
}

.phone-footer {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}


/* ============================================================
   Buttons
   ============================================================ */

.btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  border: 2px solid var(--text-secondary);
  border-radius: var(--border-radius);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.1s ease;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-primary);
  font-weight: bold;
}

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

.btn-secondary {
  background: var(--secondary);
  color: var(--text-primary);
}

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

.btn-accent {
  background: var(--secondary);
  color: var(--text-primary);
}

.btn-accent:hover {
  background: var(--secondary-hover);
  color: var(--text-primary);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.5rem 0.8rem;
}

.btn-danger {
  background: #c48a9c;
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-danger:hover {
  background: #d4a8b6;
  color: var(--text-primary);
}

html.dark-mode .btn-danger {
  background: #6a3a4c;
  border-color: var(--text-secondary);
}

html.dark-mode .btn-danger:hover {
  background: #8a4a5c;
  color: var(--text-primary);
}


/* ============================================================
   Cards Grid
   ============================================================ */

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

.cards-grid--small {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ============================================================
   Product Card
   ============================================================ */

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.product-card:hover {
  border-color: var(--secondary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image-wrap {
  background: var(--bg-body);
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--border);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-content {
  padding: 0.7rem;
}

.product-content h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-content--list-builder {
  display: grid;
  gap: 0.5rem;
}

/* ============================================================
   Forms
   ============================================================ */

.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  max-width: 500px;
  margin: 0 auto;
}

.form-card h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 1rem;
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-group {
  display: grid;
  gap: 0.4rem;
}

label {
  color: var(--text-primary);
  font-weight: bold;
  margin-bottom: var(--space-xs);
  display: block;
  font-size: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-md);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

input[type="file"] {
  padding: 0.4rem;
}

small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ============================================================
   Checkboxes — Custom Ocean Pastel
   ============================================================ */

input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.checkbox-custom .checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-secondary);
  border-radius: 6px;
  background: var(--bg-surface);
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
}

.checkbox-custom .checkmark::after {
  content: '';
  display: none;
  width: 6px;
  height: 10px;
  border: solid var(--text-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  position: absolute;
  top: 3px;
  left: 7px;
}

.checkbox-custom input:checked ~ .checkmark {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(163, 214, 224, 0.3);
}

.checkbox-custom input:checked ~ .checkmark::after {
  display: block;
  border-color: #fff;
}

.checkbox-custom:hover .checkmark {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 184, 212, 0.2);
}

.checkbox-custom input:focus-visible ~ .checkmark {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html.dark-mode .checkbox-custom .checkmark {
  border-color: var(--text-secondary);
  background: var(--bg-surface);
}

html.dark-mode .checkbox-custom input:checked ~ .checkmark {
  background: #27ae60;
  border-color: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

html.dark-mode .checkbox-custom:hover .checkmark {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 184, 212, 0.2);
}

/* ============================================================
   Panel / Empty State
   ============================================================ */

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
}

.empty-state {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.empty-state p {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-primary);
  max-width: 50ch;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

/* ============================================================
   Section Titles
   ============================================================ */

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   Cart
   ============================================================ */

.cart-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  margin-bottom: 1rem;
}

.cart-summary p {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin: 0.3rem 0;
  color: var(--text-primary);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 0.7rem;
  margin-bottom: 0.5rem;
  transition: transform 0.1s ease;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.cart-item-info .quantity {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================================
   Checklist Items (completed)
   ============================================================ */

.checklist-item.completed,
.product-item.completed,
.cart-item.completed {
  background-color: var(--success);
  text-decoration: line-through;
  opacity: 0.8;
  border-left: 4px solid var(--text-secondary);
}

/* ============================================================
   Actions Row
   ============================================================ */

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ============================================================
   Inline Form
   ============================================================ */

.inline-form {
  display: inline;
}

/* ============================================================
   Error Messages
   ============================================================ */

.error-message {
  background: #d4a8b6;
  border: 2px solid #c48a9c;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 0.7rem;
  margin-bottom: 1rem;
  text-align: center;
}

html.dark-mode .error-message {
  background: #3a1a24;
  border-color: #6a3a4c;
  color: #e8c4d0;
}


/* ============================================================
   Texto legible (DM Sans para textos descriptivos)
   ============================================================ */

.text-readable {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.text-readable-sm {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.text-readable-xs {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.text-micro {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ============================================================
   Misc
   ============================================================ */

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

.text-link {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

.text-link:hover {
  color: var(--primary-hover);
}

.list-intro {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.add-to-cart-form {
  display: grid;
  gap: 0.4rem;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  /* En escritorio, el user-area dentro del nav se muestra como si estuviera fuera */
  .site-nav {
    flex: 1;
    justify-content: flex-end;
    align-items: center;
  }

  .site-nav .user-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border);
  }

  .site-nav .user-area .btn {
    width: auto;
  }

  .site-nav .user-area .inline-form {
    display: inline;
  }

  .site-nav .user-area .inline-form .btn {
    width: auto;
  }
}


/* ============================================================
   Dropdown Navigation
   ============================================================ */

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.1s;
}

.dropdown-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(122, 184, 212, 0.1);
}

.dropdown-toggle.is-active {
  background: var(--primary);
  color: var(--text-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 30;
  padding: 0.3rem 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  transition: all 0.1s;
}

.dropdown-item:hover {
  background: rgba(122, 184, 212, 0.1);
  color: var(--primary);
  text-decoration: none;
}

.dropdown-item.is-active {
  background: var(--primary);
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .site-nav {
    justify-content: center;
  }

  .user-area {
    justify-content: center;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ============================================================
   Friends / Amigos
   ============================================================ */

.friends-container {
  max-width: 800px;
  margin: 0 auto;
}

.friends-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.friends-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: transform 0.1s ease;
}

.friend-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.friend-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.friend-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  border: 1px solid;
  border-radius: var(--border-radius);
  white-space: nowrap;
}

.badge-success {
  background: rgba(163, 214, 224, 0.2);
  color: var(--success);
  border-color: var(--success);
}

.badge-warning {
  background: rgba(139, 174, 196, 0.2);
  color: var(--secondary);
  border-color: var(--secondary);
}

.badge-info {
  background: rgba(139, 174, 196, 0.2);
  color: var(--secondary);
  border-color: var(--secondary);
}

.badge-danger {
  background: rgba(122, 184, 212, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}

/* Search results */
.search-results {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
}

.search-result-item:hover {
  border-color: var(--primary);
}

/* Invite status */
.invite-status {
  margin: 0.5rem 0;
  font-size: 0.8rem;
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--primary);
}

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-sm {
  max-width: 360px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--primary);
}

.modal-body {
  padding: 1.25rem;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ============================================================
   Whitelist (Admin)
   ============================================================ */

.whitelist-container {
  max-width: 700px;
  margin: 0 auto;
}

.whitelist-container .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.whitelist-actions {
  margin-bottom: 1.5rem;
}

.whitelist-add-form {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
}

.whitelist-add-form .input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.whitelist-add-form .input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--shadow-md);
}

.whitelist-table {
  width: 100%;
  border-collapse: collapse;
}

.whitelist-table th,
.whitelist-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.whitelist-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-body);
  text-transform: uppercase;
}

/* ============================================================
   Share tabs (Amigos / Email)
   ============================================================ */

.share-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.75rem;
}

.share-tab {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.share-tab:hover {
  color: var(--text-primary);
}

.share-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.share-tab-content {
  display: none;
}

.share-tab-content.active {
  display: block;
}

/* Producto del catálogo */
.catalog-product-item {
  transition: opacity 0.3s, background 0.3s;
}

.catalog-product-item.checked {
  opacity: 0.7;
}

/* Botón de check toggle */
.btn-check-toggle {
  transition: background 0.2s, border-color 0.2s;
}

.btn-check-toggle:hover {
  border-color: var(--primary);
}

/* Barra de progreso */
.progress-bar {
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--border);
}

.progress-fill {
  border-radius: var(--border-radius);
  transition: width 0.3s ease;
  background: var(--success);
}

.progress-text {
  font-family: var(--font-heading);
}

/* Dropdown label (separador de secciones) */
.dropdown-label {
  display: block;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  color: var(--primary);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Badge de colección general */
.badge-general {
  display: inline-block;
  background: var(--secondary);
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--border-radius);
}

/* ============================================================
   Feature Card (Home)
   ============================================================ */

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Steps Grid (Cómo funciona)
   ============================================================ */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.step-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.25rem;
}

.step-card h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.step-card p {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  max-width: 28ch;
}

@media (max-width: 640px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================================
   List Card
   ============================================================ */

.list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.list-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 420px;
  animation: toast-in 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast.toast-success {
  border-color: var(--success);
}

.toast.toast-error {
  border-color: #c48a9c;
}

.toast.toast-warning {
  border-color: var(--secondary);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================================
   Confirm Modal (global)
   ============================================================ */

#confirm-modal-global .modal {
  max-width: 400px;
}

#confirm-modal-global .modal-body p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0 0 1rem;
}

#confirm-modal-global .modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================================
   Hamburguer Menu (mobile)
   ============================================================ */

.hamburger-btn {
  display: none;
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

.hamburger-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 15;
}

@media (max-width: 760px) {
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 3px solid var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 20;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-overlay.is-open {
    display: block;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }

  /* User area dentro del menú hamburguesa en móvil */
  .site-nav .user-area {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.8rem 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
  }

  .site-nav .user-area .btn {
    width: 100%;
    justify-content: center;
  }

  .site-nav .user-area .theme-toggle-btn {
    align-self: center;
  }

  .site-nav .user-area .user-info {
    text-align: center;
  }

  .site-nav .user-area .inline-form {
    display: block;
  }

  .site-nav .user-area .inline-form .btn {
    width: 100%;
  }
}

/* ============================================================
   Loading spinner
   ============================================================ */

.loading {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   Hidden utility
   ============================================================ */

.hidden {
  display: none !important;
}

/* ============================================================
   Cart item image
   ============================================================ */

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
}

/* ============================================================
   Search result nickname
   ============================================================ */

.search-result-nickname {
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.search-result-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex: 1;
}

/* ============================================================
   Disabled state
   ============================================================ */

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   Alert styles
   ============================================================ */

.alert {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.alert-warning {
  background: rgba(139, 174, 196, 0.15);
  border-color: var(--secondary);
  color: var(--text-primary);
}

/* ============================================================
   Confirm form (inline)
   ============================================================ */

.confirm-form {
  display: inline;
}

/* ============================================================
   Dashboard / Tareas
   ============================================================ */

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  transition: transform 0.1s ease;
}

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

.task-card h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.task-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

/* ============================================================
   Incoming tasks
   ============================================================ */

.incoming-task {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  margin-bottom: 0.5rem;
}

.incoming-task h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.incoming-task p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

/* ============================================================
   Catalogs list
   ============================================================ */

.catalog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: block;
  text-decoration: none;
  color: var(--text-primary);
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--primary);
}

.catalog-card h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.catalog-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

/* ============================================================
   Cart history
   ============================================================ */

.history-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  margin-bottom: 0.5rem;
}

.history-card h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.history-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

/* ============================================================
   Share cart
   ============================================================ */

.share-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  margin-bottom: 0.5rem;
}

.share-card h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.share-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

/* ============================================================
   Shared checklist
   ============================================================ */

.shared-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-bottom: 0.3rem;
}

.shared-item.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.shared-item h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-primary);
}

.shared-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   Product list page
   ============================================================ */

.product-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-bottom: 0.3rem;
}

.product-list-item h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-primary);
}

.product-list-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   Create list page
   ============================================================ */

.create-list-section {
  margin-bottom: 1rem;
}

.create-list-section h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

/* ============================================================
   Login / Register
   ============================================================ */

.auth-container {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-container h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.auth-container p {
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* ============================================================
   Unauthorized page
   ============================================================ */

.unauthorized-container {
  text-align: center;
  padding: 3rem 1rem;
}

.unauthorized-container h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.unauthorized-container p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============================================================
   Offline page
   ============================================================ */

.offline-container {
  text-align: center;
  padding: 3rem 1rem;
}

.offline-container h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.offline-container p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============================================================
   Email templates (preview)
   ============================================================ */

.email-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  max-width: 600px;
  margin: 0 auto;
}

.email-preview h2 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.email-preview p {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ============================================================
   Print styles
   ============================================================ */

@media print {
  .site-header,
  .site-footer,
  .btn,
  .actions-row,
  .hamburger-btn,
  .theme-toggle-btn {
    display: none !important;
  }

  .site-main {
    padding: 0;
  }

  .product-card,
  .cart-item,
  .shared-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ============================================================
   Focus styles for accessibility
   ============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   Scrollbar styling
   ============================================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   Gear menu (settings dropdown in catalog detail)
   ============================================================ */

.btn-gear {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s;
}

.btn-gear:hover {
  background: var(--bg-soft);
}

.gear-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.3rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
  min-width: 180px;
  overflow: hidden;
}

.gear-menu.is-open {
  display: block;
}

.gear-menu .btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 0;
  color: var(--text-primary);
}

.gear-menu .btn:hover {
  background: var(--bg-soft);
}

/* ============================================================
   Responsive: Móvil pequeño (≤480px)
   ============================================================ */

@media (max-width: 480px) {
  /* Container más ajustado */
  .container {
    width: calc(100% - 1rem);
  }

  /* Header compacto */
  .header-inner {
    gap: 0.4rem;
    padding: 0.3rem 0;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .site-header {
    padding: 0.5rem 0.8rem;
  }

  .user-area .btn {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    min-width: 0;
    min-height: 0;
  }

  .user-info {
    font-size: 0.75rem;
  }

  .guest-banner {
    font-size: 0.75rem;
    padding: 0.5rem 0;
  }

  /* Navegación móvil más compacta */
  .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .hamburger-btn {
    font-size: 1.2rem;
    min-width: 40px;
    min-height: 40px;
    padding: 0.2rem 0.4rem;
  }

  /* Hero: mockup más pequeño */
  .hero {
    padding: 1rem;
    gap: 1rem;
  }

  .hero h1 {
    font-size: 1.2rem;
  }

  .hero-lead {
    font-size: 0.85rem;
  }

  .hero-phone {
    width: 100%;
    max-width: 180px;
  }

  .hero-banner img {
    height: 120px;
  }

  /* Product grid: 2 columnas fijas en móvil */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .cards-grid--small {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-content {
    padding: 0.5rem;
  }

  .product-content h3 {
    font-size: 0.75rem;
  }

  .product-image-wrap {
    aspect-ratio: 4 / 3;
  }

  /* Carrito más compacto */
  .cart-item {
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .cart-item img {
    width: 44px;
    height: 44px;
  }

  .cart-item-info h4 {
    font-size: 0.8rem;
  }

  .cart-item-info .quantity {
    font-size: 0.75rem;
  }

  .cart-summary {
    padding: 0.8rem;
  }

  .cart-summary p {
    font-size: 0.8rem;
  }

  /* Botones más compactos */
  .btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }

  .btn-sm {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  /* Formularios */
  .form-card {
    padding: 1rem;
  }

  .form-card h2 {
    font-size: 1rem;
  }

  .auth-container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  /* Tabla whitelist → cards */
  .whitelist-table thead {
    display: none;
  }

  .whitelist-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    background: var(--bg-surface);
  }

  .whitelist-table td {
    display: flex;
    border: none;
    padding: 0.15rem 0;
    font-size: 0.8rem;
  }

  .whitelist-table td::before {
    content: attr(data-label);
    font-weight: bold;
    width: 80px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
  }

  .whitelist-add-form {
    flex-direction: column;
    max-width: 100%;
  }

  /* Amigos / Friends */
  .friend-card {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .friend-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .friend-info strong {
    font-size: 0.8rem;
  }

  .friend-email {
    font-size: 0.7rem;
  }

  .friend-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .friends-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Catálogos */
  .catalog-card {
    padding: 0.8rem;
  }

  .catalog-card h3 {
    font-size: 0.8rem;
  }

  /* Tareas / Dashboard */
  .task-card {
    padding: 0.8rem;
  }

  .task-card h3 {
    font-size: 0.8rem;
  }

  .incoming-task {
    padding: 0.8rem;
  }

  .incoming-task h3 {
    font-size: 0.8rem;
  }

  /* Historial */
  .history-card {
    padding: 0.8rem;
  }

  .history-card h3 {
    font-size: 0.8rem;
  }

  /* Share */
  .share-card {
    padding: 0.8rem;
  }

  .share-card h3 {
    font-size: 0.8rem;
  }

  /* Shared checklist */
  .shared-item {
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
  }

  .shared-item h4 {
    font-size: 0.8rem;
  }

  /* Product list */
  .product-list-item {
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
  }

  .product-list-item h4 {
    font-size: 0.8rem;
  }

  /* Steps grid (cómo funciona) */
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .step-card {
    padding: 1rem;
  }

  .step-card h3 {
    font-size: 0.8rem;
  }

  .step-card p {
    font-size: 0.75rem;
  }

  /* Feature cards */
  .feature-card {
    padding: 1rem;
  }

  /* Footer */
  .footer-img {
    width: 60px;
  }

  .footer-inner {
    font-size: 0.7rem;
    gap: 0.5rem;
    padding: 0.8rem 0;
  }

  /* Modales */
  .modal {
    width: 95%;
    max-width: 95%;
  }

  .modal-header {
    padding: 0.7rem 0.8rem;
  }

  .modal-header h2 {
    font-size: 0.8rem;
  }

  .modal-body {
    padding: 0.8rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-actions .btn {
    width: 100%;
  }

  /* Toasts más estrechos */
  .toast-container {
    right: 0.5rem;
    left: 0.5rem;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }

  /* Dropdown en móvil */
  .dropdown-menu {
    min-width: 180px;
  }

  .dropdown-item {
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
  }

  /* Gear menu */
  .gear-menu {
    min-width: 150px;
  }

  .gear-menu .btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.7rem;
  }

  /* Secciones */
  .section-title {
    font-size: 1rem;
  }

  .section-head {
    gap: 0.5rem;
  }

  /* Empty state */
  .empty-state {
    padding: 1.5rem 1rem;
  }

  .empty-state p {
    font-size: 0.8rem;
  }

  /* Panel */
  .panel {
    padding: 0.8rem;
  }

  /* Checkbox más pequeño */
  .checkbox-custom .checkmark {
    width: 20px;
    height: 20px;
  }

  .checkbox-custom .checkmark::after {
    width: 5px;
    height: 8px;
    top: 2px;
    left: 6px;
  }

  /* Tabs */
  .friends-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
  }

  .share-tab {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  /* Search results */
  .search-result-item {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .search-result-nickname {
    font-size: 0.8rem;
  }

  .search-result-email {
    font-size: 0.7rem;
  }

  /* Badges */
  .badge {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  /* Cart badge en nav */
  .cart-badge {
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  /* Progress bar */
  .progress-text {
    font-size: 0.75rem;
  }

  /* Labels */
  label {
    font-size: 0.8rem;
  }

  /* Inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="file"],
  input[type="number"],
  textarea,
  select {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  /* Texto legible */
  .text-readable {
    font-size: 0.85rem;
  }

  .text-readable-sm {
    font-size: 0.8rem;
  }

  .text-readable-xs {
    font-size: 0.75rem;
  }

  .text-micro {
    font-size: 0.7rem;
  }

  /* List intro */
  .list-intro {
    font-size: 0.75rem;
  }

  /* Hero trust */
  .hero-trust span {
    font-size: 0.75rem;
  }

  /* Hero badge */
  .hero-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  /* Unauthorized / Offline */
  .unauthorized-container {
    padding: 2rem 0.5rem;
  }

  .unauthorized-container h1 {
    font-size: 1rem;
  }

  .offline-container {
    padding: 2rem 0.5rem;
  }

  .offline-container h1 {
    font-size: 1rem;
  }

  /* Email preview */
  .email-preview {
    padding: 0.8rem;
  }

  .email-preview h2 {
    font-size: 0.9rem;
  }

  .email-preview p {
    font-size: 0.8rem;
  }

  /* Create list sections */
  .create-list-section h3 {
    font-size: 0.8rem;
  }

  /* Add to cart form */
  .add-to-cart-form {
    gap: 0.3rem;
  }

  /* Actions row */
  .actions-row {
    gap: 0.3rem;
  }

  /* Alert */
  .alert {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }

  /* Confirm form */
  .confirm-form {
    display: block;
    width: 100%;
  }

  /* Inline form en móvil */
  .inline-form {
    display: block;
  }

  .inline-form .btn {
    width: 100%;
  }
}

/* ============================================================
   Responsive: Tablet (≤768px)
   ============================================================ */

@media (max-width: 768px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  .auth-container {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  .hero-banner img {
    height: 150px;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ============================================================
   End of styles
   ============================================================ */
