/* ======= PRODUCT DETAIL STYLING ======= */

/* Global styling */
:root {
  --primary-color: #006838;
  --secondary-color: #3554D1;
  --accent-color: #FFC107;
  --light-bg: #f8f9fa;
  --dark-text: #212529;
  --light-text: #6c757d;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

/* Product gallery */
.product-gallery {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.product-gallery__featured {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.product-gallery__featured:hover .product-gallery__overlay {
  opacity: 1;
}

.product-gallery__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.5) 100%);
  opacity: 0;
  transition: var(--transition);
}

.product-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transform: translateY(0);
  transition: var(--transition);
}

.product-badge--sale {
  background-color: var(--secondary-color);
  color: white;
}

.productCard:hover .product-badge {
  transform: translateY(-5px);
}

/* Product info */
.product-info-card {
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  transition: var(--transition);
  border: 1px solid #eaeaea;
}

.product-info-card:hover {
  box-shadow: var(--box-shadow);
  transform: translateY(-5px);
}

.product-category {
  display: inline-block;
  transition: var(--transition);
}

.product-category:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(53, 84, 209, 0.15);
}

.product-rating i {
  transition: var(--transition);
}

.product-rating:hover i {
  transform: scale(1.2);
}

/* Features list styling */
.list-disc {
  list-style-type: disc !important;
  padding-left: 1.5rem;
}

.list-disc li {
  position: relative;
  padding: 5px 0;
  transition: var(--transition);
}

.list-disc li::marker {
  color: var(--primary-color);
}

.list-disc li:hover {
  transform: translateX(5px);
}

/* Action buttons */
.button {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  transform: translateY(0);
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.button:hover::after {
  width: 300%;
  height: 300%;
}

.button i {
  transition: var(--transition);
}

.button:hover i {
  transform: translateX(5px);
}

/* Tab styling */
.tabs__controls {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 0;
  position: relative;
}

.tabs__button {
  position: relative;
  padding: 15px 0;
  font-weight: 500;
  color: var(--light-text);
  border: none;
  background: transparent;
  transition: var(--transition);
  cursor: pointer;
}

.tabs__button:hover {
  color: var(--secondary-color);
}

.tabs__button.is-tab-el-active {
  color: var(--secondary-color) !important;
  font-weight: 600;
}

.tabs__button.is-tab-el-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 3px 3px 0 0;
  transition: var(--transition);
}

.tabs__button i {
  transition: var(--transition);
}

.tabs__button:hover i {
  transform: rotate(10deg);
}

.tabs__content {
  background-color: white;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 30px 0;
}

.tabs__pane {
  display: none;
  animation: fadeIn 0.5s;
}

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

.tabs__pane.is-tab-el-active {
  display: block;
}

/* Technical specs table */
.table-spec {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid #eaeaea;
}

.table-spec tr:hover {
  background-color: rgba(53, 84, 209, 0.05);
}

.table-spec td {
  padding: 15px 20px;
  transition: var(--transition);
}

.table-spec tr:last-child td:first-child {
  border-bottom-left-radius: var(--border-radius);
}

.table-spec tr:last-child td:last-child {
  border-bottom-right-radius: var(--border-radius);
}

/* Usage steps */
.usage-step {
  position: relative;
  transition: var(--transition);
}

.usage-step:hover {
  transform: translateY(-5px);
}

.usage-step__number {
  background-color: rgba(53, 84, 209, 0.1);
  color: var(--secondary-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  transition: var(--transition);
}

.usage-step:hover .usage-step__number {
  background-color: var(--secondary-color);
  color: white;
  transform: scale(1.1);
}

.alert-box {
  border-left: 4px solid var(--accent-color);
  background-color: rgba(255, 193, 7, 0.1);
  transition: var(--transition);
}

.alert-box:hover {
  box-shadow: 0 5px 15px rgba(255, 193, 7, 0.2);
}

/* Crop cards */
.crop-card {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #eaeaea;
}

.crop-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow);
}

.crop-card img {
  transition: var(--transition);
}

.crop-card:hover img {
  transform: scale(1.05);
}

/* Benefit cards */
.benefit-card {
  transition: var(--transition);
  overflow: hidden;
  border: 1px solid #eaeaea;
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow);
}

.benefit-card .size-60 {
  transition: var(--transition);
}

.benefit-card:hover .size-60 {
  transform: scale(1.1) rotate(10deg);
}

/* Related products section */
.productCard {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #eaeaea;
  border-radius: var(--border-radius);
  background-color: white;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.productCard:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 104, 56, 0.1);
}

.productCard__image {
  position: relative;
  overflow: hidden;
  padding: 10px;
}

.productCard__image .ratio {
  max-width: 90%;
  margin: 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.productCard__image img {
  transition: transform 0.4s ease;
}

.productCard:hover .productCard__image img {
  transform: scale(1.03);
}

.productCard__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.productCard__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 5px;
  height: 44px; /* Đảm bảo chiều cao đều nhau cho tên sản phẩm */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.3s ease;
}

.productCard:hover .productCard__title {
  color: var(--primary-color);
}

.productCard__category {
  font-size: 14px;
  color: var(--light-text);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease;
}

.productCard:hover .productCard__category {
  transform: translateX(3px);
}

.productCard__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 15px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.productCard:hover .productCard__badge {
  transform: translateY(-5px) scale(1.05);
}

/* Nút liên hệ gọn và đồng đều */
.button-contact {
  display: inline-block;
  width: 100%;
  max-width: 120px;
  height: 36px;
  line-height: 32px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid var(--primary-color);
  text-align: center;
  text-decoration: none;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.button-contact:hover {
  background-color: white;
  color: var(--primary-color);
  box-shadow: 0 3px 10px rgba(0, 104, 56, 0.15);
}

.button-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  transition: left 0.4s ease;
}

.button-contact:hover::before {
  left: 100%;
}

/* Thêm hiệu ứng đẹp cho khu vực sản phẩm liên quan */
.related-products-section {
  position: relative;
}

.related-products-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary-color), transparent);
}

/* Animation cho sản phẩm khi trang tải xong */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.products-grid .productCard {
  animation: fadeInUp 0.5s ease backwards;
}

.products-grid .col-xl-3:nth-child(1) .productCard {
  animation-delay: 0.1s;
}

.products-grid .col-xl-3:nth-child(2) .productCard {
  animation-delay: 0.2s;
}

.products-grid .col-xl-3:nth-child(3) .productCard {
  animation-delay: 0.3s;
}

.products-grid .col-xl-3:nth-child(4) .productCard {
  animation-delay: 0.4s;
}

/* Thêm hiệu ứng nổi bật khi hover */
.productCard::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(0,104,56,0.08) 0%, transparent 70%);
  z-index: -1;
  transform: scale(0.5);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.productCard:hover::after {
  opacity: 1;
  transform: scale(1.1);
}

/* Thêm hiệu ứng ripple cho nút liên hệ */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.button-contact::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  transform: scale(0);
  opacity: 0;
}

.button-contact:active::after {
  animation: ripple 0.6s ease-out;
}

/* Media queries */
@media (max-width: 992px) {
  .product-gallery {
    margin-bottom: 30px;
  }

  .tabs__button {
    font-size: 16px;
    padding: 10px 0;
  }
}

@media (max-width: 767px) {
  .usage-step {
    flex-direction: column;
  }

  .usage-step__number {
    margin-bottom: 15px;
    margin-right: 0 !important;
  }

  .benefit-card .d-flex {
    flex-direction: column;
  }

  .benefit-card .size-60 {
    margin-bottom: 15px;
    margin-right: 0 !important;
  }

  .product-badge {
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 11px;
  }

  .tabs__button i {
    display: none;
  }

  .button-contact {
    max-width: 100px;
    height: 32px;
    line-height: 30px;
    font-size: 13px;
  }

  .productCard__title {
    font-size: 14px;
    height: 38px;
  }
}
