/* 
 * CSS dedicat pentru pagina Products
 * Optimizat pentru desktop și mobile - similar cu home.css
 */

/* Reset și variabile */
:root {
  --products-primary: #005eb8;
  --products-secondary: #6f2dbd;
  --products-accent: #ef3340;
  --products-dark: #002b5c;
  --products-light: #f5f7fa;
  --products-white: #ffffff;
  --products-text: #1a1a1a;
  --products-text-light: #6c757d;
  --products-border: #e0e0e0;
}

/* Container principal */
.products-main-wrapper {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  width: 100%;
  overflow-x: hidden;
  min-height: 50vh;
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */
.products-filters {
  background: var(--products-white);
  border: 1px solid var(--products-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.products-filters-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--products-dark);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.products-filters-section {
  margin-bottom: 1.5rem;
}

.products-filters-section:last-child {
  margin-bottom: 0;
}

.products-filters-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--products-text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--products-border);
}

.products-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.products-category-item {
  margin-bottom: 0.5rem;
}

.products-category-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: var(--products-text);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 100;
}

.products-category-link:hover {
  background: var(--products-light);
  color: var(--products-primary);
}

.products-category-link.active {
  background: var(--products-primary);
  color: var(--products-white);
  font-weight: 600;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--products-border);
}

.products-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--products-dark);
  margin-bottom: 0.5rem;
}

.products-count {
  color: var(--products-text-light);
  font-size: 0.95rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.products-card {
  background: var(--products-white);
  border: 1px solid var(--products-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.products-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.products-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: var(--products-light);
}

.products-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.products-card:hover .products-card-image {
  transform: scale(1.05);
}

.products-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.products-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--products-text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  pointer-events: auto;
  cursor: pointer;
}

.products-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 100;
}

.products-card-title a:hover {
  color: var(--products-primary);
}

.products-card-description {
  color: var(--products-text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.products-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--products-border);
}

.products-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--products-primary);
}

.products-card-btn {
  background: var(--products-primary);
  color: var(--products-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  position: relative;
  z-index: 100;
}

.products-card-btn:hover {
  background: var(--products-dark);
  transform: translateY(-2px);
}

.products-card-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.products-card-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.products-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--products-light);
  border-radius: 8px;
  margin: 2rem 0;
}

.products-empty-icon {
  font-size: 4rem;
  color: var(--products-text-light);
  margin-bottom: 1.5rem;
}

.products-empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--products-text);
  margin-bottom: 1rem;
}

.products-empty-text {
  color: var(--products-text-light);
  margin-bottom: 2rem;
}

.products-empty-btn {
  background: var(--products-primary);
  color: var(--products-white);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 100;
}

.products-empty-btn:hover {
  background: var(--products-dark);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--products-white);
}

/* ============================================
   SEARCH FORM
   ============================================ */
.products-search-form {
  margin-bottom: 1.5rem;
}

.products-search-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--products-border);
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
  pointer-events: auto;
}

.products-search-btn {
  width: 100%;
  background: var(--products-primary);
  color: var(--products-white);
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  position: relative;
  z-index: 100;
}

.products-search-btn:hover {
  background: var(--products-dark);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
#scroll__top {
  position: fixed !important;
  bottom: 100px;
  right: 30px;
  width: 4.3rem;
  height: 4.3rem;
  background: var(--products-primary);
  color: var(--products-white);
  border: none;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(50px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 22px rgba(0, 0, 0, 0.16);
  pointer-events: auto !important;
}

#scroll__top.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

#scroll__top:hover {
  background: var(--products-dark);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#scroll__top.active:hover {
  transform: translateY(-3px);
}

#scroll__top svg {
  width: 25px;
  height: 25px;
}

/* ============================================
   RESPONSIVE - TABLET (768px - 991px)
   ============================================ */
@media only screen and (max-width: 991.98px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .products-filters {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================ */
@media only screen and (max-width: 767.98px) {
  .products-main-wrapper {
    padding-bottom: 100px !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Asigură că toate elementele din main sunt clickable pe mobile */
  .products-main-wrapper * {
    pointer-events: auto !important;
  }
  
  .products-main-wrapper a,
  .products-main-wrapper button,
  .products-main-wrapper input,
  .products-main-wrapper select,
  .products-main-wrapper textarea {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 100 !important;
  }
  
  /* Asigură că toolbar-ul rămâne fixat în partea de jos */
  .offcanvas__stikcy--toolbar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: var(--products-white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: block !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
  
  .products-title {
    font-size: 1.5rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .products-card-image-wrapper {
    height: 180px;
  }
  
  .products-card-body {
    padding: 1rem;
  }
  
  .products-card-title {
    font-size: 1rem;
  }
  
  .products-card-price {
    font-size: 1.25rem;
  }
  
  .products-card-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .products-card-btn span {
    display: none;
  }
  
  .products-filters {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  
  .products-filters-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .products-empty {
    padding: 2rem 1rem;
  }
  
  .products-empty-icon {
    font-size: 3rem;
  }
  
  .products-empty-title {
    font-size: 1.25rem;
  }
  
  /* Butonul scroll to top pe mobile */
  #scroll__top {
    bottom: 100px !important;
    right: 20px !important;
    width: 3.5rem;
    height: 3.5rem;
    z-index: 999 !important;
  }
  
  #scroll__top svg {
    width: 20px;
    height: 20px;
  }
  
  /* Pe ecrane foarte mici, mută butonul mai aproape de centru */
  @media only screen and (max-width: 480px) {
    #scroll__top {
      bottom: 90px !important;
      right: 15px !important;
      width: 3.2rem;
      height: 3.2rem;
    }
  }
}
