/* assets/css/pages/index.css */
/* Estilos de buscador (aunque compartirá con prod_details)
    prods destacados, futuros anuncios comercios locales, etc. */

/* ================================
   HERO SECTION
   ================================ */
.hero {
  position: relative;
  height: 400px;
  background: url('/assets/images/front-img.webp') center/cover no-repeat;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 0 2rem;
}

.hero-overlay h1 {
  font-size: 2.5rem;
}

.hero-overlay span {
  color: #b2dfdb;
}

.hero-overlay p {
  margin-top: 1rem;
  font-size: 1.2rem;
  max-width: 800px;
  padding: 0 1rem;
}

/* ================================
   HOW TO USE SECTION
   ================================ */
.how-to-use {
  background-color: #e0f2f1;
  border-radius: 8px;
  margin-top: 2rem;
}

.how-to-use h2 {
  margin-bottom: 1rem;
  margin-top: 1rem;
}


/* ================================
   SEARCH ENGINE
   ================================ */
.search input {
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #00796b;
  border-radius: 8px;
  outline: none;
}

.search input:focus {
  border-color: #004d40;
  box-shadow: 0 0 8px rgba(0, 77, 64, 0.5);
}

.btn-2 {
  margin: 2rem auto;
  background: #00796b;
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
  text-align: center;
}

.btn-2:hover {
  background: #004d40;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
}

#search-button {
  background: #00796b;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

#search-button:hover {
  background: #004d40;
}

.filters {
  background-color: #e0f2f1;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 15px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filters.hidden {
  display: none;
}

.filters h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #004d40;
  font-size: 1.1rem;
}

.filters-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filters-super h4,
.filters-tags h4,
.filters-sort h4 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: #004d40;
  font-size: 1rem;
  font-weight: 600;
}

.filters-super {
  flex: 1 1 320px;
}

.filters-tags {
  flex: 1 1 280px;
}

.filters-sort {
  flex: 1 1 180px;
}

.options-group.super-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.options-group.super-grid label {
  flex: 1 1 calc(50% - 1rem);
  box-sizing: border-box;
}

.options-group.tags-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.options-group.tags-grid label {
  flex: 1 1 calc(50% - 1rem);
  box-sizing: border-box;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.options-group label,
.options-group.super-grid label,
.options-group.tags-grid label {
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000;
  padding-left: 5px;
  white-space: nowrap;
}

.filters input[type="checkbox"],
.filters input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #00796b;
  cursor: pointer;
  margin: 0;
}

.btn-filter {
  display: block;
  margin: 1.5rem auto 0;
  background: #00796b;
  color: #fff;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-filter:hover {
  background: #004d40;
}

@media (max-width: 768px) {
  .filters-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }

  .filters-super,
  .filters-tags,
  .filters-sort {
    flex: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .options-group,
  .options-group.super-grid,
  .options-group.tags-grid {
    gap: 0.3rem !important;
    margin-bottom: 0.5rem !important;
  }
}

.hidden {
  display: none;
}

.btn-toggle {
  background: #00796b;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin-left: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-toggle:hover {
  background: #004d40;
}

.spinner-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #004d40;
}

.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-left-color: #00796b;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#btn-scroll-up {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #00796b;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.8rem;
  cursor: pointer;
  z-index: 999;
}

#btn-scroll-up:hover {
  background: #004d40;
}

#btn-scroll-up:active {
  background: #00796b;
}

#btn-scroll-up img {
  display: block;
  width: 28px;
  height: 28px;
  filter: invert(1);
}

/* ================================
   PRODUCT BOXES
     - used in searches, etc.
   ================================ */
.box-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%; 
}

.clicable {
  cursor: pointer;
  transition: opacity 0.2s;
}

.clicable:hover {
  opacity: 0.8;
}

.box-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
} 

.box img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  margin: 0 auto 15px auto;
}

.image-container {
  position: relative;
  display: block;
}

.card-tags {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.card-tag-icon {
  background-color: rgba(241, 248, 233, 0.95);
  border: 1px solid #c5e1a5;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.card-tag-icon:hover {
  transform: scale(1.1);
}

.box h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: #222;
  line-height: 1.3;
  
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  
  min-height: 2.8rem; 
}

.box p {
  margin-bottom: 5px;
  color: #555;
  font-size: 0.95rem;
}

.add-to-list {
  margin-top: 10px;
  background: #00796b;
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
  
  align-self: center;
}

.add-to-list:hover {
  background: #004d40;
}

/* =======================================
   HORIZONTAL SCROLL OFERTS
   ======================================= */
.offers-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  max-width: 100%;
  scroll-behavior: auto !important;
}

.offers-container::-webkit-scrollbar {
  height: 8px;
}

.offers-container::-webkit-scrollbar-thumb {
  background: #00796b;
  border-radius: 4px;
}

.offers-container.scrolling {
  cursor: grabbing;
  user-select: none;
}

.offer-box {
  flex: 0 0 auto;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.offer-box img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* =========================================
   OFFER CARDS STYLE
   ========================================= */
.badge-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.price-drop-badge {
    background-color: #16a34a;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-shadow: 0px 1px 2px rgba(0,0,0, 0.15);
}

.old-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
}

.new-price {
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
}

.offer-box, .producto {
    position: relative;
    overflow: hidden;
}

/* ================================
   SEO CONTENT SECTION (AdSense)
   ================================ */
.seo-content {
  margin-top: 3rem;
  margin-bottom: 4rem;
  padding: 1rem;
}

.seo-content h2, 
.seo-content h3, 
.seo-content p,
.seo-content ul {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.seo-content h2, 
.seo-content h3 {
  color: #00796b;
  margin-bottom: 1.2rem;
  margin-top: 2rem;
}

.seo-content h2:first-child {
  margin-top: 1rem;
}

.seo-content p {
  text-align: justify;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1.05rem;
  color: #333333;
}

.seo-content a {
  color: #00796b;
  text-decoration: underline;
  font-weight: bold;
}

.seo-content a:hover {
  color: #004d40;
}