/* ===== BASE & RESET ===== */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #F8F6F3;
  font-family: 'Vazirmatn', sans-serif;
}
main {
  flex: 1;
  background-color: #F8F6F3;
}
::-webkit-scrollbar {
  display: none;
}

#scroll-space {
  height: 5vh;
}
body.products-page #scroll-space {
  height: 15vh;
}

/* ===== LOAD SCREEN ===== */
#intro-loader {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
#intro-logo {
  width: 80px;
  animation: spinSequence 3s infinite ease-in-out;
}
@keyframes spinSequence {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(360deg); }
  55%  { transform: rotate(360deg); }
  100% { transform: rotate(720deg); }
}
#intro-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== FAKE SCROLLBAR ===== */
.fake-scrollbar {
  position: fixed;
  top: 10vh;
  right: calc(1rem - 2.5px);
  width: 5px;
  height: 80vh;
  pointer-events: none;
  z-index: 9999;
}
.fake-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55px;
  background-color: rgba(110, 110, 110, 0.4);
  border-radius: 3px;
  transition: background-color 0.3s ease;
  pointer-events: auto;
  transition: 
    background-color 0.3s ease,
    transform 0.2s ease,
    box-shadow 0.3s ease;  
}
.fake-scrollbar-thumb:hover {
  background-color: #D4AF37AA;
  transform: scaleX(1.5);
}
.fake-scrollbar-thumb:active {
  transform: scaleX(1.5);
  background-color: #D4AF37AA;
}

.chat-wrapper, .faq-wrapper, .tip-wrapper{
  position: relative;
}
.chat-scrollbar, .faq-scrollbar, .tip-scrollbar{
  position: absolute;
  top: 0;
  right: -2px;
  width: 4px;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.chat-scrollbar-thumb, .faq-scrollbar-thumb, .tip-scrollbar-thumb{
  position: absolute;
  top: 0;
  width: 100%;
  height: 24px;
  background: rgba(110,110,110,0.35);
  border-radius: 999px;
  pointer-events: auto;
  transition: background-color .3s, transform .2s;
}
.chat-scrollbar-thumb:hover, .faq-scrollbar-thumb:hover, .tip-scrollbar-thumb:hover{
  background: #D4AF37AA;
  transform: scaleX(1.5);
}
.chat-scrollbar-thumb:active, .faq-scrollbar-thumb:active, .tip-scrollbar-thumb:active{
  background: #D4AF37AA;
  transform: scaleX(1.5);
}

.tip-container{
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 8px;
}

/* ===== SKELETON LOADER ===== */
.skeleton-grid:not([style*="display: none"]) ~ .scroll-arrow,
.skeleton-grid:not([style*="display: none"]) ~ .featured-container .scroll-arrow {
  opacity: 0;
  pointer-events: none;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  width: 100%;
  max-width: 1536px;
  margin: 0 auto;
}
.skeleton-card {
  width: 300px;
  height: 400px;
  border-radius: 5px;
  background: linear-gradient(
    90deg,
    #E8E8E8 0%,
    #F0F0F0 50%,
    #E8E8E8 100%
  );
  animation: skeletonWave 2s infinite;
  box-shadow: 0 0px 0px rgba(0,0,0,0.08);
  position: relative;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 300px;
  height: 400px;
  background: linear-gradient(
    90deg,
    #E8E8E8 0%,
    #F0F0F0 50%,
    #E8E8E8 100%
  );
  animation: skeletonWave 2s infinite;
  border-radius: 0 0 5px 5px;
}
.featured-overlay-1 .skeleton-grid,
.featured-overlay-2 .skeleton-grid,
.featured-overlay-3 .skeleton-grid,
.featured-overlay-4 .skeleton-grid {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 2rem;
  padding-bottom: 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.featured-overlay-1 .skeleton-grid,
.featured-overlay-2 .skeleton-grid,
.featured-overlay-3 .skeleton-grid,
.featured-overlay-4 .skeleton-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}
.skeleton-card {
  flex: 0 0 auto;
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 0px 0px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}
.products-section {
  position: relative;
  min-height: 100vh;
}
.search-page .products-section {
  position: relative;
  min-height: 100vh;
}
#search-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 20px;
  background: #F8F6F3;
  z-index: 10;
}
.product-image,
.main-photo,
.thumb {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #E8E8E8 0%, #F0F0F0 50%, #E8E8E8 100%);
  background-size: 200% 100%;
}
.product-image::before,
.main-photo::before,
.thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #E8E8E8 0%, #F0F0F0 50%, #E8E8E8 100%);
  background-size: 200% 100%;
  animation: skeletonWave 2s infinite;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.product-image.image-loaded::before,
.main-photo.image-loaded::before,
.thumb.image-loaded::before {
  opacity: 0;
}
.product-image img,
.main-photo img,
.thumb {
  position: relative;
  z-index: 1;
  display: block;
  transition: opacity 0.25s ease;
}
.product-image img.image-loading,
.main-photo img.image-loading,
.thumb.image-loading {
  opacity: 0;
}
.product-image img.image-loaded,
.main-photo img.image-loaded,
.thumb.image-loaded {
  opacity: 1;
}
@keyframes skeletonWave {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}