/* Detailed Results Page Specific Styles */
.detailed-results {
  font-family: var(--font-family-base);
  border-radius: 8px;
  margin-top: 90px;
  margin-bottom: var(--spacing-md);
}

.detailed-results .row .col-lg-8,
.detailed-results .row .col-md-12,
.detailed-results .row .mb-4 {
  padding: 0px;
}

/* Breadcrumb Styles */
.product-breadcrumb {
  font-size: var(--font-size-xs);
  color: var(--color-gray-dark);
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.breadcrumb-path {
  flex-grow: 1;
}

.breadcrumb-link {
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--color-gray-dark);
}

.share-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.share-button img {
  width: 24px;
  height: 24px;
  filter: brightness(0) saturate(100%);
}

.share-button-icon {
  display: none;
}

.fixed-cta .share-btn-icon,
.cta-container .share-btn-icon {
  margin-left: auto;
}

/* Product Carousel */
.product-carousel {
  position: relative;
  margin-bottom: var(--spacing-md);
  border-radius: 8px;
  overflow: hidden;
}

.product-carousel img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Thumbnail Navigation */
.thumbnails-wrapper {
  position: relative;
  width: 175px;
}

.product-thumbnails {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: 100%;
  overflow-y: auto;
  max-height: 700px;
  align-items: center;
  padding-top: 3px;
  padding-bottom: 3px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.product-thumbnails::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.thumbnail-item {
  width: 140px;
  height: 140px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  border: 4px solid transparent;
  border-radius: var(--button-radius);
}

.thumbnail-item.active {
  box-shadow: 0 0 0 3px var(--color-black); /* Border outside using box-shadow */
  z-index: 1; /* Ensure shadow appears above other elements */
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--button-radius);
}

.thumbnail-scroll-btn {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  background-color: var(--color-light-cloud);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.thumbnail-scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.thumbnail-scroll-btn:hover {
  background-color: #f7f7f7;
}

.thumbnail-scroll-btn.horizontal {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  transform: none;
  background-color: var(--color-light-cloud);
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.thumbnail-scroll-btn.horizontal.visible {
  opacity: 1;
  pointer-events: auto;
}

.thumbnail-scroll-btn.horizontal:hover {
  background-color: #f7f7f7;
}

body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Main Product Image */
.main-image-container {
  width: 700px;
  height: 700px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--button-radius);
  margin-right: 15px;
  background-color: #f2f5f7;
  position: relative;
}

.main-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* This ensures the image isn't cropped */
  display: block;
}

/* Product Info */
.product-info {
  padding: 0;
}

.product-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--color-TC-black);
  margin-bottom: 19px;
  line-height: 1.2;
}

/* Price Styles */
.price-container {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-3xl);
}

.current-price {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-TC-black);
  /*margin-right: var(--spacing-sm);*/
  margin-right: auto;
}

.original-price {
  font-size: var(--font-size-body);
  color: var(--color-gray-dark);
  text-decoration: line-through;
  margin-right: var(--spacing-sm);
}

.discount-badge {
  background-color: var(--color-highlight);
  color: var(--color-white);
  padding: 4px 8px;
  border-radius: var(--checkbox-radius);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-bold);
}

/* CTA Button */
.cta-container {
  margin-bottom: 15px;
  display: flex;
  gap: 5px;
}

.cta-container .btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0px;
}

.cta-container .btn-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0px;
}

.detailed-results-overlay-content {
  font-size: var(--font-size-xs);
}

.commission-disclosure {
  font-size: 11px;
  color: var(--color-gray-dark);
  opacity: 0.7;
  text-align: center;
}

/* Product Details */
.product-details-section {
  margin-top: var(--spacing-3xl);
  margin-bottom: var(--spacing-xl);
}

.details-heading {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-bold);
  color: var(--color-TC-black);
  margin-bottom: var(--spacing-md);
}

.details-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.detail-item {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--spacing-xs);
  border-bottom: var(--border-width-sm) solid var(--color-gray-light);
}

.detail-label {
  font-weight: var(--font-weight-regular);
  color: var(--color-gray-dark);
  opacity: 0.5;
  font-size: var(--font-size-body);
}

.detail-value {
  font-weight: var(--font-weight-regular);
  color: var(--color-gray-dark);
  font-size: 15px;
}

/* Overlay Styles */
.custom-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 255, 0.2);
  z-index: var(--z-index-overlay);
  justify-content: center;
  align-items: center;
}

.emoji-container {
  font-size: 48px;
  margin-bottom: var(--spacing-sm);
}

.overlay-content h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-md);
}

.overlay-content p {
  font-size: var(--font-size-body);
  margin-bottom: var(--spacing-lg);
  color: var(--color-gray-dark);
}

.small-text {
  font-size: var(--font-size-small);
  margin-bottom: var(--spacing-sm);
}

.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: 100%;
}

.primary-actions, .secondary-actions {
  display: flex;
  gap: var(--spacing-sm);
  width: 100%;
}

.primary-actions .btn-primary {
  flex: 1;
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Style for close button X in top-right corner */
#cancelFeatureOverlay.btn-link {
  position: absolute;
  top: -10px;
  right: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-gray-dark);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

#cancelFeatureOverlay.btn-link:hover {
  opacity: 1;
}

.secondary-actions {
  justify-content: center;
}

.secondary-actions .btn-secondary {
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
}

/* Product Gallery Layout */
.product-gallery {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  align-items: flex-start;
}

.share-btn-icon {
  display: none;
}

/* Responsive Adjustments for screens below 1200px */
@media (max-width: 1200px) {
  .product-gallery {
    flex-direction: column-reverse; /* Changes direction to show main image first */
  }

  .main-image-container {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    margin-right: 15px;
    margin-bottom: var(--spacing-sm);
  }

  .thumbnails-wrapper {
    width: 100%; /* Take full width */
    position: relative; /* Ensure this is set */
    overflow: hidden; /* Important: clip the overflow */
    display: flex; /* Add this to create a flex container */
    align-items: center; /* Center items vertically */
  }

  .product-thumbnails {
    flex-direction: row;
    max-height: unset;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px; /* Add padding to show active shadow */
    gap: 8px;
    flex: 1;
    width: auto;
  }

  .thumbnail-item {
    width: 100px;
    height: 100px;
    margin-right: 0; /* Reset margin */
  }

  .thumbnail-scroll-btn {
    display: none; /* Hide vertical scroll button */
  }

  .thumbnail-scroll-btn.horizontal {
    display: flex;
    position: sticky; /* Change from absolute to sticky */
    right: 0; /* Stick to the right edge */
  }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
  .product-breadcrumb {
    display:none;
  }

  .product-gallery {
    margin-bottom: var(--spacing-xs);
    gap: 0;
  }
  .product-title {
    font-size: var(--font-size-body);
  }

  .thumbnail-item {
    width: 90px;
    height: 90px;
  }

  /* Sticky CTA container for mobile */
  .cta-container {
    width: 100%;
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    z-index: 90;
    margin-bottom: 15px;
  }

  .fixed-cta {
    /* The fixed clone that stays at bottom of viewport */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--color-white);
    padding: var(--spacing-sm);
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.6);
    z-index: 299;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0px;
  }



  .share-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
  }

  .share-btn-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%);
  }


  /* Add padding to the bottom of the content to prevent CTA overlap */
  .detailed-results {
    padding-bottom: var(--spacing-md);
    margin-top: 120px;
  }

  .details-heading {
    display:none;
  }

  /* Make buttons in CTA container display properly */
  .cta-container .btn-primary,
  .fixed-cta .btn-primary {
    flex: 1;
    margin-right: 0px;
    margin-bottom: 0px;
    font-size: var(--font-size-xs) !important;
  }

  /* Make buttons in CTA container display properly */
  .cta-container .btn-secondary,
   .fixed-cta .btn-secondary {
    flex: 1;
    width: 100%;
    font-size: var(--font-size-xs);
  }

  /* Additional spacing for product info */
  .product-info {
    padding: 0 var(--spacing-sm);
  }

  /* Price container adjustments */
  .price-container {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
  }

  .breadcrumb-path {
    display: none;
  }

  .product-details-section {
    margin-top: 0;
  }

  .primary-actions, .secondary-actions {
    flex-direction: row;
  }

  .secondary-actions {
    align-items: center;
  }

  .secondary-actions .btn-secondary {
    margin-right: 0;
    margin-bottom: var(--spacing-sm);
  }
}

  /* General overlay styles */
  .payment-overlay,
  .custom-overlay,
  .result-overlay,
  .error-overlay,
  .no-match-overlay,
  .measurements-overlay,
  .upgrade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  /* Show overlay when active */
  .payment-overlay[style*="display: flex"],
  .result-overlay,
  .error-overlay,
  .no-match-overlay,
  .measurements-overlay,
  .upgrade-overlay {
    display: flex;
  }

  /* Overlay content container */
  .detailed-results-overlay-content {
    background: white;
    padding: 20px;
    border-radius: var(--button-radius);
    max-width: 95%;
    width: 500px;
    text-align: center;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
  }

  .result-overlay table {
    width: 100%;
    max-width: 100%;
    margin: 5px auto;
    border-collapse: separate;
    border-spacing: 8px; /* Increase spacing between cells */
    table-layout: fixed;
  }

  .result-overlay table th,
  .result-overlay table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
  }

  .result-overlay table th {
    background-color: #f8f9fa;
    font-weight: bold;
  }

  /* Emoji container */
  .emoji-container {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
  }

  /* Feature list styling */
  .feature-list {
    text-align: left;
    margin-bottom: 15px;
    padding-left: 20px;
  }

  .fit-details-container {
    width: 100%;
    overflow-x: auto;
    margin: 5px 0px;
    display: flex;
    justify-content: center; /* Center the table container */
  }

  /* Fit results table */
  .fit-results-table {
    min-width: 80%;
    max-width: 100%;
    margin: 5px auto;
    border-collapse: separate;
    border-spacing: 4px; /* Add space between cells */
    font-size: 0.9rem;
  }

  .fit-results-table th,
  .fit-results-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
  }

  .fit-results-table th {
    background-color: #f8f9fa;
    font-weight: bold;
  }

  /* Fit details container for better responsiveness */
  .fit-details-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 15px;
  }

  /* Fit result headings */
  .fit-result-heading {
    margin-bottom: 15px;
    font-weight: bold;
  }

  .fit-success {
    color: #28a745;
  }

  .fit-failure {
    color: #dc3545;
  }

  .fit-guidance {
    font-weight: bold;
    margin-bottom: 15px;
  }

  /* Action buttons container */
  .action-buttons {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    .detailed-results-overlay-content {
      width: 95%;
      font-size: 1.4rem;
    }

    .fit-results-table {
      font-size: 1.2rem;
    }

    .fit-results-table th,
    .fit-results-table td {
      padding: 5px;
    }

    .fit-result-heading {
      font-size: 1.2rem;
    }
  }

  @media (max-width: 480px) {
    .detailed-results-overlay-content {
      width: 95%;
      font-size: 0.9rem;
    }

    .fit-results-table {
      font-size: 0.9rem;
    }

    .fit-results-table th,
    .fit-results-table td {
      padding: 6px;
    }

    .fit-result-heading {
      font-size: 1.1rem;
    }

    .emoji-container {
      font-size: 1.5em;
    }
  }

@media (min-width: 992px) and (max-width: 1200px) {
  .detailed-results .product-gallery {
    margin-right: 15px;
  }
}

.save-item-button-detailed {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: rgba(242, 239, 235, 0.8);
  color: #000000;
  border: none;
  border-radius: 20px;
  height: 50.64px;
  width: 74.69px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  padding: 0;
}

.save-item-button-detailed:hover {
  background-color: rgba(242, 239, 235, 1);
  transform: scale(1.05);
}

.save-item-button-detailed svg {
  width: 24px;
  height: 24px;
  stroke: #000000;
  fill: none;
  transition: fill 0.3s ease;
}

.save-item-button-detailed.saved svg {
  fill: var(--color-highlight);
  stroke: var(--color-highlight);
}

.save-item-button-detailed:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.product-gallery {
  position: relative;
}

/* Multiple size options styling */
.size-options-summary h3 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #145840;
}

.size-options-summary > p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.summary-card {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.summary-card:hover {
    background: #e9ecef;
}

.details-section {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
    margin-bottom: 0;
    animation: slideDown 0.3s ease-out;
}

.details-section h4 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #495057;
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-size {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.summary-icon {
    font-size: 1.5em;
}

.summary-status {
    margin: 8px 0;
    font-size: 0.95em;
    color: #555;
}

.toggle-details-btn {
    background: none;
    border: none;
    border-radius: 8px;
    color: #145840;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.toggle-details-btn:hover {
    text-decoration: none;
}

.toggle-details-btn .arrow {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.size-options-details {
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-cards {
        gap: 10px;
    }

    .summary-card {
        padding: 12px;
    }

    .summary-size {
        font-size: 1em;
    }

    .summary-icon {
        font-size: 1.3em;
    }
}