/* ====================================================== */
/* COMPONENT: CATEGORY & OWNER CARDS (ENLARGED & OPTIMIZED) */
/* ====================================================== */

.categories-section {
  padding: 2rem 0;
  width: 100%;
}

.categories-section h2 {
  text-align: left !important;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--th-text-dark) !important;
}

/* Grid Wrapper - Enlarged desktop minmax from 220px to 255px */
.categories-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

/* Individual Category Card - Ascultă de fundalul central */
.category-card {
  background-color: var(--th-bg-header) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--th-primary) !important; /* Folosește culoarea primară centrală (roșu) */
}

/* Image Wrapper Box - Folosește nuanțele din paleta centrală */
.category-card-img-wrap, 
.owner-card-img-wrap {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
  background-color: var(--th-input-bg) !important;
  border-radius: 10px;
  border: 1px solid var(--th-border);
}

.category-card-img-wrap img,
.owner-card-img-wrap img,
.category-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.category-card:hover .category-card-img-wrap img,
.category-card:hover img {
  transform: scale(1.04);
}

/* Category Title - Ascultă de textul verde închis central */
.category-card h3,
.owner-card-item h3 {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--th-text-dark) !important;
  line-height: 1.3;
  margin: 0;
  text-align: left !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

.product-fire-badge {
 position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: var(--th-primary); /* Roșu din stiluri centrale */
  color: var(--th-text-light);          /* Text galben */
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
}

/* Mobile Adjustments - Optimized for long names like Laptops & Smartphones */
@media (max-width: 576px) {
  .categories-cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .category-card {
    padding: 0.75rem;
  }
  .category-card-img-wrap,
  .owner-card-img-wrap {
    height: 105px;
    margin-bottom: 0.5rem;
  }
  .category-card h3,
  .owner-card-item h3 {
    font-size: 0.86rem;
    line-height: 1.2;
  }
}

/* ====================================================== */
/* ACTUALIZARE FUNDAL CATEGORII (FĂRĂ ALB)                */
/* ====================================================== */

/* Containerul principal al secțiunii de categorii */
.categories-main-card {
    background-color: var(--th-bg-header) !important;
    border: 1px solid var(--th-border) !important;
}

.categories-section {
    background-color: var(--th-bg-header) !important;
    border-color: var(--th-border) !important;
}

/* Cardul individual de categorie preia o nuanță caldă de crem/galben în loc de alb */
.category-card {
background-color: var(--th-bg-header) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--th-primary) !important;
}

/* Cadrul imaginii din interiorul cardului */
.category-card-img-wrap {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
background-color: var(--th-input-bg) !important;
  border-radius: 10px;
  border: 1px solid var(--th-border);
}
/* Corectare înălțime carduri categorii pe mobil */
@media (max-width: 576px) {
  .categories-cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem; /* Redus de la 0.75rem pentru a economisi spațiu */
  }
  
  .category-card {
    padding: 0.5rem !important; /* Padding redus compact */
    height: auto !important;     /* Eliminăm întinderea forțată la 100% */
  }
  
  .category-card-img-wrap,
  .owner-card-img-wrap {
    height: 85px !important;     /* Redus de la 105px ca să nu mai fie așa înalte */
    margin-top: 0.15rem;
    margin-bottom: 0.4rem;
  }
  
  .category-card h3,
  .owner-card-item h3 {
    font-size: 0.8rem !important;  /* Text ușor mai compact pe mobil */
    line-height: 1.15;
  }
}