/******************** Containers Styles ********************/
.base-section-container {
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem;
  overflow: hidden;
}

.categories-section {
  padding: 5rem 1.5rem;
}

/* Product pages - wider container */
.single-product .base-section-container {
  max-width: 1600px;
  padding: 2rem 1rem;
}

.extended-section-container {
  max-width: 1380px;
  gap: 0.25rem;
}

.flex-reverse-row-sts,
.flex-row-to-column-sts {
  display: flex;
  gap: 2rem;
  padding: 0 2rem;
  flex-direction: row-reverse; /* Right side first (images), then left side (details) */
  align-items: flex-start;
}

.flex-row-to-column-sts {
  flex-direction: row !important;
  align-items: start;
  padding: 0 1rem;
}

.flex-row-to-column-sts .product-images-section,
.flex-row-to-column-sts .product-details-section {
  flex: 1;
  min-width: 0;
  align-items: flex-start;
}

@media screen and (max-width: 986px) {
  .flex-row-to-column-sts {
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .single-product .base-section-container {
    padding: 2rem 0.75rem;
  }
}

@media screen and (max-width: 767px) {
  .flex-row-to-column-sts {
    flex-direction: column !important;
    align-items: center;
  }
}

/* Responsive triple images container */
.triple-images-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  max-width: 1344px;
  height: auto;
  overflow: hidden;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .base-section-container {
    padding: 0.75rem 0.75rem !important;
  }
}

.base-section-container .relative {
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.product-flex-container {
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  position: relative;
  width: calc(100% - var(--arrow-button-wrapper));
  gap: 1rem;
  margin: 0 var(--arrow-button-wrapper);
  box-sizing: border-box;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
}

/* Ensure product containers and cards are clickable */
.product-container .product-card {
  pointer-events: auto;
}

.product-flex-container.dragging {
  cursor: grabbing;
  -webkit-user-select: none;
  user-select: none;
}

.product-flex-container.dragging * {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.triple-images-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  will-change: transform;
}

.product-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(25% - 0.375rem);
  gap: 0.5rem;
  width: 100%;
  will-change: transform;
  pointer-events: auto;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Force LTR so scrollLeft is always a simple positive number,
     even on this RTL (Hebrew) site. Product cards restore RTL below. */
  direction: ltr;
}

.product-container::-webkit-scrollbar {
  display: none;
}

/* Snap each product card and restore RTL layout inside it */
.product-container > * {
  scroll-snap-align: start;
  direction: rtl;
}

@media (max-width: 767px) {
  .product-container {
    grid-auto-columns: calc(50% - 0.25rem);
  }
}

/* categories container v2 */
.categories-container {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem;
}

@media (max-width: 1024px) {
  .categories-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .categories-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-card-title {
    font-size: 1.5rem;
  }
}

/******************** End of Container Styles ********************/

/******************** Grid Styles ********************/
.images-gallery-container {
  display: grid;
  grid-template-columns: repeat(3, 288px);
  grid-template-rows: auto;
  gap: 0.6rem;
  justify-content: center;
  max-width: fit-content;
  margin: 0 auto;
}

.only-mobile {
  display: none;
}

.item-completion-image {
  display: none;
}

.products-grid-wrapper {
  width: 100%;
  padding: 1rem 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(min(200px, 100%), 1fr));
  gap: 2rem;
  justify-items: center;
  width: 100%;
}

.gemstone-grid {
  gap: 0rem;
}

.product-container .product-card {
  display: flex;
  flex-direction: column; /* This reverses the order! */
  width: 100%;
  overflow: hidden;
  transition: transform 0.3s ease;
  position: relative;
  max-width: 270px;
}

.product-grid .product-card:hover {
  transform: translateY(-4px);
}

@media (max-width: 1280px) {
  .images-gallery-container {
    grid-template-columns: repeat(3, 288px);
  }
}

@media (max-width: 960px) {
  .images-gallery-container {
    grid-template-columns: repeat(2, 288px);
  }

  .only-mobile {
    display: block;
  }

  .item-completion-image {
    display: block;
  }
}

@media (max-width: 640px) {
  .images-gallery-container {
    grid-template-columns: repeat(2, clamp(140px, 40vw, 288px));
    gap: 0.3rem;
  }

  .images-gallery-container img {
    width: 100%;
    height: 280px !important;
    aspect-ratio: 288 / 420;
  }
}

@media (max-width: 1200px) {
  .products-grid,
  .product-grid {
    grid-template-columns: repeat(3, minmax(min(200px, 100%), 1fr));
    gap: 1.5rem;
  }
}

/* Mobile (2 columns) */
@media (max-width: 767px) {
  .products-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(min(120px, 100%), 1fr));
    gap: 0.5rem;
  }

  .products-grid .product-card,
  .product-grid .product-card {
    min-width: 120px;
  }

  .product-image-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 285 / 360;
  }

  .product-actions {
    gap: 2px;
    width: 100%;
  }

  .product-actions .add_to_cart_button,
  .product-actions .wishlist-toggle {
    width: 100%;
  }
}

/******************** End of Grid Styles ********************/

/******************** Hero Section ********************/
.hero-section {
  position: relative;
  width: 100%;
  aspect-ratio: 1900 / 600;
  height: auto;
  overflow: hidden;
  margin-bottom: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .hero-section {
    height: 300px;
  }

  .hero-image {
    min-height: 145px;
  }
}
/******************** End of Hero Section ********************/

/******************** Archive Page Styles ********************/
/* Archive page containers */
.custom-shop-page,
.custom-product-category-page {
  margin: 0;
  padding: 0;
  width: 100%;
  display: block;
  clear: both;
  background: white;
}

/* Archive-specific container layout overrides */
.custom-shop-page .ast-separate-container,
.custom-shop-page .site-content .ast-container,
.custom-shop-page .ast-container,
.custom-shop-page .ast-separate-container .ast-container,
.custom-product-category-page .ast-separate-container,
.custom-product-category-page .site-content .ast-container,
.custom-product-category-page .ast-container,
.custom-product-category-page .ast-separate-container .ast-container {
  display: block !important;
  flex-direction: column !important;
  flex-wrap: wrap !important;
}

/* Note: Sidebar hiding and primary full-width are handled globally in base.css */
/******************** End of Archive Page Styles ********************/

/******************** Logos Carousel ********************/
.logos-carousel-section {
  overflow: hidden;
}

.logos-carousel-wrapper {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.logos-carousel-wrapper:active {
  cursor: grabbing;
}

.logos-track {
  display: flex;
  flex-direction: row;
  direction: ltr; /* force LTR so translateX is always left-to-right, regardless of RTL page */
  gap: 16px;
  will-change: transform;
  /* transition is set dynamically by JS */
}

.logo-slide {
  flex-shrink: 0;
  width: 200px;
  height: 100px;
}

.logo-placeholder {
  width: 200px;
  height: 100px;
  background-color: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

.logo-slide img {
  width: 200px;
  height: 100px;
  object-fit: contain;
  display: block;
}
/******************** End of Logos Carousel ********************/

/******************** Testimonials ********************/
.testimonials-section {
  padding: 3rem 1.5rem 5rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.testimonial-card {
  position: relative;
  background-color: white;
  border-radius: 12px;
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  direction: rtl;
  min-height: 200px;
}

.testimonial-quote {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 5rem;
  line-height: 1;
  color: var(--color-accent);
  font-family: Georgia, serif;
  pointer-events: none;
  user-select: none;
}

.testimonial-text {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-family-alef);
  font-size: var(--font-size-text);
  line-height: 1.7;
  flex: 1;
}

.testimonial-name {
  margin: 0;
  font-family: var(--font-family-alef);
  font-size: var(--font-size-text);
  font-weight: 700;
  text-align: right;
}

@media (max-width: 767px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}
/******************** End of Testimonials ********************/

/******************** Gallery ********************/
.gallery-section {
  width: 100%;
  padding: 3rem 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-cta-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
/******************** End of Gallery ********************/
