/* ============================================================
   TAMMIA PRODUCT GALLERY CSS
   ============================================================ */

/* Layout */
article.product-layout {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 24px;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.product-gallery-col {
  flex: 0 0 420px !important;
  max-width: 420px;
}

.product-info-col {
  flex: 1 1 0 !important;
  min-width: 0;
}

/* Main image */
.gallery-main-wrap {
  position: relative;
  width: 100%;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-main-link {
  display: block;
  position: relative;
}

.gallery-main-img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  display: block;
}

.gallery-zoom-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-main-wrap:hover .gallery-zoom-icon {
  opacity: 1;
}

/* Thumbnail wrap */
.gallery-thumbs-wrap {
  position: relative;
  margin-top: 10px;
  padding: 0 30px;
}

.gallery-thumbs-swiper {
  width: 100%;
  overflow: hidden;
}

.gallery-thumbs-swiper .swiper-wrapper {
  display: flex;
  align-items: center;
}

.gallery-thumbs-swiper .swiper-slide {
  width: 72px !important;
  height: 72px !important;
  flex-shrink: 0;
}

.gallery-thumb-btn {
  width: 72px;
  height: 72px;
  padding: 2px;
  border: 2px solid transparent;
  background: #f5f5f5;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-thumb-btn:hover {
  border-color: #ee4d2d;
}

.gallery-thumb-btn.is-active {
  border-color: #ee4d2d;
}

.gallery-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 9px;
  text-align: center;
  padding: 2px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Swiper nav buttons */
.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px !important;
  height: 28px !important;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-prev { left: 0; }
.gallery-next { right: 0; }

.gallery-prev::after,
.gallery-next::after {
  font-size: 12px !important;
  color: #555 !important;
}

/* No image placeholder */
.gallery-no-image {
  width: 100%;
  height: 300px;
  background: #f5f5f5;
  border-radius: 4px;
}

/* ============================================================
   SHOPEE-STYLE LIGHTBOX
   ============================================================ */
.tlb-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.tlb-open {
  overflow: hidden;
}

.tlb-container {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.tlb-left {
  position: relative;
  width: 540px;
  min-width: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tlb-main-img {
  max-width: 540px;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.tlb-right {
  width: 200px;
  min-width: 160px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.tlb-title {
  font-size: 13px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.tlb-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  overflow-y: auto;
}

.tlb-thumb-item {
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f5f5f5;
  transition: border-color 0.15s;
}

.tlb-thumb-item:hover {
  border-color: #ee4d2d;
}

.tlb-thumb-item.is-active {
  border-color: #ee4d2d;
}

.tlb-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Nav arrows in lightbox */
.tlb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 64px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tlb-nav:hover {
  background: rgba(255,255,255,0.35);
}

.tlb-prev { left: 0; border-radius: 0 4px 4px 0; }
.tlb-next { right: 0; border-radius: 4px 0 0 4px; }

/* Close button */
.tlb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.tlb-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ============================================================
   PRODUCT INFO COLUMN
   ============================================================ */
.product-info-col .product-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #212121;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Hide the default variation select (we replace with chips) */
.product-info-col .field--name-purchased-entity select,
.product-info-col .field--widget-commerce-product-variation-title select {
  display: none !important;
}

/* Variation Chips */
.product-variation-wrapper {
  margin: 10px 0 14px 0;
}

.variation-chips-label {
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
  font-weight: 500;
}

.variation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variation-chip {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
  transition: all 0.15s;
  white-space: nowrap;
  outline: none;
}

.variation-chip:hover {
  border-color: #ee4d2d;
  color: #ee4d2d;
}

.variation-chip.is-active {
  border-color: #ee4d2d;
  color: #ee4d2d;
  background: #fff8f6;
  box-shadow: 0 0 0 1px #ee4d2d;
}

/* Price styling */
.product-info-col .field--name-price .field__item {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ee4d2d;
  margin-bottom: 8px;
}

/* Add to cart button */
.product-info-col .btn-primary,
.product-info-col [data-drupal-selector="edit-actions"] .button {
  background: #ee4d2d !important;
  border-color: #ee4d2d !important;
  color: #fff !important;
  border-radius: 3px !important;
  padding: 10px 24px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  width: 100%;
  margin-top: 0;
  transition: background 0.15s !important;
}

.product-info-col .btn-primary:hover,
.product-info-col [data-drupal-selector="edit-actions"] .button:hover {
  background: #d73211 !important;
  border-color: #d73211 !important;
}

/* Responsive */
@media (max-width: 768px) {
  article.product-layout {
    flex-direction: column !important;
  }
  .product-gallery-col {
    flex: none !important;
    max-width: 100%;
    width: 100%;
  }
  .gallery-main-img {
    height: 300px;
  }
  .tlb-container {
    flex-direction: column;
    max-width: 98vw;
  }
  .tlb-left { width: 100%; min-width: unset; }
  .tlb-right { width: 100%; }
  .tlb-main-img { max-width: 100%; }
}
/* Product price display */
.product-price-display {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ee4d2d;
  margin: 6px 0 12px 0;
  line-height: 1.2;
}

/* Product title in info col */
.product-info-col .field--name-title,
.product-info-col h1.product-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}


/* Hide duplicate Swiper navigation buttons - using custom .gallery-thumb-nav-btn instead */
.gallery-thumbs-wrap .swiper-button-prev,
.gallery-thumbs-wrap .swiper-button-next {
  display: none !important;
}
