* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue-dark: #0b132b;
  --blue-base: #1c2541;
  --blue-accent: #3a86ff;

  --text-main: #ffffff;
  --text-secondary: #cbd5e1;

  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e5e7eb;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, sans-serif;
  background-color: var(--blue-dark);
  color: var(--text-main);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ===============================
   HEADER
=============================== */
.header {
  height: 125px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--blue-dark);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-img {
  height: 150px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.header-right {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.bsd-hebrew {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 12px;
  color: #9ca3af;
}

/* ===============================
   HERO
=============================== */
.hero {
  position: relative;
  margin-top: 125px;
  min-height: calc(100vh - 125px);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(11, 19, 43, 0.88) 0%,
    rgba(11, 19, 43, 0.62) 48%,
    rgba(11, 19, 43, 0.25) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(1280px, 94vw);
  min-height: calc(100vh - 125px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 32px 0;
}

.hero-text {
  max-width: 560px;
}

.hero-text h1 {
  font-size: clamp(34px, 4.3vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.hero-services {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
}

.service-card {
  width: clamp(170px, 18vw, 240px);
  height: clamp(170px, 18vw, 240px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
    circle at top,
    rgba(58, 134, 255, 0.3),
    rgba(11, 19, 43, 0.9)
  );
  box-shadow:
    inset 0 0 24px rgba(58, 134, 255, 0.18),
    0 0 30px rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow:
    0 0 30px rgba(58, 134, 255, 0.45),
    0 0 60px rgba(58, 134, 255, 0.15);
}

.service-card img {
  width: clamp(88px, 9vw, 150px);
  height: clamp(88px, 9vw, 150px);
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(58, 134, 255, 0.8));
}

.service-card span {
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(13px, 1.15vw, 17px);
  line-height: 1.15;
  letter-spacing: 0.8px;
}

/* ===============================
   BOTONES FLOTANTES
=============================== */
.whatsapp-floating {
  all: unset;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
}

.whatsapp-floating img {
  width: 28px;
  height: 28px;
}

.back-to-services {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: none;
  padding: 12px 20px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

.back-to-services:hover {
  transform: translateY(-2px);
  background: #1f2937;
}

/* ===============================
   MAIN TIENDA
=============================== */
.main {
  display: none;
  grid-template-columns: 240px 1fr 320px;
  gap: 16px;
  padding: 16px;
  margin-top: 125px;
  min-height: calc(100vh - 125px);
  align-items: start;
}

/* ===============================
   SIDEBAR
=============================== */
.sidebar {
  background: var(--surface);
  color: var(--text-dark);
  padding: 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 141px;
}

.sidebar h2 {
  font-size: 20px;
  color: var(--blue-dark);
  margin-bottom: 14px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-dark);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar li:hover {
  background: #eef2ff;
}

.sidebar li.active {
  background: #111827;
  color: #fff;
}

/* ===============================
   PRODUCTOS
=============================== */
.products-section {
  background: var(--surface);
  color: var(--text-dark);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.products-header {
  position: sticky;
  top: 141px;
  z-index: 10;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 4px;
  padding-bottom: 16px;
  margin-bottom: 12px;
}

#section-title {
  grid-column: 1;
  grid-row: 1;
  color: var(--blue-dark);
  margin: 0;
}

.section-subtitle {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

#search-input {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  outline: none;
  font-size: 14px;
}

#search-input:focus {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.15);
}

#products-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  color: var(--text-dark);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.product-img {
  height: 180px;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-card h3 {
  font-size: 16px;
  color: var(--text-dark);
}

.product-card p {
  font-size: 14px;
  color: #374151;
  line-height: 1.45;
}

.product-card button {
  margin-top: auto;
  align-self: stretch;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

.product-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #0f172a;
}

.product-card button:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.stock-ok {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.stock-out {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.stock-low {
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
}

.empty-products {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.products-footer {
  margin-top: 28px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ===============================
   CARRITO
=============================== */
.cart-section {
  background: var(--surface);
  color: var(--text-dark);
  padding: 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 141px;
}

.cart-section h2 {
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.cart-section p,
#cart-total {
  color: var(--blue-dark);
  font-weight: 700;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cart-qty-controls {
  display: flex;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #e5e7eb;
  cursor: pointer;
}

.qty-number {
  min-width: 18px;
  text-align: center;
}

.clear-cart-btn {
  margin: 12px auto 0;
  display: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  cursor: pointer;
  color: #374151;
}

.whatsapp-btn {
  margin-top: 12px;
  width: 100%;
  padding: 16px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.cart-divider {
  margin: 18px 0 14px;
  border: none;
  height: 1px;
  background: var(--border);
}

.delivery-note {
  margin-top: 14px;
  text-align: center;
}

.delivery-title {
  font-size: 15px;
  font-weight: 700;
  color: #065f46;
}

.delivery-subtitle {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #047857;
}

/* ===============================
   FOOTER
=============================== */
.footer {
  background-color: var(--blue-dark);
  margin-top: 10px;
  padding: 40px 20px 24px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-col h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 14px;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.footer-areas {
  margin-top: 10px;
  font-weight: 600;
  color: var(--blue-accent);
}

.footer-copy {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 16px 24px;
}

/* ===============================
   PRODUCT DETAIL
=============================== */
.product-detail-page {
  margin-top: 125px;
  min-height: calc(100vh - 125px);
  padding: 32px;
  background: var(--blue-dark);
}

.product-detail-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.product-detail-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.product-detail-gallery {
  background: #f8fafc;
  border-radius: 16px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail-gallery img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-detail-category {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.product-detail-title {
  font-size: 36px;
  line-height: 1.1;
  color: var(--blue-dark);
  margin-bottom: 14px;
}

.product-detail-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.product-detail-stock {
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 700;
}

.product-detail-description-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 10px;
}

.product-detail-description {
  font-size: 15px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 28px;
}

.product-detail-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.product-detail-btn,
.product-detail-btn-secondary {
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-detail-btn {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
}

.product-detail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.product-detail-btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.product-detail-btn-secondary:hover {
  transform: translateY(-2px);
}

.product-detail-loading,
.product-detail-error {
  background: #fff;
  color: #111827;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  font-weight: 600;
  max-width: 900px;
  margin: 0 auto;
}

/* ===============================
   MOBILE
=============================== */
@media (max-width: 980px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .hero-text {
    max-width: 700px;
  }

  .hero-services {
    justify-content: center;
    flex-wrap: wrap;
  }

  .main {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .cart-section {
    position: static;
  }
}

@media (max-width: 768px) {
  .header {
    height: 82px;
    padding: 0 14px;
    justify-content: center;
  }

  .logo {
    justify-content: center;
    gap: 8px;
  }

  .logo-img {
    height: 74px;
  }

  .logo-text {
    font-size: 24px;
  }

  .header-right {
    display: none;
  }

  .bsd-hebrew {
    top: 6px;
    right: 10px;
    font-size: 11px;
  }

  .hero {
    margin-top: 82px;
    min-height: calc(100vh - 82px);
  }

  .hero-content {
    min-height: calc(100vh - 82px);
    width: min(94vw, 560px);
    gap: 24px;
    padding: 26px 0;
  }

  .hero-text h1 {
    font-size: 34px;
    text-align: center;
  }

  .hero-services {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .service-card {
    width: min(42vw, 180px);
    height: min(42vw, 180px);
    padding: 14px;
  }

  .service-card img {
    width: 72px;
    height: 72px;
  }

  .service-card span {
    font-size: 12px;
    line-height: 1.1;
  }

  .main {
    margin-top: 82px;
    padding: 10px;
    min-height: calc(100vh - 82px);
  }

  .sidebar {
    display: none;
  }

  .cart-section {
    display: none;
  }

  .products-section {
    padding: 12px;
    border-radius: 14px;
  }

  .products-header {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 0;
  }

  #section-title {
    text-align: center;
  }

  .section-subtitle {
    text-align: center;
  }

  #search-input {
    width: 100%;
    max-width: none;
  }

  #products-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card {
    padding: 12px;
    border-radius: 14px;
  }

  .product-img {
    height: 130px;
  }

  .product-card h3 {
    font-size: 14px;
  }

  .product-card p {
    font-size: 12px;
  }

  .product-card button {
    padding: 10px;
    font-size: 13px;
  }

  .products-footer {
    font-size: 12px;
    margin-top: 24px;
  }

  .back-to-services {
    bottom: 18px;
    left: 14px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .whatsapp-floating {
    width: 54px;
    height: 54px;
    bottom: 18px;
    right: 14px;
  }

  .footer {
    padding: 34px 16px 20px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }

  .product-detail-page {
    margin-top: 82px;
    min-height: calc(100vh - 82px);
    padding: 14px;
  }

  .product-detail-card {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 18px;
  }

  .product-detail-gallery {
    min-height: 260px;
  }

  .product-detail-title {
    font-size: 26px;
  }

  .product-detail-price {
    font-size: 24px;
  }

  .product-detail-actions {
    flex-direction: column;
  }

  .product-detail-btn,
  .product-detail-btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 28px;
  }

  .service-card {
    width: min(44vw, 160px);
    height: min(44vw, 160px);
  }

  .service-card img {
    width: 64px;
    height: 64px;
  }

  #products-container {
    grid-template-columns: 1fr 1fr;
  }

  .product-img {
    height: 118px;
  }

  .product-card h3 {
    font-size: 13px;
  }

  .product-card p {
    font-size: 11px;
  }
}
/* ===============================
   CARRITO MÓVIL - AJUSTE FINAL
=============================== */
.cart-floating-btn {
  position: fixed;
  bottom: 90px;
  right: 14px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #111827;
  color: white;
  border: none;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.cart-floating-btn span {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc2626;
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 22px;
  text-align: center;
}

.cart-mobile-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 10000;
  display: none;
}

.cart-mobile-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  border-radius: 18px 18px 0 0;
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 769px) {
  .cart-floating-btn,
  .cart-mobile-panel {
    display: none !important;
  }
}
/* =========================================
   AJUSTE DESKTOP FINAL
   - Home sin scroll
   - Footer fijo abajo
   - Secciones con scroll solo en productos
========================================= */

@media (min-width: 769px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    display: block;
  }

  /* -----------------------------
     HOME / HERO
  ----------------------------- */
  .hero {
    margin-top: 125px;
    height: calc(100vh - 125px - 90px); /* header + footer */
    min-height: unset;
    overflow: hidden;
  }

  .hero-content {
    min-height: 100%;
    height: 100%;
    align-items: center;
  }

  /* Footer fijo solo para home */
  .footer {
    position: fixed;
    left: 0;
    bottom: 28px;
    width: 100%;
    margin-top: 0;
    padding: 18px 20px 10px;
    z-index: 20;
    background: transparent;
    pointer-events: none;
  }

  .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    pointer-events: auto;
  }

  .footer-copy {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 6px 16px 10px;
    background: transparent;
    z-index: 20;
    text-align: center;
    pointer-events: none;
  }

  /* Cuando estamos dentro de la tienda, ocultamos footer */
  .main[style*="display: grid"] ~ .footer,
  .main[style*="display:grid"] ~ .footer,
  .main[style*="display: block"] ~ .footer,
  .main[style*="display:block"] ~ .footer,
  .main[style*="display: flex"] ~ .footer,
  .main[style*="display:flex"] ~ .footer,
  .main[style*="display: grid"] ~ .footer-copy,
  .main[style*="display:grid"] ~ .footer-copy,
  .main[style*="display: block"] ~ .footer-copy,
  .main[style*="display:block"] ~ .footer-copy,
  .main[style*="display: flex"] ~ .footer-copy,
  .main[style*="display:flex"] ~ .footer-copy {
    display: none;
  }

  /* -----------------------------
     TIENDA / SECCIONES
  ----------------------------- */
  .main {
    margin-top: 125px;
    height: calc(100vh - 125px);
    min-height: unset;
    overflow: hidden;
    align-items: stretch;
  }

  .sidebar {
    height: calc(100vh - 125px - 32px);
    overflow-y: auto;
    position: sticky;
    top: 16px;
  }

  .cart-section {
    height: calc(100vh - 125px - 32px);
    overflow-y: auto;
    position: sticky;
    top: 16px;
  }

  .products-section {
    height: calc(100vh - 125px - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .products-header {
    position: sticky;
    top: 0;
    z-index: 15;
    flex-shrink: 0;
    background: white;
  }

  #products-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start;
  }

  .products-footer {
    flex-shrink: 0;
    margin-top: 14px;
  }

  /* Detalle de producto en desktop: sí puede usar scroll interno */
  .product-detail-page {
    margin-top: 125px;
    height: calc(100vh - 125px);
    min-height: unset;
    overflow-y: auto;
  }
}