/* ==========================================================================
   digikala-shop.css — Digikala-like Product listing page (Light Theme)
   RTL standard styles
   ========================================================================== */

   :root {
    --dk-red: var(--color-primary, #ef394e);
    --dk-red-hover: var(--color-primary-hover, #d32f42);
    --dk-gray-50: var(--color-bg-page, #f8f9fa);
    --dk-gray-100: var(--color-bg-subtle, #f1f2f4);
    --dk-gray-200: var(--color-border, #e0e0e2);
    --dk-gray-300: #c0c2c5;
    --dk-gray-400: #a1a3a8;
    --dk-gray-500: var(--color-text-muted, #81858b);
    --dk-gray-600: var(--color-text-secondary, #62666d);
    --dk-gray-700: #424750;
    --dk-gray-800: var(--color-secondary, #232933);
    --dk-gray-900: #080a0b;
    
    --dk-border: var(--color-border, #e0e0e2);
    --dk-surface: var(--color-bg-surface, #ffffff);
    --dk-text: var(--color-text-main, #3f4064);
    --dk-text-secondary: var(--color-text-secondary, #767790);
    
    --font-vazir: var(--font-sans, 'Vazirmatn', IRANSans, tahoma, sans-serif);
  }
  
  body {
    background-color: var(--dk-surface);
    color: var(--dk-text);
  }
  
  .dk-shop {
    font-family: var(--font-vazir);
    background-color: var(--dk-surface);
    color: var(--dk-text);
    padding-bottom: 40px;
  }
  
  .dk-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
  }
  
  /* ──────────────────────────────────── Breadcrumb ─────────────────────────── */
  .dk-breadcrumb {
    padding: 16px 0;
    font-size: 12px;
    color: var(--dk-gray-500);
  }
  .dk-breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
  }
  .dk-breadcrumb-list a {
    color: var(--dk-gray-500);
    text-decoration: none;
    transition: color 0.2s;
  }
  .dk-breadcrumb-list a:hover {
    color: var(--dk-red);
  }
  .dk-breadcrumb-separator {
    margin: 0 8px;
    color: var(--dk-gray-300);
  }
  .dk-breadcrumb [aria-current] {
    color: var(--dk-gray-700);
  }
  
  /* ──────────────────────────────────── Layout ─────────────────────────────── */
  .dk-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  
  /* ──────────────────────────────────── Sidebar Filters ────────────────────── */
  .dk-sidebar {
    border: 1px solid var(--dk-border);
    border-radius: 8px;
    background: var(--dk-surface);
    padding: 0 16px;
  }
  
  .dk-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--dk-border);
  }
  .dk-filter-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dk-gray-800);
  }
  .dk-btn-text {
    background: none;
    border: none;
    color: var(--dk-red);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
  }
  
  .dk-filter-box {
    padding: 16px 0;
    border-bottom: 1px solid var(--dk-border);
  }
  .dk-filter-box:last-child {
    border-bottom: none;
  }
  .dk-filter-box-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dk-gray-800);
    margin-bottom: 16px;
  }
  
  /* Search Input */
  .dk-search-input-wrapper {
    position: relative;
  }
  .dk-search-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid var(--dk-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: var(--dk-gray-50);
    color: var(--dk-gray-800);
    outline: none;
    transition: border-color 0.2s;
  }
  .dk-search-input:focus {
    border-color: var(--color-primary);
  }
  .dk-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dk-gray-500);
    pointer-events: none;
  }
  
  /* Checkboxes */
  .dk-filter-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
  }
  .dk-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
  }
  .dk-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--dk-gray-400);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    position: relative;
    background-color: var(--dk-surface);
  }
  .dk-checkbox:checked {
    background-color: var(--dk-red);
    border-color: var(--dk-red);
  }
  .dk-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .dk-checkbox-text {
    font-size: 14px;
    color: var(--dk-gray-700);
  }
  
  /* Price Range */
  .dk-price-range {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .dk-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .dk-price-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--dk-border);
    border-radius: 8px;
    padding: 0 8px;
    flex: 1;
    background: var(--dk-gray-50);
  }
  .dk-price-label, .dk-price-currency {
    font-size: 11px;
    color: var(--dk-gray-500);
    white-space: nowrap;
  }
  .dk-price-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
  }
  .dk-price-input::-webkit-outer-spin-button,
  .dk-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .dk-price-input-separator {
    color: var(--dk-gray-400);
  }
  .dk-btn-primary {
    background-color: var(--dk-red);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  .dk-btn-primary:hover {
    background-color: var(--dk-red-hover);
  }
  
  /* ──────────────────────────────────── Main Content ───────────────────────── */
  .dk-main-content {
    min-width: 0;
  }
  
  /* Active Filters */
  .dk-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }
  .dk-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--dk-gray-50);
    border: 1px solid var(--dk-border);
    border-radius: 16px;
    font-size: 12px;
    color: var(--dk-gray-700);
  }
  .dk-chip-remove {
    background: none;
    border: none;
    padding: 0;
    color: var(--dk-gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .dk-chip-remove:hover {
    color: var(--dk-red);
  }
  
  /* Sort Toolbar */
  .dk-sort-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dk-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .dk-sort-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dk-gray-800);
    font-size: 12px;
    font-weight: 700;
  }
  .dk-sort-options {
    display: flex;
    gap: 16px;
    flex: 1;
  }
  .dk-sort-btn {
    background: none;
    border: none;
    color: var(--dk-gray-500);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.2s;
  }
  .dk-sort-btn:hover {
    color: var(--dk-gray-700);
  }
  .dk-sort-btn.is-active {
    color: var(--dk-red);
    font-weight: 700;
  }
  .dk-product-count {
    color: var(--dk-gray-500);
    font-size: 12px;
  }
  
  /* ──────────────────────────────────── Product Grid ───────────────────────── */
  .dk-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--dk-border);
    border-right: 1px solid var(--dk-border);
  }
  
  .dk-product-card {
    border-bottom: 1px solid var(--dk-border);
    border-left: 1px solid var(--dk-border);
    background: var(--dk-surface);
    padding: 16px;
    transition: box-shadow 0.2s;
    position: relative;
  }
  .dk-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1;
  }
  .dk-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .dk-product-image-wrapper {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
  }
  .dk-product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .dk-product-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--dk-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dk-gray-400);
    font-size: 12px;
  }
  
  .dk-product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .dk-product-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 2.15;
    color: var(--dk-gray-800);
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .dk-product-bottom {
    margin-top: auto;
  }
  
  .dk-product-price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-height: 48px;
    justify-content: flex-end;
  }
  .dk-product-price-row {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .dk-product-price-discount-row {
    margin-bottom: 2px;
    width: 100%;
    justify-content: space-between;
  }
  
  .dk-discount-badge {
    background-color: var(--dk-red);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 12px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .dk-old-price {
    color: var(--dk-gray-400);
    font-size: 12px;
    text-decoration: line-through;
  }
  
  .dk-current-price {
    color: var(--dk-gray-800);
    font-size: 16px;
    font-weight: 700;
  }
  
  .dk-currency {
    color: var(--dk-gray-800);
    font-size: 11px;
  }
  
  .dk-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--dk-gray-500);
  }
  .dk-empty-state svg {
    margin-bottom: 16px;
  }
  .dk-empty-state h3 {
    color: var(--dk-gray-800);
    font-size: 16px;
    margin: 0 0 8px 0;
  }
  .dk-empty-state p {
    font-size: 13px;
    margin: 0;
  }
  
  /* ──────────────────────────────────── Pagination ─────────────────────────── */
  .dk-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
  }
  
  .dk-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--dk-border);
    border-radius: 8px;
    background: var(--dk-surface);
    color: var(--dk-gray-700);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
  }
  .dk-page-btn:not(.is-disabled):hover {
    border-color: var(--dk-red);
    color: var(--dk-red);
  }
  .dk-page-btn.is-disabled {
    color: var(--dk-gray-400);
    background-color: var(--dk-gray-50);
    cursor: not-allowed;
  }
  
  .dk-page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .dk-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    color: var(--dk-gray-700);
    text-decoration: none;
    transition: all 0.2s;
  }
  a.dk-page-number:hover {
    color: var(--dk-red);
  }
  .dk-page-number.is-active {
    background-color: var(--dk-gray-800);
    color: white;
  }
  
  /* Mobile Filters Backdrop & Toggle Button */
  .dk-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .dk-sidebar-backdrop.is-open {
    display: block;
    opacity: 1;
  }
  .dk-close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dk-gray-800);
    cursor: pointer;
    padding: 4px;
    margin-right: auto;
  }
  .dk-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--dk-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    color: var(--dk-gray-800);
    cursor: pointer;
  }
  
  /* ──────────────────────────────────── Responsive ─────────────────────────── */
  @media (max-width: 1200px) {
    .dk-product-grid { grid-template-columns: repeat(3, 1fr); }
  }
  
  @media (max-width: 992px) {
    .dk-layout {
      grid-template-columns: 1fr;
    }
    .dk-sidebar {
      position: fixed;
      top: 0;
      right: -100%;
      bottom: 0;
      width: 300px;
      max-width: 80%;
      background: white;
      z-index: 999;
      overflow-y: auto;
      padding: 20px;
      transition: right 0.3s ease;
      box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    }
    .dk-sidebar.is-open {
      right: 0;
    }
    .dk-close-sidebar-btn {
      display: flex;
    }
    .dk-mobile-filter-btn {
      display: flex;
    }
  }
  
  @media (max-width: 768px) {
    .dk-product-grid { grid-template-columns: repeat(2, 1fr); }
    .dk-sort-toolbar {
      display: flex;
      overflow-x: auto;
      white-space: nowrap;
      padding-bottom: 12px;
      gap: 12px;
      -webkit-overflow-scrolling: touch;
    }
    .dk-sort-toolbar::-webkit-scrollbar {
      display: none;
    }
    .dk-product-count {
      display: none;
    }
  }
  
  @media (max-width: 480px) {
    .dk-product-grid { grid-template-columns: 1fr; }
  }