/* ═══════════════════════════════════════
   ALFA DOMICILIOS v3 — Light Enterprise
   Mobile-First · Clean · Conversion
   ═══════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --bg: #f4f6fb;
  --bg-white: #ffffff;
  --bg-elevated: #f9fafb;
  --surface: #eef1f8;
  --border: rgba(0, 0, 0, .07);
  --border-hover: rgba(99, 102, 241, .3);
  --text: #111827;
  --text-sec: #4b5563;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-soft: rgba(99, 102, 241, .08);
  --accent-glow: rgba(99, 102, 241, .18);
  --green: #059669;
  --green-bg: rgba(5, 150, 105, .08);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, .06);
  --yellow: #d97706;
  --wa: #25d366;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xl: 20px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, .08);
  --shadow-xl: 0 8px 40px rgba(0, 0, 0, .1);
  --transition: all .25s cubic-bezier(.4, 0, .2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none
}

/* ═══ NAVBAR ═══ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: var(--transition)
}

.navbar.scrolled {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 12px rgba(0, 0, 0, .06)
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap
}

.nav-brand span {
  font-size: 1.3rem
}

.nav-links {
  display: none;
  gap: 24px;
  align-items: center
}

.nav-links a {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-sec);
  transition: var(--transition)
}

.nav-links a:hover {
  color: var(--accent)
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 9px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .82rem;
  box-shadow: 0 2px 12px var(--accent-glow);
  transition: var(--transition)
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
  background: var(--accent-light)
}

@media(min-width:768px) {
  .nav-links {
    display: flex
  }
}

/* ═══ HERO ═══ */
.hero-v2 {
  padding: 100px 20px 48px;
  text-align: center;
  background: var(--bg-white);
  position: relative;
  border-bottom: 1px solid var(--border)
}

.hero-v2 h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -.03em
}

.hero-v2 h1 .highlight {
  color: var(--accent)
}

.hero-sub {
  font-size: clamp(.9rem, 2.2vw, 1.05rem);
  color: var(--text-sec);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.6
}

/* Action Selector */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 0 auto 28px
}

.action-card {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition)
}

.action-card:hover,
.action-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 20px var(--accent-glow)
}

.action-card .ac-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  display: block
}

.action-card .ac-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text)
}

.action-card .ac-sub {
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: 1px
}

/* Hero Search */
.hero-search {
  max-width: 480px;
  margin: 0 auto 20px;
  position: relative
}

.hero-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 13px 18px 13px 44px;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: var(--transition)
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-white)
}

.hero-search input::placeholder {
  color: var(--text-muted)
}

.hero-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding-top: 16px
}

.hero-stat-v {
  text-align: center
}

.hero-stat-v .val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent)
}

.hero-stat-v .lbl {
  font-size: .65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 2px;
  font-weight: 600
}

/* ═══ CATEGORIES ═══ */
.categories-bar-v2 {
  position: sticky;
  top: 52px;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0
}

.categories-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none
}

.categories-scroll::-webkit-scrollbar {
  display: none
}

.cat-chip-v2 {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-sec);
  transition: var(--transition);
  flex-shrink: 0
}

.cat-chip-v2:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.cat-chip-v2.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow)
}

/* ═══ RESTAURANT SECTION ═══ */
.restaurants-section {
  padding: 28px 20px 60px;
  max-width: 1200px;
  margin: 0 auto
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px
}

.section-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text)
}

.section-head .count-tag {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 50px;
  font-weight: 600
}

/* ═══ CARD — Compact Horizontal on mobile, Grid on desktop ═══ */
.r-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px
}

@media(min-width:600px) {
  .r-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(min-width:960px) {
  .r-grid {
    grid-template-columns: repeat(4, 1fr)
  }
}

.r-card-v2 {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: row
}

.r-card-v2:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px)
}

@media(min-width:600px) {
  .r-card-v2 {
    flex-direction: column
  }
}

/* Image — small thumbnail on mobile, proportional on desktop */
.r-card-img-v2 {
  position: relative;
  width: 110px;
  min-height: 110px;
  flex-shrink: 0;
  overflow: hidden;
  display: block
}

.r-card-img-v2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease
}

.r-card-v2:hover .r-card-img-v2 img {
  transform: scale(1.05)
}

@media(min-width:600px) {
  .r-card-img-v2 {
    width: 100%;
    height: 150px;
    min-height: auto
  }
}

.badge-status {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 50px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase
}

.badge-open {
  background: var(--green);
  color: #fff
}

.badge-closed {
  background: rgba(0, 0, 0, .5);
  color: #ddd;
  backdrop-filter: blur(4px)
}

.badge-cat {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .6rem;
  font-weight: 600;
  backdrop-filter: blur(4px)
}

.badge-popular {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .58rem;
  font-weight: 700
}

/* Body */
.r-card-body-v2 {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0
}

.r-card-name {
  font-size: .92rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.r-card-address {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.r-card-address i {
  margin-right: 3px;
  font-size: .65rem
}

.r-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px
}

.r-meta-tag {
  font-size: .65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-sec)
}

.r-meta-tag i {
  margin-right: 2px
}

.r-meta-tag.time {
  color: var(--accent);
  background: var(--accent-soft)
}

.r-card-actions {
  display: flex;
  gap: 6px
}

.r-btn-v2 {
  flex: 1;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px
}

.r-btn-primary-v2 {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow)
}

.r-btn-primary-v2:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow)
}

.r-btn-primary-v2.disabled {
  opacity: .3;
  pointer-events: none
}

.r-btn-secondary-v2 {
  background: var(--surface);
  color: var(--text-sec);
  border: 1px solid var(--border)
}

.r-btn-secondary-v2:hover {
  border-color: var(--accent);
  color: var(--accent)
}

/* ═══ SERVICES ═══ */
.services-v2 {
  padding: 48px 20px;
  max-width: 1200px;
  margin: 0 auto
}

.services-v2 .section-head {
  text-align: center;
  flex-direction: column
}

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 20px
}

.svc-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  transition: var(--transition)
}

.svc-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow)
}

.svc-card .svc-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block
}

.svc-card h3 {
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text)
}

.svc-card p {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1.4
}

/* ═══ FOOTER ═══ */
.footer-v2 {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 32px 20px 20px;
  text-align: center
}

.footer-v2 h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px
}

.footer-v2 p {
  font-size: .78rem;
  color: var(--text-muted)
}

/* ═══ FLOATING WA ═══ */
.wa-float-v2 {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90
}

.wa-float-v2 a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, .35);
  transition: var(--transition);
  animation: waPulse 2.5s ease infinite
}

.wa-float-v2 a:hover {
  transform: scale(1.08)
}

@keyframes waPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, .35)
  }

  50% {
    box-shadow: 0 4px 32px rgba(37, 211, 102, .6)
  }
}

/* ═══ SCROLL TOP ═══ */
.scroll-top-v2 {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 90;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: var(--transition);
  box-shadow: var(--shadow)
}

.scroll-top-v2.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto
}

.scroll-top-v2:hover {
  border-color: var(--accent);
  color: var(--accent)
}

/* ═══ EMPTY ═══ */
.empty-v2 {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted)
}

.empty-v2 i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
  opacity: .3
}

.empty-v2 h3 {
  color: var(--text);
  margin-bottom: 4px
}

/* ═══ ANIMATIONS ═══ */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0)
}

/* ═══ SAFE AREA ═══ */
@supports(padding:env(safe-area-inset-bottom)) {
  .footer-v2 {
    padding-bottom: calc(20px + env(safe-area-inset-bottom))
  }

  .wa-float-v2 {
    bottom: calc(20px + env(safe-area-inset-bottom))
  }

  .scroll-top-v2 {
    bottom: calc(20px + env(safe-area-inset-bottom))
  }
}