/* ==========================================================================
   1. VARIABLES & BASE STYLES
   ========================================================================== */
:root {
  --bg: #f7f3ee;
  --surface: #ffffff;
  --surface-2: #f2ece4;
  --text: #1f1a17;
  --muted: #6f665f;
  --line: rgba(31, 26, 23, 0.08);
  --gold: #b8915e;
  --gold-dark: #9d7746;
  --shadow: 0 20px 60px rgba(31, 26, 23, 0.10);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --container: 1280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(to bottom, #f8f4ef 0%, #f5efe8 100%);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

/* ==========================================================================
   2. BUTTONS & STATS (STORE CUSTOM BUTTONS - PREVENTS BOOTSTRAP OVERRIDES)
   ========================================================================== */
.store-page .btn {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.store-page .btn-dark {
  background: #1f1a17;
  color: #fff;
}

.store-page .btn-dark:hover {
  background: #000;
  transform: translateY(-2px);
}

.store-page .btn-light {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border: 1px solid var(--line);
}

.store-page .btn-light:hover {
  background: #fff;
  transform: translateY(-2px);
}

.store-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  min-width: 150px;
}

.stat-card strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 5px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   3. HERO SECTION (HTML STRUCTURE INTEGRATION)
   ========================================================================== */
.store-hero {
  padding: 122px 0 40px;
  position: relative;
  overflow: hidden;
}

.store-hero::before {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(200, 155, 92, 0.15), transparent 70%);
  right: -180px;
  top: 70px;
  z-index: 1;
  pointer-events: none;
}

.store-hero-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: 36px;
  padding: 40px;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
}

.store-kicker,
.section-label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 14px;
  font-weight: 700;
}

.store-hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 1.02;
  margin-bottom: 18px;
  max-width: 700px;
}

.store-hero-content h1 span {
  color: var(--gold-dark);
  font-style: italic;
}

.store-hero-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 28px;
}

.store-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.store-hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  padding: 18px;
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(240, 231, 220, 0.95) 65%, rgba(226, 211, 194, 0.9) 100%);
  box-shadow: 0 24px 70px rgba(31, 26, 23, 0.14);
}

.hero-image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 28px;
  transition: transform 0.4s ease;
}

.hero-image-card:hover img {
  transform: scale(1.03);
}

/* ==========================================================================
   4. FILTERS & TOOLBAR
   ========================================================================== */
.store-toolbar-section {
  padding: 20px 0 10px;
}

.store-toolbar-header {
  margin-bottom: 20px;
}

.store-toolbar-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.store-toolbar-header p {
  color: var(--muted);
  max-width: 700px;
  line-height: 1.7;
}

.store-toolbar {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-group-title {
  font-weight: 800;
  margin-right: 6px;
  color: var(--text);
}

.chip input {
  display: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.chip input:checked + span {
  background: #1f1a17;
  color: #fff;
  border-color: #1f1a17;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   5. PRODUCT GRID & CARD STYLES
   ========================================================================== */
.store-products-section {
  padding: 28px 0 80px;
}

.store-products-grid {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(31, 26, 23, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 42px rgba(31, 26, 23, 0.12);
}

.product-tag {
  margin: 16px 16px 0;
  align-self: flex-start;
  background: #f4ece3;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
}

.product-image {
  padding: 22px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.14));
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-grow: 1;
}

.product-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.product-top h3 {
  font-size: 1.08rem;
  font-weight: 800;
}

.product-info p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.buy {
  margin-top: auto;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  background: #1f1a17;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
  text-align: center;
}

.buy:hover {
  background: var(--gold-dark);
}

.no-products-message {
  display: none;
  text-align: center;
  margin-top: 28px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

/* ==========================================================================
   6. PAGINATION
   ========================================================================== */
.store-pagination-wrapper {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.store-pagination {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.store-pagination .page-item {
  display: flex;
}

.store-pagination .page-link {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s ease;
}

.store-pagination .page-link:hover {
  background: var(--surface-2);
  border-color: rgba(184, 145, 94, 0.25);
  color: var(--gold-dark);
  transform: translateY(-1px);
}

.store-pagination .page-item.active .page-link {
  background: #1f1a17;
  color: #fff;
  border-color: #1f1a17;
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.18);
}

.store-pagination .page-item.disabled .page-link {
  opacity: 0.45;
  pointer-events: none;
}

.store-pagination .page-item.dots .page-link {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-width: 32px;
}
#products {
  scroll-margin-top: 100px;
}

/* ==========================================================================
   7. DRAWER STYLES (PRODUCT DETAILED VIEW - REPLACING MODAL)
   ========================================================================== */
.product-drawer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  justify-content: flex-end;
}

.product-drawer.active {
  display: flex;
}

.product-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 10, 0.65);
  backdrop-filter: blur(8px);
}

.product-drawer-content {
  width: min(580px, 100%);
  height: 100%;
  background: linear-gradient(145deg, #ffffff, #f6efe7);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.25);
  border-radius: 30px 0 0 30px;
}

/* ==========================================================================
   7.1 DRAWER HEADER WITH ZOOM BUTTON
   ========================================================================== */
.product-drawer-header {
  position: absolute;
  top: 20px;
  right: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

html[dir="rtl"] .product-drawer-header {
  right: auto;
  left: 25px;
}

.product-drawer-close {
  font-size: 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1f1a17;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 10;
  border: none;
  font-size: 24px;
  line-height: 1;
}

.product-drawer-close:hover {
  color: var(--gold-dark);
  transform: rotate(90deg);
}

.product-drawer-zoom {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1f1a17;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 10;
}

.product-drawer-zoom svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.product-drawer-zoom:hover {
  color: var(--gold-dark);
  transform: scale(1.1);
  border-color: var(--gold);
}

/* RTL layout handling */
html[dir="rtl"] .product-drawer {
  justify-content: flex-start;
}

html[dir="rtl"] .product-drawer-content {
  border-radius: 0 30px 30px 0;
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.25);
}

.product-drawer-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 80px 40px 40px;
  scrollbar-width: thin;
}

.product-drawer-scrollable::-webkit-scrollbar {
  width: 6px;
}

.product-drawer-scrollable::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 3px;
}

.product-drawer-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.product-drawer-image-wrap {
  display: flex;
  justify-content: center;
}

.drawer-image-card {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1.1 / 1;
  border-radius: 24px;
  padding: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(240, 231, 220, 0.95) 70%, rgba(226, 211, 194, 0.9) 100%);
  box-shadow: 0 15px 40px rgba(31, 26, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drawer-image-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.12));
  transition: transform 0.25s ease;
  cursor: pointer;
}

.drawer-image-card:hover img {
  transform: scale(1.04);
}

.expand-indicator {
  position: absolute;
  bottom: 15px;
  right: 15px;
  font-size: 1.2rem;
  color: var(--muted);
  pointer-events: none;
}

html[dir="rtl"] .expand-indicator {
  right: auto;
  left: 15px;
}

.product-drawer-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-product-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-title-section {
  min-width: 0;
}

.drawer-section-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 8px;
}

.product-drawer-info h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.1rem;
  line-height: 1.2;
}

.drawer-attributes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.drawer-attribute-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 145, 94, 0.22);
  box-shadow: 0 10px 25px rgba(31, 26, 23, 0.06);
}

.drawer-attribute-card span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 800;
}

.drawer-attribute-card strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.product-drawer-info p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.98rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.drawer-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, rgba(31, 26, 23, 0.1), transparent);
}

.drawer-contact-btn {
  margin-top: 6px;
  padding: 16px;
  font-size: 1rem;
  border-radius: 14px;
  width: 100%;
}

/* ==========================================================================
   8. FULLSCREEN VIEW MODAL
   ========================================================================== */
.image-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 40px;
}

.image-fullscreen-modal img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

.image-fullscreen-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 40px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* ==========================================================================
   9. DRAWER COLORS STYLES
   ========================================================================== */
.drawer-colors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.drawer-color-item {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.drawer-color-item:hover {
  transform: scale(1.15);
  border-color: var(--gold-dark);
}

.drawer-color-item::after {
  content: attr(data-color-name);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1f1a17;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.drawer-color-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html[dir="rtl"] .drawer-color-item::after {
  direction: rtl;
}

.no-colors-text {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* ==========================================================================
   10. RTL ADAPTATIONS & LOGICAL PROPERTIES
   ========================================================================== */
html[dir="rtl"] .store-pagination {
  direction: rtl;
}

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS (CONSOLIDATED & CLEANED)
   ========================================================================== */
@media (max-width: 1100px) {
  .store-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .store-hero-wrap {
    grid-template-columns: 1fr;
  }

  .hero-image-card {
    max-width: 430px;
  }
}

@media (max-width: 950px) {
  .product-drawer-scrollable {
    padding: 70px 24px 30px;
  }
}

@media (max-width: 768px) {
  .store-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .store-hero {
    padding-top: 104px;
    padding-bottom: 30px;
  }

  .store-hero-wrap {
    padding: 24px;
    border-radius: 26px;
  }

  .store-toolbar {
    padding: 18px;
  }

  .store-toolbar-header h2 {
    font-size: 1.8rem;
  }

  .product-drawer-content {
    width: 100%;
    border-radius: 0;
  }

  html[dir="rtl"] .product-drawer-content {
    border-radius: 0;
  }
  
  .product-drawer-header {
    top: 12px;
    right: 14px;
    gap: 8px;
  }
  
  html[dir="rtl"] .product-drawer-header {
    right: auto;
    left: 14px;
  }
  
  .product-drawer-close,
  .product-drawer-zoom {
    width: 38px;
    height: 38px;
  }
  
  .product-drawer-zoom svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 600px) {
  .store-products-section .container {
    display: flex;
    flex-direction: column;
  }

  .store-products-grid {
    order: 1;
  }

  .no-products-message {
    order: 2;
  }

  .store-pagination-wrapper {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px auto 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    clear: both;
  }

  .store-pagination {
    width: auto;
    max-width: 100%;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    justify-content: center;
    margin: 0 auto;
  }

  .store-pagination .page-link {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .store-toolbar .filter-group:first-child {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
  }

  .store-toolbar .filter-group:first-child::-webkit-scrollbar {
    display: none;
  }

  .store-toolbar .filter-group:first-child .chip span {
    padding: 7px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .store-toolbar .filter-group:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }

  .store-toolbar .filter-group:nth-child(2) .chip span {
    width: 100%;
    text-align: center;
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .product-drawer-close {
    top: 12px;
    right: 14px;
    width: 42px;
    height: 42px;
  }

  html[dir="rtl"] .product-drawer-close {
    left: 14px;
  }
}

@media (max-width: 560px) {
  .store-products-grid {
    grid-template-columns: 1fr;
  }

  .store-hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-image-card {
    max-width: 100%;
    padding: 12px;
    border-radius: 26px;
  }

  .hero-image-card img {
    border-radius: 22px;
  }

  .store-hero-stats {
    flex-direction: column;
  }

  .toolbar-actions,
  .filter-group {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .store-toolbar .filter-group:nth-child(2) {
    grid-template-columns: repeat(2, 1fr);
  }

  .store-toolbar .filter-group:first-child .chip span {
    font-size: 0.72rem;
    padding: 6px 8px;
  }
}

/* جلوگیری از کشیدگی کلمات و سرریز متون طولانی */
.product-info p,
#drawerDescription,
.product-card h3,
.drawer-product-head h2 {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

/* محدود کردن ارتفاع توضیحات فقط در مانیتورها */
@media (min-width: 769px) {
  #drawerDescription {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
  }

  #drawerDescription::-webkit-scrollbar {
    width: 6px;
  }

  #drawerDescription::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 3px;
  }
}

/* Force consistent navbar width */
header .navbar {
  width: min(1180px, 92%) !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

header .navbar nav {
  gap: 1.25rem !important;
}

header .navbar-actions {
  gap: 0.5rem !important;
}

header .lang-btn {
  margin-inline: 0 !important;
  padding: 6px 10px !important;
}