/* ============================================================
   ALIMENTOS BARCELONA — Estilos Compartidos
   ============================================================ */

/* ---- Variables ---- */
:root {
  --primary:    #122F71;
  --primary-dark: #0D1F4D;
  --accent:     #E0585B;
  --accent-dark: #C43F42;
  --white:      #FFFFFF;
  --light:      #F4F6FA;
  --gray:       #6B7280;
  --border:     #E5E7EB;
  --nav-h:      72px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: #1F2937;
  background: var(--white);
  padding-top: var(--nav-h);
}

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

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: transparent;
  transition: background 0.35s, box-shadow 0.35s;
}

#navbar.scrolled {
  background: var(--primary);
  box-shadow: 0 2px 16px rgba(18,47,113,0.25);
}

#navbar .nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#navbar .logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: white;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  filter: brightness(1.1) contrast(1.15);
  transition: filter 0.2s;
}

#navbar .logo-img:hover {
  filter: brightness(1.2) contrast(1.2);
}

#navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0; padding: 0;
}

#navbar .nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 4px;
}

#navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}

#navbar .nav-links a:hover::after,
#navbar .nav-links a.active::after { width: 100%; }

#navbar .nav-links a.active { color: var(--accent); }

/* Hamburger */
#menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

#menu-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

#menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
#mobile-menu {
  display: none;
  background: var(--primary-dark);
  padding: 1.25rem 1.5rem 1.5rem;
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#mobile-menu.open { display: block; }

#mobile-menu ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#mobile-menu ul li a {
  display: block;
  padding: 0.85rem 0;
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s, padding-left 0.2s;
}

#mobile-menu ul li a:hover { color: var(--accent); padding-left: 0.5rem; }

/* ============================================================
   PAGE HERO (interior pages)
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  color: var(--white);
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.page-hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto;
}

/* ============================================================
   SECTION UTILITIES
   ============================================================ */
.section-pad { padding: 5rem 1.5rem; }

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

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.75;
  max-width: 640px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.875rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(224,88,91,0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(224,88,91,0.45);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.875rem 2rem;
  border-radius: 4px;
  border: 2px solid var(--white);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.875rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-secondary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(18,47,113,0.08);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(18,47,113,0.16);
}

.product-card .card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.5s;
}

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

.card-img-wrap { overflow: hidden; }

.product-card .card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.product-card .card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.product-card .card-sizes {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-card .card-desc {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.5;
}

/* ============================================================
   CATEGORY TABS
   ============================================================ */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.25rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
  background: var(--primary);
  color: var(--white);
  padding: 3rem 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.stat-num {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--primary-dark);
  color: var(--white);
}

.footer-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
}

.footer-brand .logo-img { height: 52px; margin-bottom: 1.25rem; }

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  opacity: 0.75;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col ul a {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col ul a:hover { color: var(--white); }

.footer-contact { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-contact .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}

.footer-contact .contact-item svg { flex-shrink: 0; margin-top: 2px; }

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-link {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--white);
  background: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================================
   WHATSAPP FLOATING BTN
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 900;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37,211,102,0.5);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(37,211,102,0.65);
}

/* ============================================================
   FORM STYLES
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1F2937;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18,47,113,0.12);
}

.form-input.error, .form-textarea.error { border-color: var(--accent); }

.form-error {
  font-size: 0.775rem;
  color: var(--accent);
  font-weight: 500;
  display: none;
}

.form-error.visible { display: block; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img { transform: scale(1.07); }

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 6px;
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
}

#lightbox-close:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

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

@media (max-width: 640px) {
  body { padding-top: var(--nav-h); }

  .section-pad { padding: 3.5rem 1rem; }

  #menu-toggle { display: flex; }

  #navbar .nav-links { display: none; }

  .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .footer-main {
    grid-template-columns: 1fr;
    padding: 2.5rem 1rem 2rem;
    gap: 2rem;
  }

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

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  .tab-nav { gap: 0.25rem; }
  .tab-btn { font-size: 0.75rem; padding: 0.6rem 0.75rem; }
}
