/**
 * Shop Page Styles
 * Favania Block Theme
 */

/* ========================================
   PAGE BACKGROUND
======================================== */
.shop-page-main {
  background: linear-gradient(
    to bottom,
    #000000 0%,
    #0a0a0a 20%,
    #141414 40%,
    #1a1a1a 60%,
    #222222 100%
  ) !important;
}

/* ========================================
   HERO SECTION
======================================== */
.shop-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: 394px;
  overflow: hidden;
  margin-bottom: 60px;
}

/* Background Image Layer */
.shop-hero-background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Gradient Overlay Layer */
.shop-hero-gradient-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.4) 30%,
    rgba(34, 34, 34, 0.8) 70%,
    rgba(34, 34, 34, 0.95) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Deprecated - kept for compatibility */
.shop-hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.shop-hero-background .wp-block-cover__background,
.shop-hero-background::before,
.shop-hero-background::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.shop-hero-background .wp-block-cover__background {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.4) 30%,
    rgba(34, 34, 34, 0.8) 70%,
    rgba(34, 34, 34, 0.95) 100%
  ) !important;
}

.shop-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.shop-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 394px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.1) 30%,
    rgba(34, 34, 34, 0.7) 70%,
    rgba(34, 34, 34, 1) 100%
  );
  pointer-events: none;
}

.shop-hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ========================================
   SEARCH BOX
======================================== */
.shop-search-container {
  max-width: 600px;
  width: 100%;
}

.shop-search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.shop-search-form:focus-within {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.shop-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 20px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 16px;
  color: #222;
  outline: none;
  direction: rtl;
  text-align: right;
}

.shop-search-input::placeholder {
  color: #999;
  opacity: 1;
}

.shop-search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #403c27;
  color: #e5e0e0;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 8px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  white-space: nowrap;
}

.shop-search-button:hover {
  background: #302f29;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.shop-search-button:active {
  transform: translateY(0);
}

/* ========================================
   MAIN LAYOUT
======================================== */
.shop-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px 80px;
  direction: rtl;
}

.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

/* ========================================
   SIDEBAR
======================================== */
.shop-sidebar {
  position: sticky;
  top: 100px;
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.shop-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2a2a;
}

.shop-sidebar-icon {
  width: 24px;
  height: 24px;
  color: #d4af37;
}

.shop-sidebar-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 20px;
  font-weight: 600;
  color: #e5e0e0;
  margin: 0;
}

/* Filter Widgets Styles */
.filter-widget {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a2a;
}

.filter-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-widget-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 16px;
  font-weight: 500;
  color: #d4af37;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Generic filter styles for compatibility */
.filter-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-widget li {
  margin-bottom: 10px;
}

.filter-widget label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  color: #e5e0e0;
  transition: color 0.2s ease;
}

.filter-widget label:hover {
  color: #d4af37;
}

.filter-widget input[type="checkbox"],
.filter-widget input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #d4af37;
}

.filter-widget select {
  width: 100%;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-widget select:hover,
.filter-widget select:focus {
  border-color: #d4af37;
  outline: none;
}

.filter-widget button,
.filter-widget .button {
  width: 100%;
  padding: 10px 16px;
  background: #403c27;
  border: none;
  border-radius: 8px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.filter-widget button:hover,
.filter-widget .button:hover {
  background: #302f29;
  transform: translateY(-2px);
}

/* Color swatches (for color filters) */
.filter-widget .color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #3a3a3a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-widget .color-swatch:hover,
.filter-widget .color-swatch.selected {
  border-color: #d4af37;
  transform: scale(1.1);
}

/* Price Range Slider */
.filter-widget .price-slider {
  margin: 16px 0;
}

.filter-widget .price-input {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.filter-widget .price-input input {
  flex: 1;
  padding: 8px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 13px;
  text-align: center;
}

/* ========================================
   PRODUCTS SECTION
======================================== */
.shop-products {
  min-height: 600px;
}

.shop-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid #2a2a2a;
  flex-wrap: wrap;
  gap: 16px;
}

.shop-products-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-products-icon {
  width: 24px;
  height: 24px;
  color: #d4af37;
}

.shop-products-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 24px;
  font-weight: 600;
  color: #e5e0e0;
  margin: 0;
}

.shop-products-count {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  color: #999;
  margin-right: 12px;
}

.shop-products-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shop-sort-select,
.shop-view-select {
  padding: 10px 16px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-sort-select:hover,
.shop-sort-select:focus,
.shop-view-select:hover,
.shop-view-select:focus {
  border-color: #d4af37;
  outline: none;
}

/* Mobile Filter Toggle */
.shop-mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #403c27;
  border: none;
  border-radius: 8px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

.shop-mobile-filter-toggle:hover {
  background: #302f29;
}

/* ========================================
   PRODUCT GRID
======================================== */
.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  position: relative;
  background: #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.product-card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0a0a0a;
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image {
  transform: scale(1.05);
}

.product-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  color: #666;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
}

.product-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
}

.product-card-badge-sale {
  background: #d4af37;
  color: #1a1a1a;
}

.product-card-badge-out-of-stock {
  background: rgba(255, 0, 0, 0.8);
  color: #ffffff;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card-content {
  padding: 16px;
}

.product-card-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-subtitle {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  font-weight: 300;
  color: #e5e0e0;
  margin: 0 0 16px 0;
}

.product-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(7px);
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #222222;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-card-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1) translateX(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.product-card-button-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.product-card-button:hover .product-card-button-icon {
  transform: rotate(45deg);
}

/* ========================================
   PAGINATION
======================================== */
.shop-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid #2a2a2a;
}

.shop-pagination a,
.shop-pagination span,
.shop-pagination button,
.shop-pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #e5e0e0;
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.shop-pagination a:hover,
.shop-pagination button:hover,
.shop-pagination-button:hover {
  background: #403c27;
  border-color: #d4af37;
  color: #ffffff;
}

.shop-pagination a:disabled,
.shop-pagination button:disabled,
.shop-pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.shop-pagination .current,
.shop-pagination-button.current {
  background: #d4af37;
  border-color: #d4af37;
  color: #1a1a1a;
  font-weight: 600;
}

/* ========================================
   LOADING & EMPTY STATES
======================================== */
.shop-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
}

.shop-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #2a2a2a;
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.shop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.shop-empty-icon {
  width: 80px;
  height: 80px;
  color: #3a3a3a;
}

.shop-empty-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 24px;
  color: #e5e0e0;
  margin: 0;
}

.shop-empty-text {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 16px;
  color: #999;
  margin: 0;
  max-width: 400px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* Tablet */
@media (max-width: 1024px) {
  .shop-container {
    padding: 0 40px 60px;
  }

  .shop-layout {
    grid-template-columns: 240px 1fr;
    gap: 30px;
  }

  .shop-products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .shop-hero {
    height: 300px;
    margin-bottom: 30px;
  }

  .shop-hero-overlay {
    height: 300px;
  }

  .shop-container {
    padding: 0 20px 40px;
  }

  .shop-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .shop-sidebar {
    display: none;
  }

  .shop-mobile-filter-toggle {
    display: flex;
  }

  .shop-products-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .shop-products-controls {
    width: 100%;
    justify-content: space-between;
  }

  .shop-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .product-card-content {
    padding: 12px;
  }

  .product-card-title {
    font-size: 16px;
  }

  .product-card-subtitle {
    font-size: 13px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .shop-search-button {
    padding: 12px 16px;
  }

  .shop-search-button span {
    display: none;
  }

  .shop-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   DRAWER (Mobile Filters)
======================================== */
.shop-filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 320px;
  background: #1a1a1a;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10000; /* Higher than header navigation */
  overflow-y: auto;
}

.shop-filter-drawer.open {
  transform: translateX(0);
}

.shop-filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  background: #1a1a1a;
  z-index: 10;
}

.shop-filter-drawer-title {
  font-family: 'PeydaFaNumWeb', sans-serif !important;
  font-size: 20px;
  font-weight: 600;
  color: #e5e0e0;
  margin: 0;
}

.shop-filter-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: #e5e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.shop-filter-drawer-close:hover {
  background: #2a2a2a;
}

.shop-filter-drawer-content {
  padding: 20px;
}

.shop-filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999; /* Higher than header but below drawer */
}

.shop-filter-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* RTL specific */
[dir="rtl"] .shop-filter-drawer {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

[dir="rtl"] .shop-filter-drawer.open {
  transform: translateX(0);
}

/* ========================================
   UTILITIES
======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}