:root {
  --primary-color: #00bcd4;
  --primary-hover: #00acc1;
  --bg-color: #f4f7f9;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --header-bg: #1e293b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --border-radius: 10px;
  --transition: all 0.25s ease;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding-top: 90px;
  line-height: 1.6;
}

/* =====================
   NAVBAR (dark bar)
   ===================== */
.main-header {
  background: var(--header-bg);
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
  border-bottom: none;
  padding: 0;
  position: fixed;
  /* taller header to fit bigger logo */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-container img {
  height: 65px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 8px 16px;
  border-radius: 8px;
}

.nav-links a:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* =====================
   MAIN CONTAINER
   ===================== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 70px;
}

/* =====================
   CATEGORY CHIPS
   ===================== */
.category-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 28px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  padding: 8px 20px;
  background: #fff;
  border-radius: 50px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-color);
  border: 1.5px solid var(--border-color);
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
}

.category-chip.active,
.category-chip:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.25);
}

/* =====================
   SECTION TITLE
   ===================== */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 22px;
  color: var(--text-color);
}

/* =====================
   VIEW TOGGLE
   ===================== */
.view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  gap: 8px;
}

.toggle-btn {
  background: #fff;
  border: 1.5px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}

.toggle-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

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

.product-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.product-grid .product-card {
  display: flex;
  flex-direction: column;
}

.product-grid .product-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  border-color: var(--primary-color);
}

/* Square image for grid */
.product-grid .product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: #f1f5f9;
  display: block;
}

.product-grid .product-info {
  padding: 14px 16px;
}

.product-grid .product-category {
  display: none; /* Keep it clean in grid */
}

.product-grid .product-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-color);
}

.product-grid .product-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-grid .product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* =====================
   PRODUCT LIST
   ===================== */
.product-list {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

.product-list .product-card {
  display: flex;
  flex-direction: row;
  /* no fixed height - let content determine size */
  align-items: stretch;
  min-height: 140px;
}

.product-list .product-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: row;
  width: 100%;
  align-items: stretch;
}

.product-list .product-image {
  width: 170px;
  min-width: 170px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9;
  display: block;
  align-self: stretch;
}

.product-list .product-info {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.product-list .product-category {
  font-size: 0.73rem;
  text-transform: uppercase;
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: 1.2px;
  margin-bottom: 5px;
  display: block;
}

.product-list .product-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-color);
  display: block;
}

.product-list .product-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* make sure it's visible */
  visibility: visible;
  opacity: 1;
}

.product-list .product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

/* =====================
   PRODUCT DETAILS
   ===================== */
.product-details {
  display: flex;
  gap: 40px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

.details-gallery {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row-reverse; /* Pone imagen principal a la derecha, miniaturas a la izquierda */
  gap: 15px;
  align-items: flex-start;
}

.main-image-container {
  flex: 1;
  aspect-ratio: 1/1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: white;
  margin-bottom: 0px;
}

.main-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbnails-container {
  display: flex;
  flex-direction: column;
  width: 50px;
  gap: 12px;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 5px;
}

.thumb-item {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item.active {
  border-color: var(--primary-color);
}

.thumb-item:hover {
  border-color: var(--secondary-color);
}

.details-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

@media (max-width: 768px) {
  .product-details {
    flex-direction: column;
  }
  .details-gallery {
    width: 100%;
    flex-direction: column; /* Revertir a apilado vertical (imagen arriba, miniaturas abajo) */
    align-items: stretch;
  }
  .main-image-container {
    margin-bottom: 15px;
  }
  .thumbnails-container {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    padding-right: 0;
  }
}
.details-info .product-category {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: 1.5px;
}

.details-info .product-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 10px 0 5px;
  line-height: 1.2;
  color: var(--text-color);
}

.details-info .product-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 25px;
}

.details-description {
  margin-bottom: 30px;
  color: var(--text-color);
  flex: 1;
}

.details-description h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.btn-whatsapp-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25d366;
  color: white !important;
  padding: 15px 35px;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp-large:hover {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

/* =====================
   WHATSAPP FAB
   ===================== */
.whatsapp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #25d366;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.9rem;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: var(--transition);
}

.whatsapp-fab:hover {
  transform: scale(1.1);
  color: white;
}

/* =====================
   CATEGORY PAGE
   ===================== */
.category-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.category-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.category-tile:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 188, 212, 0.25);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  body { padding-top: 70px; }

  .navbar-container { height: 60px; }
  .logo-container img { height: 40px; }

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

  .product-list .product-card {
    height: auto;
    flex-direction: column;
  }
  .product-list .product-card a {
    flex-direction: column;
  }
  .product-list .product-image {
    width: 100%;
    height: 220px;
  }

  .product-details {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }
  .details-image {
    max-width: 100%;
  }
  .details-info .product-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .main-container {
    padding: 20px 12px 50px;
  }
}
