/* Custom styles for Proizvodi page */

/* Simple Products Hero */
.products-simple-hero {
  padding: 130px 5% 50px;
  background: var(--bg-main);
  position: relative;
}

.products-simple-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
}

body.light-mode .products-simple-hero::after {
  background-color: rgba(0, 0, 0, 0.1);
}

.psh-content {
  max-width: 800px;
}

.psh-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 15px;
  font-weight: 600;
}

.psh-title {
  font-size: var(--fs-h1-hero);
  letter-spacing: -1.5px;
  margin-bottom: 25px;
  line-height: 1.1;
  color: var(--text-white);
  font-family: var(--font-heading);
}

body.light-mode .psh-title {
  color: #0a0a0a;
}

.psh-desc {
  font-size: var(--fs-body-lg);
  color: var(--text-gray);
  line-height: 1.7;
}

.products-page {
  padding: 80px 5%;
  background: var(--bg-main);
  min-height: 80vh;
}

.products-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  align-items: start;
}

.filters-sidebar {
  position: sticky;
  top: 120px;
  background: transparent;
}

body.light-mode .filters-sidebar {
  border-color: transparent;
}

.filters-sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 25px;
  color: var(--text-white);
  font-family: var(--font-heading);
  font-weight: 700;
}

body.light-mode .filters-sidebar h3 {
  color: #0a0a0a;
}

.filter-group {
  margin-bottom: 45px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.filter-list label:hover {
  color: var(--text-white);
  transform: translateX(6px);
}

body.light-mode .filter-list label:hover {
  color: #0a0a0a;
}

.filter-list input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  background-color: transparent;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.light-mode .filter-list input[type="checkbox"] {
  border-color: rgba(0, 0, 0, 0.2);
}

.filter-list label:hover input[type="checkbox"] {
  border-color: var(--accent);
}

.filter-list input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.filter-list input[type="checkbox"]:checked::after {
  content: '';
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.filter-toggle-btn {
  display: none;
}

.close-filters-btn {
  display: none;
}

.filters-backdrop {
  display: none;
}

.products-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* 2 columns when sidebar is visible on medium-large screens (1024px - 1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
  .products-grid-full {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* 4 columns on very wide screens (sidebar + 4 cards fits well) */
@media (min-width: 1400px) {
  .products-grid-full {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* Reset .product-card inline styles if any from slider */
.products-grid-full .product-card {
  flex: none; /* override index.css flex behavior for slider */
  width: 100%;
}

/* Consistent image container using aspect-ratio — no more random heights */
.products-grid-full .product-img {
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.products-grid-full .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .pagination-wrapper {
  border-top-color: rgba(0, 0, 0, 0.05);
}

.progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.progress-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

body.light-mode .progress-bar {
  background: rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.pagination-modern {
  display: flex;
  align-items: center;
  gap: 30px;
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
  font-size: 1.15rem;
  padding: 5px;
  transition: color 0.3s ease;
}

body.light-mode .page-btn {
  color: #0a0a0a;
}

.page-btn:hover {
  color: var(--accent);
}

.page-btn.disabled {
  color: var(--text-gray);
  opacity: 0.5;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-gray);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

body.light-mode .page-num {
  color: #5a5a5a;
}

.page-num:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .page-num:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.05);
}

.page-num.active {
  background: var(--accent);
  color: #000 !important;
}

.page-dots {
  color: var(--text-gray);
  letter-spacing: 2px;
  padding: 0 5px;
}

/* Sort top bar */
.products-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  gap: 20px;
}

.results-count {
  color: var(--text-gray);
  font-size: 0.95rem;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 450px;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  padding: 10px 30px 10px 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-bottom-color 0.3s ease;
}

body.light-mode .search-input {
  background: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  color: #000;
}

.search-input:focus {
  border-bottom-color: var(--accent);
}

.search-wrapper i {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-gray);
  pointer-events: none;
}

.sort-select {
  background: transparent;
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.sort-select option {
  background: var(--bg-card);
  color: var(--text-white);
}

body.light-mode .sort-select {
  color: #000;
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .sort-select option {
  background: #fff;
  color: #000;
}

/* ─── Sidebar becomes a slide-in drawer on narrow screens ─────────────────── */
@media (max-width: 1024px) {
  .products-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: #111111;
    z-index: 1000;
    padding: 60px 30px 30px 30px;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.light-mode .filters-sidebar {
    background: #ffffff;
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
  }

  .filters-sidebar.active {
    left: 0;
  }

  .filter-group {
    margin-bottom: 35px;
  }

  .filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    align-self: flex-start;
  }

  .filter-toggle-btn i {
    color: #fff;
  }

  .filter-toggle-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
  }

  .close-filters-btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
  }

  body.light-mode .close-filters-btn {
    color: #000;
  }

  .filters-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 999;
  }

  .filters-backdrop.active {
    display: block;
  }

  /* 3 columns while the sidebar is still visible (900px range) */
  .products-grid-full {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .products-top-bar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
  }

  .search-wrapper {
    max-width: 100%;
    order: 3;
    flex-basis: 100%;
    margin-top: 15px;
  }

  .pagination-modern {
    gap: 15px;
  }

  .page-numbers {
    gap: 2px;
  }

  .page-num {
    width: 35px;
    height: 35px;
  }
}

/* ─── Hero & page padding adjustments ────────────────────────────────────── */
@media (max-width: 768px) {
  .products-simple-hero {
    padding: 110px 5% 35px;
  }

  .products-page {
    padding: 50px 5%;
  }

  /* 2 columns on tablets */
  .products-grid-full {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ─── Small phones: 2 compact columns ────────────────────────────────────── */
@media (max-width: 480px) {
  .products-simple-hero {
    padding: 100px 5% 30px;
  }

  .psh-eyebrow {
    letter-spacing: 2px;
    margin-bottom: 10px;
  }

  .products-page {
    padding: 40px 4%;
  }

  .products-container {
    gap: 20px;
  }

  /* Still 2 columns — single column feels too big on phone */
  .products-grid-full {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .products-top-bar {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }

  .filter-group {
    margin-bottom: 25px;
  }

  .filters-sidebar h3 {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }

  .filter-list label {
    font-size: var(--fs-small);
  }

  .sort-select {
    font-size: var(--fs-small);
  }

  .search-input {
    font-size: var(--fs-small);
  }

  .pagination-wrapper {
    margin-top: 40px;
    padding-top: 25px;
    gap: 25px;
  }

  .page-num {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ─── Very small phones (< 360px): single column ─────────────────────────── */
@media (max-width: 360px) {
  .products-grid-full {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ─── Skeleton Loaders ───────────────────────────────────────────────────── */
.skeleton-card {
  pointer-events: none;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
  margin-bottom: 20px;
}

body.light-mode .skeleton-img {
  background-color: rgba(0, 0, 0, 0.05);
}

.skeleton-title {
  width: 70%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

body.light-mode .skeleton-title {
  background-color: rgba(0, 0, 0, 0.05);
}

.skeleton-text {
  width: 50%;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

body.light-mode .skeleton-text {
  background-color: rgba(0, 0, 0, 0.05);
}

.skeleton-stars {
  width: 40%;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite ease-in-out;
}

body.light-mode .skeleton-stars {
  background-color: rgba(0, 0, 0, 0.05);
}

.skeleton-price {
  width: 40%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

body.light-mode .skeleton-price {
  background-color: rgba(0, 0, 0, 0.05);
}

.skeleton-btn {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
}

body.light-mode .skeleton-btn {
  background-color: rgba(0, 0, 0, 0.05);
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* ─── Disable Animations (Only on Proizvodi page) ────────────────────────── */
.products-page .product-card,
.products-page .product-card.sa-init {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
