/* =========================
   Products Page
========================= */

.products-section {
  min-height: calc(100vh - 86px - 220px);
  padding-top: 80px;
  padding-bottom: 90px;
}

.products-hero {
  text-align: center;
  padding: 20px 0 38px;
}

.products-hero .eyebrow {
  margin-bottom: 18px;
}

.products-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.15;
  color: var(--brown-dark);
  margin-bottom: 16px;
}

.products-hero h1 span {
  display: block;
  color: var(--gold);
  margin-top: 8px;
  direction: ltr;
}

.products-hero p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
  max-width: 760px;
  margin: auto;
}

.shop-filter-panel {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(199, 154, 69, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(74, 43, 18, 0.08);
  border-radius: 34px;
  padding: 24px;
  box-shadow: 0 22px 70px rgba(43, 23, 8, 0.08);
  margin: 10px 0 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items: center;
}

.shop-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.shop-filter {
  min-height: 46px;
  border: 1px solid rgba(74, 43, 18, 0.1);
  border-radius: 16px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brown-dark);
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.search-box,
.sort-box {
  min-height: 58px;
  border: 1px solid rgba(74, 43, 18, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  transition: 0.25s ease;
}

.search-box:focus-within,
.sort-box:focus-within {
  border-color: rgba(199, 154, 69, 0.7);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(199, 154, 69, 0.12);
}

.search-box i,
.sort-box i {
  color: var(--gold);
  font-size: 20px;
}

.search-box input,
.sort-box select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brown-dark);
  font-family: inherit;
  font-size: 15px;
}

.search-box input::placeholder {
  color: rgba(74, 43, 18, 0.42);
}

.sort-box select {
  cursor: pointer;
}

.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.shop-filter i {
  color: var(--gold);
  font-size: 17px;
  transition: 0.25s ease;
}

.shop-filter:hover,
.shop-filter.active {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  color: var(--gold-soft);
  box-shadow: 0 16px 38px rgba(43, 23, 8, 0.16);
}

.shop-filter:hover i,
.shop-filter.active i {
  color: var(--gold-soft);
}

.products-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
}

.products-head h2 {
  color: var(--brown-dark);
  font-size: clamp(26px, 3vw, 38px);
  margin: 12px 0 0;
}

.products-head p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
  max-width: 390px;
}

.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: stretch;
}

.shop-product-card {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(199, 154, 69, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(74, 43, 18, 0.08);
  border-radius: 30px;
  box-shadow: 0 18px 55px rgba(43, 23, 8, 0.07);
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
}

.shop-product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 28px 80px rgba(43, 23, 8, 0.16);
  background:
    radial-gradient(circle at top right, rgba(241, 215, 155, 0.18), transparent 45%),
    rgba(255, 255, 255, 0.88);
}

.product-img {
  position: relative;
  height: 230px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(241, 215, 155, 0.24), rgba(255, 250, 241, 0.75));
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: 0.35s ease;
}

.shop-product-card:hover .product-img img {
  transform: scale(1.06) rotate(-2deg);
}

.product-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}

.product-content {
  padding: 22px;
}

.product-category {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.product-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.4;
}

.product-content h3 a {
  color: var(--brown-dark);
  text-decoration: none;
  transition: 0.25s ease;
}

.product-content h3 a:hover {
  color: var(--gold);
}

.product-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 18px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.product-meta strong {
  color: var(--brown-dark);
  font-size: 20px;
}

.product-meta span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  background: rgba(199, 154, 69, 0.1);
  border: 1px solid rgba(199, 154, 69, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
}

.add-cart-btn,
.whatsapp-product {
  min-height: 52px;
  border-radius: 18px;
  text-decoration: none;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.add-cart-btn {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  color: var(--gold-soft);
  box-shadow: 0 14px 32px rgba(43, 23, 8, 0.16);
}

.whatsapp-product {
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.95), rgba(241, 215, 155, 0.45));
  border: 1px solid rgba(199, 154, 69, 0.28);
  color: var(--brown-dark);
  font-size: 22px;
  box-shadow: 0 12px 28px rgba(43, 23, 8, 0.08);
}

.whatsapp-product i {
  color: var(--gold);
  transition: 0.25s ease;
}

.whatsapp-product:hover {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  border-color: rgba(199, 154, 69, 0.45);
  color: var(--gold-soft);
  box-shadow: 0 16px 38px rgba(43, 23, 8, 0.16);
}

.whatsapp-product:hover i {
  color: var(--gold-soft);
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: 0.75s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal.show .shop-product-card {
  opacity: 1;
  transform: translateY(0);
}

.reveal.show .shop-product-card:nth-child(1) {
  transition-delay: 0.05s;
}

.reveal.show .shop-product-card:nth-child(2) {
  transition-delay: 0.13s;
}

.reveal.show .shop-product-card:nth-child(3) {
  transition-delay: 0.21s;
}

.reveal.show .shop-product-card:nth-child(4) {
  transition-delay: 0.29s;
}

.reveal.show .shop-product-card:nth-child(5) {
  transition-delay: 0.37s;
}

.reveal.show .shop-product-card:nth-child(6) {
  transition-delay: 0.45s;
}

.reveal.show .shop-product-card:nth-child(7) {
  transition-delay: 0.53s;
}

.reveal.show .shop-product-card:nth-child(8) {
  transition-delay: 0.61s;
}

@media (max-width: 1200px) {
  .shop-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .shop-filter-panel {
    grid-template-columns: 1fr;
  }

  .shop-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 992px) {
  .products-section {
    padding-top: 60px;
  }

  .shop-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .products-head p {
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .products-section {
    padding-top: 42px;
    padding-bottom: 70px;
  }

  .products-hero {
    padding: 10px 0 28px;
  }

  .products-hero h1 {
    font-size: 34px;
  }

  .products-hero p {
    font-size: 16px;
  }

  .shop-filter-panel {
    padding: 18px;
    border-radius: 28px;
    margin-bottom: 42px;
  }

  .shop-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-filter {
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
  }

  .shop-product-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-img {
    height: 220px;
  }

  .product-content {
    padding: 20px;
  }
}

@media (min-width: 993px) {
  .sidebar-overlay,
  .mobile-sidebar {
    display: none !important;
  }
}

.toast-message,
.ajax-toast {
  position: fixed;
  top: 104px;
  right: 24px;
  left: auto;
  z-index: 999999;
  width: fit-content;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 15px 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  line-height: 1.6;
  direction: rtl;
  color: #ffffff;
  box-shadow: 0 18px 55px rgba(43, 23, 8, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s ease;
}

.toast-message.show,
.ajax-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-message i,
.ajax-toast i {
  font-size: 20px;
  flex-shrink: 0;
  color: #ffffff;
}

.toast-message span,
.ajax-toast span {
  color: #ffffff;
  line-height: 1.6;
}

.toast-success,
.ajax-toast.success {
  background: linear-gradient(135deg, #176b42, #22a66a);
}

.toast-error,
.ajax-toast.error {
  background: linear-gradient(135deg, #7a1f1f, #c0392b);
}

@media (max-width: 620px) {
  .toast-message,
  .ajax-toast {
    top: 88px;
    right: 12px;
    left: 12px;
    width: auto;
    min-width: auto;
    max-width: none;
    padding: 14px 15px;
    border-radius: 16px;
    font-size: 14px;
  }
}

.add-cart-form {
  width: 100%;
}

.add-cart-form .add-cart-btn {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.shop-product-grid {
  align-items: stretch;
}

.shop-product-card {
  min-height: unset;
  height: auto;
  display: grid;
  grid-template-rows: 200px 1fr;
  overflow: hidden;
}

.product-img {
  height: 200px;
  padding: 18px;
}

.product-content {
  padding: 20px 22px 22px;
  display: grid;
  grid-template-rows:
    22px
    58px
    52px
    42px
    52px;
  row-gap: 12px;
}

.product-category {
  margin: 0;
  height: 22px;
  line-height: 22px;
}

.product-content h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-content p {
  margin: 0;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-actions {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  align-items: stretch;
}

.add-cart-btn,
.whatsapp-product {
  min-height: 52px;
}

.product-stock-badge.in-stock {
  color: var(--gold);
  background: rgba(199, 154, 69, 0.1);
  border: 1px solid rgba(199, 154, 69, 0.18);
}

.product-stock-badge.out-stock {
  color: #9b2c2c;
  background: rgba(155, 44, 44, 0.08);
  border: 1px solid rgba(155, 44, 44, 0.18);
}

.add-cart-btn.disabled,
.add-cart-btn:disabled {
  background: linear-gradient(135deg, #9a8f86, #756a61);
  color: #ffffff;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.75;
}

.add-cart-btn.disabled:hover,
.add-cart-btn:disabled:hover {
  transform: none;
}

.shop-product-card.out-of-stock .product-img img {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.shop-product-card.out-of-stock .product-badge {
  background: linear-gradient(135deg, #7a1f1f, #b33a3a);
  color: #ffffff;
}

.cart-btn {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--brown-dark);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  position: relative;
}

.cart-btn i {
  position: relative;
  z-index: 2;
}

.cart-btn .cart-count {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--brown-dark);
  border: 1px solid rgba(74, 43, 18, 0.12);
  box-shadow: 0 10px 22px rgba(43, 23, 8, 0.16);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-cart-link {
  position: relative;
}

.sidebar-cart-count {
  position: relative;
  z-index: 2;
  margin-right: auto;
  min-width: 25px;
  height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--brown-dark);
  border: 1px solid rgba(74, 43, 18, 0.12);
  box-shadow: 0 10px 24px rgba(43, 23, 8, 0.16);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-cart-link:hover .sidebar-cart-count,
.sidebar-cart-link.active .sidebar-cart-count {
  background: var(--gold-soft);
  color: var(--brown-dark);
  border-color: rgba(241, 215, 155, 0.45);
}

.cart-count.is-empty {
  display: none !important;
}

.cart-count.is-empty,
.sidebar-cart-count.is-empty {
  display: none;
}
