:root {
  --brand: #b48c5a;
  --brand-dark: #a07a4a;
  --bg: #f8fafc;
  --text: #222;
  --muted: #666;
  --shadow: 0 8px 26px rgba(180, 140, 90, 0.22);
}

* { box-sizing: border-box; }

body {
  font-family: 'Cairo', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #f3e7e9 100%);
  margin: 0 auto;
  max-width: 1440px;
  color: var(--text);
}

.page-header {
  background: #fff;
  box-shadow: 0 2px 8px #eee;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-word {
  white-space: nowrap;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.page-nav a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 10px;
  font-weight: 700;
}

.page-nav a:hover { color: var(--brand); }

.hero {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: linear-gradient(120deg, rgba(180, 140, 90, 0.9), rgba(160, 122, 74, 0.85));
}

.hero h1 {
  margin: 0 0 8px 0;
  font-size: 2rem;
}

.hero p {
  margin: 0;
  font-size: 1rem;
}

.grid-section {
  padding: 30px 16px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.grid-header h2 {
  color: var(--brand);
  margin: 0;
}

.back-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.filters-box {
  display: grid;
  gap: 12px;
  background: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.filters-toggle {
  width: fit-content;
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filters-toggle:hover {
  background: var(--brand);
  color: #fff;
}

.filters-panel {
  display: grid;
  gap: 10px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.filters-panel.open {
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-label {
  font-weight: 700;
  color: var(--brand);
  font-size: 0.9rem;
  background: #f9f5f0;
  border: 1px solid #ead9c7;
  border-radius: 10px;
  padding: 8px 12px;
  text-align: right;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.filters-panel.open .filter-group {
  animation: filter-pop 0.35s ease both;
}

.filters-panel.open .filter-group:nth-child(1) { animation-delay: 0.02s; }
.filters-panel.open .filter-group:nth-child(2) { animation-delay: 0.06s; }
.filters-panel.open .filter-group:nth-child(3) { animation-delay: 0.1s; }

@keyframes filter-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
}

.filter-options.open {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
}

.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #faf7f3;
  border: 1px solid #ead9c7;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-option.male {
  background: #e8f1ff;
  border-color: #8bb6ff;
  color: #1f4fa3;
}

.filter-option.female {
  background: #ffe8f1;
  border-color: #ff9fc4;
  color: #a31f5d;
}

.filter-option input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-clear {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-clear:hover {
  background: var(--brand);
  color: #fff;
}

.filters-summary {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.products-sentinel {
  width: 100%;
  height: 1px;
}

.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  filter: blur(4px);
  transition: transform 0.5s ease, opacity 0.7s ease, filter 0.7s ease, box-shadow 0.2s ease;
}

.product-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.product-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(180, 140, 90, 0.35);
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f1e8, #e9d7c5);
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.premium-badge-overlay {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.95), rgba(231, 76, 60, 0.95));
  color: #fff;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
  border-radius: 0 0 0 8px;
}

.product-info {
  padding: 16px;
  text-align: center;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand);
}

.status {
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
  grid-column: 1 / -1;
}

.page-footer {
  background: #fff;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  box-shadow: 0 -2px 8px #eee;
}

@media (max-width: 600px) {
  .grid-header {
    flex-direction: column;
    gap: 8px;
  }
  .filter-clear {
    width: 100%;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}
