/* public_html/assets/css/product.css — نسخه نهایی (دکمه جزئیات کوچک‌تر در دسکتاپ) */

/* =========================================
   PRODUCT PAGE – Filter + Cards + Mobile Sheet (Dark Mode)
========================================= */
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: #020617;
  color: #f1f5f9;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Glass utility */
.glass {
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass:hover { background: #334155; transform: translateY(-4px); }

/* ---------- Hero ---------- */
.shop-hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.shop-hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== FILTER BAR (Desktop) ========== */
.filter-bar-desktop {
  margin: 0 24px 30px;
}
.filter-bar-glass {
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,0.6);
}

.search-box-desktop {
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 2px solid rgba(56,189,248,0.2);
  border-radius: 60px;
  padding: 0 8px 0 20px;
  transition: box-shadow 0.3s, border-color 0.3s;
  margin-bottom: 20px;
}
.search-box-desktop:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56,189,248,0.3);
}
.search-box-desktop input {
  border: none;
  background: transparent;
  padding: 14px 10px;
  font-size: 1rem;
  color: #f1f5f9;
  flex: 1;
  outline: none;
}
.search-box-desktop input::placeholder { color: #94a3b8; }
.search-icon { color: #38bdf8; font-size: 1.4rem; }
.search-submit-btn {
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.search-submit-btn:hover { transform: scale(1.05); }

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.chip {
  padding: 10px 20px;
  border-radius: 50px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chip:hover { background: #334155; border-color: #38bdf8; color: white; }
.chip.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 4px 15px rgba(56,189,248,0.3);
}
.more-chip { background: transparent; border-style: dashed; }

.filter-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.btn-advanced {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-advanced:hover { background: rgba(56,189,248,0.1); border-color: #38bdf8; color: white; }
.btn-advanced.active { background: rgba(56,189,248,0.2); border-color: #38bdf8; color: #38bdf8; }

.action-btns { display: flex; gap: 10px; }
.btn-apply, .btn-reset {
  padding: 10px 28px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}
.btn-apply {
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(56,189,248,0.3);
}
.btn-reset {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.08);
  color: #cbd5e1;
}
.btn-apply:hover, .btn-reset:hover { transform: translateY(-2px); }

/* Advanced Panel */
.advanced-panel {
  max-width: 100%;
  margin-top: 20px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  background: rgba(15,23,42,0.4);
  border-radius: 24px;
}
.advanced-panel.open {
  max-height: 800px;
  opacity: 1;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.panel-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: block;
}
.range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-inputs input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1e293b;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.2s;
}
.range-inputs input:focus { border-color: #38bdf8; }
.range-inputs span { color: #94a3b8; }

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.checkbox-item:hover { background: #334155; }
.checkbox-item input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
}

.native-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23B8B8C5' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
}

/* ========== MOBILE FILTER BUTTON ========== */
.mobile-filter-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(56,189,248,0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-filter-btn:hover { transform: translateX(-50%) translateY(-3px); }

/* ========== MOBILE FILTER SHEET ========== */
.filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.filter-sheet.hidden { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.sheet-content {
  position: relative;
  width: 100%;
  max-height: 85vh;
  background: #0f172a;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sheet-header h3 { font-size: 1.3rem; font-weight: 700; }
.close-sheet {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
}
.sheet-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.mobile-search-box {
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 40px;
  padding: 8px 16px;
  margin-bottom: 20px;
}
.mobile-search-box input {
  border: none;
  background: transparent;
  padding: 8px;
  color: #f1f5f9;
  flex: 1;
  outline: none;
}
.mobile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sheet-group {
  margin-bottom: 24px;
}
.sheet-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 10px;
  display: block;
}
.sheet-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 12px;
}
.sheet-footer .btn-apply,
.sheet-footer .btn-reset { flex: 1; justify-content: center; }

/* ========== PRODUCT CARD (optimized desktop) ========== */
.product-card {
  position: relative;
  background: rgba(15,23,42,0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  overflow: hidden;
  transition: all 0.35s ease;
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.5);
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56,189,248,0.4);
  box-shadow: 0 25px 40px -12px rgba(56,189,248,0.25);
  background: rgba(30,41,59,0.9);
}
.product-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}
.product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: #0f172a;
  display: block;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img {
  transform: scale(1.05);
  filter: brightness(1.05);
}
.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.25s;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}
.product-image-wrapper:hover .product-overlay { opacity: 1; }
.product-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 40px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.product-info { padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.product-title-link { text-decoration: none; }
.product-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-title:hover { color: #38bdf8; }

/* ========== price / sale badge ========== */
.product-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.product-price {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.product-old-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-left: 8px;
}
.product-sale-price {
    color: #10b981;
    font-weight: 800;
    font-size: 1.2rem;
    background: none;
    -webkit-text-fill-color: #10b981;
}
.discount-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.product-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.cart-form { flex: 1; }

/* ===== دکمه‌های کارت محصول (دسکتاپ) ===== */
.btn-cart, .btn-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.btn-cart {
  background: linear-gradient(105deg, #38bdf8, #6366f1);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(56,189,248,0.3);
  flex: 1.2;
}
.btn-cart:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 8px 18px rgba(56,189,248,0.4); }

/* دکمه جزئیات کوچک‌تر */
.btn-details {
  background: transparent;
  border: 1px solid rgba(56,189,248,0.6);
  color: #38bdf8;
  flex: 0.6;                 /* عرض کمتر نسبت به قبل */
  padding: 8px 10px;        /* پدینگ کمتر */
  font-size: 0.75rem;       /* فونت کوچک‌تر */
}
.btn-details:hover { background: rgba(56,189,248,0.1); border-color: #38bdf8; transform: translateY(-2px); }

/* Products Grid */
.products-wrapper {
  display: grid;
  gap: 32px;
  padding: 40px 20px;
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .products-wrapper { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .products-wrapper { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .products-wrapper { grid-template-columns: repeat(4, 1fr); } }

/* No results */
.no-results { text-align: center; padding: 50px; grid-column: 1/-1; color: #cbd5e1; }

/* Back to Top */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  background: #38bdf8;
  color: #0f172a;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(56,189,248,0.25);
  z-index: 99;
}
.back-to-top.show { opacity:1; visibility:visible; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 12px; margin: 40px 0 60px; flex-wrap: wrap; }
.page-link {
  padding: 10px 18px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cbd5e1;
}
.active-page { background: #38bdf8; color: #0f172a; box-shadow: 0 4px 12px rgba(56,189,248,0.25); }

/* Reveal */
.reveal { opacity: 0; transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.fade-up { transform: translateY(25px); }
.reveal.visible { opacity: 1; transform: translate(0); }

/* ========== Responsive (موبایل - بدون تغییر) ========== */
@media (max-width: 860px) {
  .filter-bar-desktop { display: none; }
  .glass, .product-card, .page-link {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .product-card { border-radius: 24px; }
  .product-info { padding: 16px; }
  .product-title { font-size: 1.1rem; }
  .product-price { font-size: 1.25rem; }
  /* بازگردانی دکمه‌های موبایل به همان حالت قبلی */
  .btn-cart { flex: 0.8; min-height: 44px; padding: 8px 4px; font-size: 0.75rem; }
  .btn-details { flex: 1.2; min-height: 44px; padding: 8px 4px; font-size: 0.75rem; }
  .product-overlay { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

@media (hover: none) and (pointer: coarse) {
  .glass:hover, .product-card:hover, .btn-cart:hover, .btn-details:hover {
    transform: none; box-shadow: none;
  }
}