/* ========================================================================
   PRODUCTS DETAIL PAGE CSS - Rong Ta Coconut
   CSS chung cho tất cả trang chi tiết sản phẩm
   ======================================================================== */

/* ========================================================================
   0. LANGUAGE SWITCHER (for product pages)
   ======================================================================== */
.language-switcher {
  margin-left: 1rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.lang-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.lang-btn:hover::before {
  left: 100%;
}

.lang-btn:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.lang-btn i {
  font-size: 1.125rem;
}

#currentLang {
  font-weight: 800;
}

@media (max-width: 768px) {
  .language-switcher {
    margin: 1rem 0;
    width: 100%;
  }
  
  .lang-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* ========================================================================
   1. PRODUCT DETAIL LAYOUT
   ======================================================================== */
.product-detail {
  padding: 8rem 0 4rem;
  background: #fafafa;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #737373;
}

.breadcrumb a {
  color: #737373;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: #10b981;
}

.breadcrumb i {
  font-size: 0.75rem;
  color: #a3a3a3;
}

.breadcrumb span {
  color: #171717;
  font-weight: 600;
}

/* ========================================================================
   2. PRODUCT MAIN SECTION
   ======================================================================== */
.product-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: white;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 2.5rem;
}

/* ========================================================================
   3. IMAGE GALLERY
   ======================================================================== */
.product-gallery {
  position: sticky;
  top: 120px;
  height: fit-content;
}

.gallery-main {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 1.25rem;
  aspect-ratio: 1;
  cursor: zoom-in;
  border: 1px solid #e5e5e5;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  padding: 1rem;
}

.zoom-hint {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  border-radius: 8px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Thumbnails */
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.thumbnail {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e5e5e5;
  transition: all 0.25s ease;
  background: #f5f5f5;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.375rem;
}

.thumbnail:hover {
  border-color: #10b981;
}

.thumbnail.active {
  border-color: #10b981;
  box-shadow: 0 0 0 1px #10b981;
}

/* ========================================================================
   4. PRODUCT INFO
   ======================================================================== */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Badges */
.product-badges {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid;
}

.badge-primary {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
}

.badge-success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #16a34a;
}

/* Title */
.product-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #0a0a0a;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

.product-subtitle {
  font-size: 1rem;
  color: #737373;
  font-weight: 500;
  margin-top: -0.5rem;
}

/* Meta Info */
.product-meta {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #525252;
}

.meta-item i {
  color: #10b981;
  font-size: 1rem;
}

.meta-item strong {
  color: #171717;
  font-weight: 600;
}

/* Price */
.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.25rem;
  background: #f0fdf4;
  border-radius: 12px;
  border: 1px solid #d1fae5;
}

.price-label {
  font-size: 0.9375rem;
  color: #404040;
  font-weight: 500;
}

.price-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.01em;
}

/* Description */
.product-description {
  padding: 1.25rem;
  background: #fafafa;
  border-radius: 12px;
  border-left: 3px solid #10b981;
}

.product-description p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #525252;
  margin: 0;
}

.product-description strong {
  color: #171717;
  font-weight: 600;
}

/* Quick Features */
.quick-features {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  transition: all 0.25s ease;
}

.feature-item:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.feature-item i {
  font-size: 1.5rem;
  color: #10b981;
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.125rem;
}

.feature-item span {
  font-size: 0.8125rem;
  color: #737373;
}

/* Action Buttons */
.product-actions {
  display: flex;
  gap: 0.875rem;
  margin-top: 0.5rem;
}

.product-actions .btn-primary,
.product-actions .btn-secondary {
  flex: 1;
  justify-content: center;
}

/* ========================================================================
   5. PRODUCT TABS
   ======================================================================== */
.product-tabs {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 2.5rem;
}

.tabs-header {
  display: flex;
  background: #fafafa;
  border-bottom: 1px solid #e5e5e5;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.125rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #737373;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: #f5f5f5;
  color: #10b981;
}

.tab-btn.active {
  background: white;
  color: #10b981;
  border-bottom-color: #10b981;
}

.tab-btn i {
  font-size: 1rem;
}

.tabs-content {
  padding: 2.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0a0a0a;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

/* Specifications Grid */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.spec-card {
  padding: 1.75rem;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.spec-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.spec-card h4 i {
  color: #10b981;
  font-size: 1.375rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid #e5e5e5;
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table td {
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

.spec-table td:first-child {
  color: #737373;
  font-weight: 500;
  width: 40%;
}

.spec-table td:last-child {
  color: #171717;
  font-weight: 600;
  text-align: right;
}

/* Ingredients List */
.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.ingredient-item {
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem;
  background: #fafafa;
  border-radius: 10px;
  border-left: 3px solid #10b981;
}

.ingredient-item i {
  font-size: 1.375rem;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.ingredient-item strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.375rem;
}

.ingredient-item p {
  font-size: 0.875rem;
  color: #737373;
  line-height: 1.6;
  margin: 0;
}

/* Info Box */
.info-box {
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.info-box i {
  font-size: 1.375rem;
  color: #0284c7;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.info-box strong {
  display: block;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 0.375rem;
}

.info-box p {
  font-size: 0.875rem;
  color: #075985;
  line-height: 1.6;
  margin: 0;
}

/* Packaging Grid */
.packaging-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.packaging-card {
  padding: 1.75rem;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  text-align: center;
  transition: all 0.25s ease;
}

.packaging-card:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.packaging-card i {
  font-size: 2.5rem;
  color: #10b981;
  margin-bottom: 0.875rem;
}

.packaging-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.875rem;
}

.packaging-card ul {
  list-style: none;
  text-align: left;
}

.packaging-card li {
  font-size: 0.875rem;
  color: #525252;
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
}

.packaging-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
  font-size: 1.125rem;
}

/* Certifications Grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cert-card {
  padding: 1.75rem 1.25rem;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  text-align: center;
  transition: all 0.25s ease;
}

.cert-card:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

.cert-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 0.875rem;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.25s ease;
}

.cert-card:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

.cert-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.375rem;
}

.cert-card p {
  font-size: 0.8125rem;
  color: #737373;
  line-height: 1.5;
  margin: 0;
}

/* ========================================================================
   6. RELATED PRODUCTS SECTION
   ======================================================================== */
.related-products {
  padding: 4rem 0 5rem;
  background: #fafafa;
}

.related-products .section-header {
  margin-bottom: 2.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.related-products .product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e5e5;
  transition: all 0.3s ease;
}

.related-products .product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}

.related-products .product-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f5f5f5;
}

.related-products .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.25rem;
  transition: transform 0.4s ease;
}

.related-products .product-card:hover .product-image img {
  transform: scale(1.08);
}

.related-products .product-badge {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  padding: 0.375rem 0.875rem;
  background: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.related-products .product-badge.premium {
  background: #10b981;
  color: white;
}

.related-products .product-content {
  padding: 1.375rem;
}

.related-products .product-content h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.625rem;
}

.related-products .product-content p {
  font-size: 0.875rem;
  color: #737373;
  line-height: 1.6;
  margin-bottom: 1.125rem;
}

.related-products .btn-outline {
  width: 100%;
}

/* ========================================================================
   7. RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 968px) {
  .product-detail {
    padding: 7rem 0 3rem;
  }

  .product-main {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2rem;
  }

  .product-gallery {
    position: static;
  }

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

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .packaging-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs-header {
    overflow-x: auto;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 1rem 1.125rem;
    font-size: 0.8125rem;
  }

  .tabs-content {
    padding: 2rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .product-detail {
    padding: 6rem 0 2rem;
  }

  .breadcrumb {
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
  }

  .product-main {
    padding: 1.5rem;
    gap: 2rem;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
  }

  .product-badges {
    gap: 0.5rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

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

  .product-subtitle {
    font-size: 0.9375rem;
  }

  .product-meta {
    flex-direction: column;
    gap: 0.625rem;
  }

  .product-price {
    padding: 1rem;
  }

  .price-value {
    font-size: 1.375rem;
  }

  .product-description {
    padding: 1rem;
  }

  .quick-features {
    gap: 0.625rem;
  }

  .feature-item {
    padding: 0.75rem;
  }

  .feature-item i {
    font-size: 1.375rem;
  }

  .product-actions {
    flex-direction: column;
  }

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

  .tab-btn {
    flex: 1 1 45%;
    padding: 0.875rem;
    font-size: 0.75rem;
  }

  .tabs-content {
    padding: 1.5rem;
  }

  .tab-panel h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .spec-table td {
    font-size: 0.8125rem;
    padding: 0.625rem 0;
  }

  .ingredient-item {
    padding: 1rem;
  }

  .packaging-card {
    padding: 1.5rem;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }

  .cert-card img {
    width: 75px;
    height: 75px;
  }
}

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

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

  .tab-btn {
    flex: 1 1 100%;
  }
}

@media print {
  .nav-modern,
  .breadcrumb,
  .product-actions,
  .related-products,
  .footer {
    display: none;
  }

  .product-detail {
    padding: 0;
  }

  .product-main {
    box-shadow: none;
  }

  .tab-panel {
    display: block !important;
  }

  .tabs-header {
    display: none;
  }
}

/* END OF PRODUCTS CSS */