/* Accessibility */
.cgbt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cgbt-size-select:focus,
.cgbt-add-to-cart:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Layout */
.cgbt-container {
  max-width: 960px; /* Should be a variable */
  margin: 0 auto;
  padding: 20px;
}

.cgbt-header {
  margin-bottom: 15px;
}

.cgbt-title {
  font-size: 26px;
  font-weight: 700;
  color: #333;
}

.cgbt-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #444;
}

.cgbt-item-count {
  flex-shrink: 0;
  margin-left: 20px;
}

.cgbt-main-layout {
  display: grid;
  grid-template-columns: calc(40% - 10px) calc(60% - 10px);
  gap: 20px;
}

.cgbt-main-image-container {
  position: relative;
}

.cgbt-main-image {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.cgbt-content-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: #fff;
  padding: 20px;
  border: 1px solid #eee;
  box-shadow: 0 0 12px 0 rgba(35, 35, 35, .1);
}

.cgbt-thumbnails-wrapper {
  position: relative;
  overflow: hidden;
}

.cgbt-thumbnails-container {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #6b7280 #f1f5f9;
  padding-bottom: 12px;
}

.cgbt-thumbnails-container::-webkit-scrollbar {
  height: 2px;
}

.cgbt-thumbnails-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.cgbt-thumbnails-container::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 2px;
}

.cgbt-thumbnails-container::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Left gradient - initially hidden */
.cgbt-thumbnails-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 2; /* Higher than right gradient */
  transition: opacity 0.3s ease;
  opacity: 0; /* Initially hidden */
}

.cgbt-thumbnails-wrapper.gradient-left-visible::before {
  opacity: 1;
}

.cgbt-thumbnails-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.cgbt-thumbnails-wrapper.gradient-hidden::after {
  opacity: 0;
}

.cgbt-thumbnail {
  width: 75px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: inset 0 0 0 1px #fff;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.cgbt-thumbnail.cgbt-active {
  border-color: #2563eb;
}

.cgbt-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cgbt-product-details {
  border-top: 1px solid #eee;
  padding-top: 20px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
  display: none; /* Hide all product details by default */
}

.cgbt-product-details.cgbt-product-active {
  display: grid; /* Show only the active product details */
}

.cgbt-product-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.cgbt-product-content {
  display: flex;
  flex-direction: column;
}

.cgbt-product-name {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.4;
}

.cgbt-product-stock {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cgbt-product-price {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}

.cgbt-product-price.cgbt-sale-price {
  color: #dc2626;
}

.cgbt-product-options {
  margin-bottom: 10px;
}

.cgbt-option-group {
  margin-bottom: 10px;
}

.cgbt-add-to-cart {
  background: #fff;
  border: 2px solid #3C6F09;
  color: #3C6F09;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.cgbt-add-to-cart:hover {
  background: #3C6F09;
  color: #fff;
}

.cgbt-option-label {
  font-size: 11px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cgbt-option-value {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: #444;
  margin-left: 5px;
  font-weight: normal;
}

.cgbt-size-select {
  width: 100%;
  padding: 10px 7px;
  border: 1px solid #999;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.cgbt-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


@media (max-width: 768px) {
  .cgbt-container {
    max-width: 100%;
    padding: 15px;
  }

  .cgbt-main-layout {
    display: block;
  }

  .cgbt-thumbnail {
    width: 60px;
  }
  
  .cgbt-thumbnails-container {
    justify-content: flex-start;
  }

  .cgbt-header-row {
    font-size: 13px;
  }

  .cgbt-add-to-cart {
    font-size: 12px;
  }
  
  .cgbt-product-details {
    grid-template-columns: 100px 1fr;
    gap: 15px;
  }

  .cgbt-size-select {
    font-size: 16px;
  }

}