/* Modern Single Product Page Styles */
.product-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.product-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Gallery Styles */
.product-gallery {
  flex: 1;
  min-width: 300px;
}

/* Sticky Product Gallery - Desktop Only */
@media (min-width: 768px) {
  .product-gallery {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    transition: all 0.3s ease;
    /* Remove max-height and overflow to show full image and thumbnails */
  }
}

.product-main-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.product-main-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.product-thumbnails {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: #069669 #f1f1f1;
}

/* Custom scrollbar for thumbnails */
.product-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.product-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.product-thumbnails::-webkit-scrollbar-thumb {
  background: #069669;
  border-radius: 10px;
}

.product-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #069669;
}

.thumbnail-item {
  flex: 0 0 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnail-item:hover {
  border-color: #069669;
  transform: translateY(-2px);
}

.thumbnail-item.active {
  border-color: #069669;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Product Summary Styles */
.product-summary {
  flex: 1;
  min-width: 300px;
  padding: 1.5rem;
}

.codleade-order-success-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.codleade-order-success-banner .cosb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: #10b981;
}

.codleade-order-success-banner h3 {
  margin: 0;
  font-size: 1rem;
  color: #064e3b;
}

.codleade-order-success-banner p {
  margin: 0;
  color: #065f46;
  font-size: 0.875rem;
}

.product-variations-summary {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.variation-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.variation-label {
  font-weight: 700;
  color: #069669;
  font-size: 0.9rem;
}

.variation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.variation-option {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-size: 0.8rem;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  line-height: 1.4;
  text-align: center;
  background-color: #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .product-title {
    font-size: 1rem;
    padding: 0.625rem 0.875rem;
  }
}

.product-price {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1.75rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  text-align: right;
}

.product-price * {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
}

.product-price .woocommerce-Price-amount {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.product-price .woocommerce-Price-currencySymbol {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.product-price del {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1rem;
  font-weight: 700;
  color: #ff0000;
  text-decoration: line-through;
}

.product-price del * {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #ff0000 !important;
  text-decoration: line-through !important;
}

.product-price del .woocommerce-Price-amount {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #ff0000 !important;
  text-decoration: line-through !important;
}

.product-price del .woocommerce-Price-currencySymbol {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #ff0000 !important;
  text-decoration: line-through !important;
}

.product-price ins {
  text-decoration: none;
}

.product-price ins * {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.product-price ins .woocommerce-Price-amount {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.product-price ins .woocommerce-Price-currencySymbol {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.codleade-qty-offers {
  border: 1px solid var(--qty-offer-border, #e5e7eb);
  border-radius: 20px;
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  direction: rtl;
  text-align: right;
}

.codleade-qty-offers__header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.codleade-qty-offers__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.codleade-qty-offers__description {
  margin-top: 0.35rem;
  color: #4b5563;
  font-size: 0.85rem;
}

.codleade-qty-offers__list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.codleade-qty-offer {
  position: relative;
  border: 1px solid var(--qty-offer-border, #e5e7eb);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: var(--qty-offer-bg, #ffffff);
  box-shadow: 0 12px 30px var(--qty-offer-shadow, rgba(0, 0, 0, 0.05));
}

.codleade-qty-offer input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.codleade-qty-offer.is-active {
  border-color: var(--qty-offer-border, #facc15);
  background: var(--qty-offer-active, #fef3c7);
  box-shadow: 0 10px 25px var(--qty-offer-active-shadow, rgba(250, 204, 21, 0.25));
}

.codleade-qty-offer__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-direction: row-reverse;
  padding-right: 3.5rem;
}

.codleade-qty-offer__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.codleade-qty-offer__subtitle {
  margin: 0.1rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.codleade-qty-offer__pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.codleade-qty-offer__price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--qty-offer-price, #111827);
}

.codleade-qty-offer__compare {
  font-size: 0.85rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.codleade-qty-offer__note {
  font-size: 0.85rem;
  color: #059669;
  font-weight: 600;
}

.codleade-qty-offer__description {
  font-size: 0.8rem;
  color: #6b7280;
}

.codleade-qty-offer__badge {
  position: absolute;
  left: 1.25rem;
  top: -0.65rem;
  background: var(--qty-offer-badge, #facc15);
  color: var(--qty-offer-badge-text, #ffffff);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.codleade-qty-offer__quantity {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-weight: 700;
  color: var(--qty-offer-quantity-text, #ffffff);
  background: var(--qty-offer-quantity-bg, rgba(250, 204, 21, 0.15));
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .codleade-qty-offers {
      padding: 1rem;
  }
  .codleade-qty-offers__header h3 {
      font-size: 1rem;
  }
  .codleade-qty-offer {
      padding: 0.85rem;
  }
  .codleade-qty-offer__body {
      flex-direction: column;
      align-items: flex-end;
      gap: 0.5rem;
      padding-right: 2.5rem;
  }
  .codleade-qty-offer__pricing {
      align-items: flex-end;
  }
  .codleade-qty-offer__title {
      font-size: 0.95rem;
  }
  .codleade-qty-offer__subtitle,
  .codleade-qty-offer__note,
  .codleade-qty-offer__description {
      font-size: 0.75rem;
  }
  .codleade-qty-offer__price {
      font-size: 1.1rem;
  }
}

.product-description {
  color: #4b5563;
  margin-bottom: 2rem;
  margin-top: 1.5rem;
  line-height: 1.6;
}

.product-meta {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.product-meta>span {
  display: block;
  margin-bottom: 0.5rem;
}

.product-meta a {
  color: #069669;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-meta a:hover {
  color: #069669;
}

/* Add to Cart Form */
.cart {
  margin: 1.5rem 0;
}

.cart-form {
  margin: 1.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.quantity-selector {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.quantity-label {
  margin-right: 1rem;
  font-weight: 600;
  color: #069669;
}

.quantity-input {
  width: 80px;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
}

.add-to-cart-button,
.custom-add-to-cart-button {
  background-color: #069669;
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 4px 6px rgba(168, 101, 35, 0.2);
}

.add-to-cart-button:hover,
.custom-add-to-cart-button:hover {
  background-color: #069669;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(168, 101, 35, 0.3);
}

.add-to-cart-button:active,
.custom-add-to-cart-button:active {
  transform: translateY(0);
}

.add-to-cart-button.loading,
.custom-add-to-cart-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
}


/* Variations */
.variations-form {
  margin-bottom: 1.5rem;
}

.variation-selector {
  margin-bottom: 1rem;
}

.variation-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #069669;
}

.variation-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
  font-size: 1rem;
}

.reset-variations {
  display: inline-block;
  margin-top: 0.5rem;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
}

.reset-variations:hover {
  color: #069669;
}

/* Stock Status */
.stock-status {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.in-stock {
  background-color: #ecfdf5;
  color: #059669;
}

.out-of-stock {
  background-color: #fef2f2;
  color: #dc2626;
}

/* Stock Status Icon */
.price-stock-container .stock-status {
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
}

.price-stock-container .stock-status svg {
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-container {
    padding: 1rem 0.5rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .product-content {
    flex-direction: column;
    gap: 1rem;
  }

  .product-gallery {
    position: static;
    /* Disable sticky on mobile */
  }

  .product-gallery,
  .product-summary {
    width: 100%;
    max-width: 100% !important;
  }

  .product-summary {
    padding: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Full width form on mobile */
  .product-summary .codleade-cod-form {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 1rem 0.75rem !important;
  }

  .product-title {
    font-size: 1.75rem;
  }

  .product-price {
    font-size: 1.5rem;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 1rem !important;
  }
  
  .product-price del {
    font-size: 1rem !important;
  }

  .tabs-nav {
    flex-wrap: wrap;
  }

  .tab-link {
    padding: 0.75rem 1rem;
  }
}

/* RTL Support */
[dir="rtl"] .product-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .quantity-label {
  margin-right: 0;
  margin-left: 1rem;
}

[dir="rtl"] .product-thumbnails {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  [dir="rtl"] .product-content {
    flex-direction: column;
  }
}

/* Product Reviews Section */
.product-reviews-section {
  margin-top: 2rem;
}

.product-reviews-section .reviews-title {
  font-weight: 900;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.reviews-top {
  display: grid;
  grid-template-columns: 280px 1fr auto;
  gap: 1rem;
  align-items: start;
}

.reviews-summary {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
}

.reviews-summary .avg-score {
  font-size: 2.25rem;
  font-weight: 900;
  color: #111827;
}

.reviews-summary .avg-stars {
  display: inline-flex;
  gap: .25rem;
  margin-top: .25rem;
}

.reviews-summary .total-count {
  color: #6b7280;
  margin-top: .25rem;
}

.stars-bars {
  margin-top: .5rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 16px 16px 1fr 40px;
  gap: .5rem;
  align-items: center;
  margin: .25rem 0;
}

.bar-label {
  font-weight: 800;
  color: #111827;
}

.bar-star {
  color: #fbbf24;
}

.bar-track {
  height: 8px;
  border-radius: 9999px;
  background: #f3f4f6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #111827;
}

.bar-count {
  color: #069669;
  font-weight: 700;
}

.reviews-media {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.reviews-media .media-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid #e5e7eb;
}

.reviews-media .media-more {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.reviews-actions {
  display: flex;
  justify-content: flex-end;
}

.reviews-write-btn {
  background: #069669;
  color: #fff;
  font-weight: 800;
  padding: .75rem 1rem;
  border-radius: 12px;
}

.reviews-tools {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: .75rem;
  margin: 1rem 0;
}

.reviews-search {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.reviews-sort {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.reviews-empty {
  margin: 1rem 0;
  color: #6b7280;
  font-weight: 700;
}

.review-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.review-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.review-content {
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-author {
  color: #111827;
}

.review-date {
  color: #6b7280;
  font-size: .875rem;
}

.review-rating {
  display: inline-flex;
  gap: .25rem;
}

.review-text {
  color: #069669;
  line-height: 1.7;
}

.review-form-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.review-form-modal.hidden {
  display: none;
}

.review-form-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.review-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.review-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
}

.review-form-card form {
  padding: 1rem;
}

.review-form-card .form-row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .75rem;
}

.review-form-card input[type="text"],
.review-form-card input[type="email"],
.review-form-card select,
.review-form-card textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .6rem .8rem;
}

.review-form-card .btn-submit {
  width: 100%;
  background: #069669;
  color: #fff;
  font-weight: 800;
  padding: .75rem 1rem;
  border-radius: 12px;
}

@media (max-width: 1024px) {
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reviews-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }
}