/* ============================================
   SINGLE PRODUCT V4 — HOMEPAGE V3 COLOR SYSTEM
   "Áo Thêu" Brand Consistency
   ============================================ */
:root {
  --sp4-primary: #3338A0;
  --sp4-primary-dark: #252978;
  --sp4-primary-light: #4A4FBD;
  --sp4-primary-rgb: 51, 56, 160;
  --sp4-gold: #C59560;
  --sp4-gold-light: #D9B17E;
  --sp4-accent: #FCC61D;
  --sp4-accent-dark: #E5B310;
  --sp4-bg: #F7F7F7;
  --sp4-bg-tint: #F0F1FA;
  /* primary-tinted background */
  --sp4-white: #FFFFFF;
  --sp4-dark: #1A1A2E;
  --sp4-text: #444444;
  --sp4-muted: #999999;
  --sp4-border: #E8E8E8;
  --sp4-border-blue: rgba(51, 56, 160, 0.1);
  --sp4-radius: 12px;
  --sp4-radius-sm: 8px;
  --sp4-ease: cubic-bezier(.25, .46, .45, .94);
  --sp4-font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   FONT OVERRIDE
   ============================================ */
.single-product .product-info.summary,
.single-product .product-info .product-title,
.single-product .product-info .price,
.single-product .product-info .woocommerce-product-details__short-description,
.single-product .product_meta,
.single-product .sp4-price-box,
.single-product .sp4-trust-badges,
.single-product .sp4-features,
.single-product form.cart {
  font-family: var(--sp4-font) !important;
}

/* ============================================
   SUMMARY PANEL — Branded Background
   ============================================ */
.product-info.summary {
  background: var(--sp4-bg-tint);
  padding: 32px;
  border-radius: var(--sp4-radius);
  position: relative;
  overflow: hidden;
  /* Subtle pattern — dots in brand color */
  background-image: radial-gradient(rgba(var(--sp4-primary-rgb), .05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Decorative accent line at top */
.product-info.summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sp4-primary), var(--sp4-accent), var(--sp4-gold));
  border-radius: var(--sp4-radius) var(--sp4-radius) 0 0;
}

/* ============================================
   TITLE
   ============================================ */
.product-info .product-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--sp4-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.product-info .breadcrumbs,
.product-info .breadcrumbs * {
  font-size: 13px;
  color: var(--sp4-muted);
}

.product-info .breadcrumbs a {
  color: var(--sp4-primary);
  text-decoration: none;
}

.product-info .breadcrumbs a:hover {
  text-decoration: underline;
}

/* ============================================
   EXCERPT / SHORT DESCRIPTION
   ============================================ */
.product-short-description {
  font-size: 15px;
  color: var(--sp4-text);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ============================================
   CUSTOM PRICE BOX
   ============================================ */
.sp4-price-box {
  background: var(--sp4-white);
  border-radius: var(--sp4-radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(var(--sp4-primary-rgb), .08);
  border: 1px solid rgba(var(--sp4-primary-rgb), .06);
}

.sp4-price-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sp4-price-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp4-price-main ins {
  text-decoration: none;
  font-size: 32px;
  font-weight: 800;
  color: var(--sp4-primary);
  line-height: 1;
}

.sp4-price-main del {
  color: var(--sp4-muted);
  font-size: 16px;
  text-decoration: line-through;
  font-weight: normal;
}

/* Simple products with no sale */
.sp4-price-main>.woocommerce-Price-amount {
  font-size: 24px;
  font-weight: 600;
  color: var(--sp4-primary);
  line-height: 1;
}

.sp4-badge-save {
  background: linear-gradient(135deg, var(--sp4-accent), #ffe066);
  color: var(--sp4-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(252, 198, 29, .25);
}

.sp4-price-right {
  text-align: right;
}

.sp4-stock {
  font-size: 14px;
  font-weight: 600;
  color: #2E7D4F;
  margin: 0;
}

/* ============================================
   STOCK LABEL
   ============================================ */
.product-info .stock {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Hide default WC price (we use sp4-price-box) */
.single-product .product-info>.price {
  display: none !important;
}

/* Hiển thị giá variation bị ẩn bên dưới form customize */
.single-product .product-info .woocommerce-variation-price .price {
  display: block !important;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 15px;
  margin-top: 5px;
  color: var(--sp4-primary);
  text-align: right;
}

.single-product .product-info .woocommerce-variation-price .price ins {
  text-decoration: none;
}

.single-product .product-info .woocommerce-variation-price .price del {
  font-size: 16px;
  color: var(--sp4-muted);
  font-weight: 400;
  margin-right: 8px;
}

/* ============================================
   ACTIONS ROW — Quantity + Add to Cart + Buy Now
   ============================================ */
.product-info form.cart {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
  align-items: center !important;
}

/* Variable product: variations + action row full width */
.product-info form.cart .variations,
.product-info form.cart .single_variation_wrap {
  width: 100% !important;
  flex-basis: 100% !important;
}

.product-info form.cart .woocommerce-variation-add-to-cart {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
}

/* Quantity wrapper */
.product-info .quantity {
  margin-right: 0 !important;
  border-radius: var(--sp4-radius-sm);
  background: var(--sp4-white);
  border: 1.5px solid rgba(var(--sp4-primary-rgb), .15);
  box-shadow: none;
  display: flex !important;
  align-items: center !important;
  overflow: hidden;
  height: 44px;
  flex-shrink: 0;
  transition: border-color .3s;
}

.product-info .quantity:hover,
.product-info .quantity:focus-within {
  border-color: var(--sp4-primary);
}

/* Qty number input */
.product-info .quantity input.qty {
  width: 36px !important;
  height: 100% !important;
  border: none !important;
  background: transparent !important;
  font-weight: 700;
  font-size: 15px;
  color: var(--sp4-dark);
  text-align: center;
  padding: 0 !important;
  margin: 0 !important;
  -moz-appearance: textfield;
  line-height: 44px !important;
}

.product-info .quantity input.qty::-webkit-outer-spin-button,
.product-info .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* +/- buttons */
.product-info .quantity input[type="button"],
.product-info .quantity button {
  background: var(--sp4-primary) !important;
  color: #fff !important;
  border: none !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  border-radius: 6px !important;
  margin: 6px !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  transition: all .25s var(--sp4-ease);
}

.product-info .quantity input[type="button"]:hover,
.product-info .quantity button:hover {
  background: var(--sp4-primary-dark) !important;
  transform: scale(1.08);
}

/* Add to Cart button */
.product-info .single_add_to_cart_button {
  background: var(--sp4-primary) !important;
  color: #fff !important;
  flex: 1.2;
  border-radius: var(--sp4-radius-sm) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(var(--sp4-primary-rgb), .25) !important;
  text-transform: uppercase;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 22px !important;
  margin: 0 !important;
  border: none !important;
  line-height: 1 !important;
  white-space: nowrap;
  transition: all .3s var(--sp4-ease);
  box-sizing: border-box !important;
}

.product-info .single_add_to_cart_button:hover {
  background: var(--sp4-primary-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(var(--sp4-primary-rgb), .35) !important;
}

/* Buy Now button */
.buy-now-v4 {
  flex: 1;
  background: var(--sp4-accent) !important;
  color: var(--sp4-dark) !important;
  border: none !important;
  border-radius: var(--sp4-radius-sm) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(252, 198, 29, .3) !important;
  text-transform: uppercase;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 22px !important;
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: all .3s var(--sp4-ease);
  box-sizing: border-box !important;
}

.buy-now-v4:hover {
  background: #ffe066 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(252, 198, 29, .45) !important;
}

/* Flatsome Override: button sizing */
.product-info form.cart .button,
.product-info form.cart button[type="submit"] {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* Fix Flatsome quantity */
.product-info .quantity.buttons_added {
  display: flex !important;
  align-items: center !important;
  height: 44px;
  border-radius: var(--sp4-radius-sm);
  background: var(--sp4-white);
  border: 1.5px solid rgba(var(--sp4-primary-rgb), .15);
  box-shadow: none;
  overflow: visible;
}

/* ============================================
   TRUST BADGES
   ============================================ */
.sp4-trust-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.sp4-trust-item {
  flex: 1 1 0;
  min-width: 0;
  background: var(--sp4-white);
  border-radius: var(--sp4-radius);
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--sp4-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 12px rgba(var(--sp4-primary-rgb), .06);
  transition: all .3s var(--sp4-ease);
  border: 1px solid transparent;
}

.sp4-trust-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(var(--sp4-primary-rgb), .12);
  border-color: rgba(var(--sp4-primary-rgb), .1);
}

.sp4-bg-purple {
  background: #3ba98214;
}

.sp4-bg-gold {
  background: #2296f31a;
}

.sp4-bg-yellow {
  background: #d500f90f;
}

.sp4-trust-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp4-trust-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sp4-trust-item span {
  font-size: 11px;
  line-height: 1.4;
  color: var(--sp4-text);
  word-break: keep-all;
}

/* ============================================
   FEATURE HIGHLIGHTS
   ============================================ */
.sp4-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.sp4-feature-card {
  background: var(--sp4-white);
  border-radius: var(--sp4-radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(var(--sp4-primary-rgb), .04);
  border-left: 3px solid var(--sp4-primary);
  transition: all .3s var(--sp4-ease);
}

.sp4-feature-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(var(--sp4-primary-rgb), .1);
}

.sp4-f-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  background: var(--sp4-bg-tint);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s var(--sp4-ease);
}

.sp4-feature-card:hover .sp4-f-icon {
  background: var(--sp4-primary);
}

.sp4-feature-card:hover .sp4-f-icon img {
  filter: brightness(0) invert(1);
}

.sp4-f-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transition: filter .3s;
}

.sp4-f-text {
  font-size: 12px;
  color: var(--sp4-muted);
  line-height: 1.5;
}

.sp4-f-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--sp4-dark);
  margin-bottom: 3px;
}

/* ============================================
   PRODUCT META (Categories)
   ============================================ */
.product_meta {
  background: var(--sp4-bg-tint);
  padding: 10px 20px;
  border-radius: var(--sp4-radius-sm);
  display: inline-block;
  font-size: 13px;
  color: var(--sp4-primary);
  font-weight: 600;
  border: 1px solid rgba(var(--sp4-primary-rgb), .1) !important;
}

.product_meta a {
  color: var(--sp4-primary);
  text-decoration: none;
  font-weight: 700;
}

.product_meta a:hover {
  color: var(--sp4-gold);
}

/* ============================================
   STICKY BOTTOM BAR
   ============================================ */
.sp4-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--sp4-primary), var(--sp4-primary-dark));
  box-shadow: 0 -4px 20px rgba(var(--sp4-primary-rgb), .2);
  padding: 12px 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(110%);
  transition: transform .4s var(--sp4-ease);
}

.sp4-sticky-bar.visible {
  transform: translateY(0);
}

.sp4-sticky-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sp4-sticky-left img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--sp4-radius-sm);
  border: 2px solid rgba(255, 255, 255, .2);
}

.sp4-sticky-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp4-sticky-price {
  color: var(--sp4-accent);
  font-weight: 800;
  font-size: 16px;
}

.sp4-sticky-price del {
  color: rgba(255, 255, 255, .5);
  font-weight: normal;
  font-size: 12px;
  margin-left: 6px;
}

.sp4-sticky-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp4-sticky-cart {
  background: var(--sp4-accent);
  color: var(--sp4-dark);
  padding: 12px 28px;
  border-radius: var(--sp4-radius-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: all .3s var(--sp4-ease);
  text-transform: uppercase;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(252, 198, 29, .3);
}

.sp4-sticky-cart:hover {
  background: #ffe066;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(252, 198, 29, .45);
}

/* ============================================
   TABS / RELATED PRODUCTS — Brand Colors
   ============================================ */
.single-product .woocommerce-tabs ul.tabs li.active a {
  color: var(--sp4-primary) !important;
  border-bottom-color: var(--sp4-primary) !important;
}

.single-product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--sp4-primary) !important;
}

/* Related product "Add to Cart" buttons */
.single-product .related.products .button,
.single-product .upsells .button {
  background: var(--sp4-primary) !important;
  color: #fff !important;
  border-radius: var(--sp4-radius-sm) !important;
  font-weight: 600 !important;
  transition: all .3s var(--sp4-ease);
}

.single-product .related.products .button:hover,
.single-product .upsells .button:hover {
  background: var(--sp4-primary-dark) !important;
}

/* ============================================
   DESCRIPTION BELOW CART (Customizer)
   ============================================ */
.sp4-desc-below-cart {
  background: var(--sp4-white);
  border-radius: var(--sp4-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--sp4-text);
  border-left: 3px solid var(--sp4-gold);
  box-shadow: 0 2px 10px rgba(var(--sp4-primary-rgb), .04);
}

.sp4-desc-below-cart p:last-child {
  margin-bottom: 0;
}


/* ============================================
   ACCORDION TABS IN SUMMARY
   ============================================ */
.sp4-accordion-tabs {
  margin-top: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--sp4-border);
  border-radius: var(--sp4-radius);
  overflow: hidden;
  background: var(--sp4-white);
  box-shadow: 0 2px 12px rgba(var(--sp4-primary-rgb), .06);
}

.sp4-accordion-item {
  border-bottom: 1px solid var(--sp4-border);
}

.sp4-accordion-item:last-child {
  border-bottom: none;
}

.sp4-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--sp4-dark);
  transition: all .25s var(--sp4-ease);
  user-select: none;
}

.sp4-accordion-header:hover {
  background: var(--sp4-bg-tint);
  color: var(--sp4-primary);
}

.sp4-accordion-item.active .sp4-accordion-header {
  color: var(--sp4-primary);
  border-bottom: 1px solid var(--sp4-border);
}

.sp4-accordion-arrow {
  transition: transform .3s var(--sp4-ease);
  flex-shrink: 0;
  color: var(--sp4-muted);
}

.sp4-accordion-item.active .sp4-accordion-arrow {
  transform: rotate(180deg);
  color: var(--sp4-primary);
}

.sp4-accordion-body {
  display: none;
  padding: 6px 18px 18px 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--sp4-text);
  overflow: hidden;
}


.sp4-accordion-body>*:first-child {
  padding-top: 20px;
}

.sp4-accordion-body>*:last-child {
  padding-bottom: 20px;
}

.sp4-accordion-body p:last-child {
  margin-bottom: 0;
}

/* WooCommerce tab content reset inside accordion */
.sp4-accordion-body .woocommerce-Tabs-panel {
  padding: 20px 22px !important;
  margin: 0 !important;
}


.sp4-accordion-body table.shop_attributes {
  width: 100%;
  border-collapse: collapse;
}

.sp4-accordion-body table.shop_attributes th,
.sp4-accordion-body table.shop_attributes td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sp4-border);
  font-size: 14px;
}

.sp4-accordion-body table.shop_attributes th {
  font-weight: 600;
  color: var(--sp4-dark);
  background: var(--sp4-bg-tint);
  width: 35%;
}

@keyframes sp4FadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .product-info.summary {
    padding: 20px 16px;
  }

  .sp4-price-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sp4-price-right {
    text-align: left;
  }

  .product-info form.cart {
    flex-wrap: wrap !important;
  }

  .product-info .quantity {
    width: auto;
    justify-content: center;
  }

  .product-info .single_add_to_cart_button,
  .buy-now-v4 {
    flex: 1 1 45% !important;
    min-width: 0;
    padding: 0 14px !important;
    font-size: 13px !important;
  }

  .sp4-trust-badges {
    flex-wrap: wrap;
  }

  .sp4-trust-item {
    flex: 1 1 30%;
  }

  .sp4-features {
    grid-template-columns: 1fr;
  }

  .sp4-sticky-left {
    display: none;
  }

  .sp4-sticky-right {
    width: 100%;
  }

  .sp4-sticky-cart {
    width: 100%;
    padding: 14px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .product-info .product-title {
    font-size: 22px;
  }

  .sp4-price-main ins,
  .sp4-price-main>.woocommerce-Price-amount {
    font-size: 26px;
  }

  .product-info .single_add_to_cart_button,
  .buy-now-v4 {
    flex: 1 1 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  .product-info .quantity {
    height: 40px;
  }

  .product-info .quantity input[type="button"],
  .product-info .quantity button {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    margin: 5px !important;
    font-size: 13px !important;
  }
}

/* ==========================================================================
   PRODUCT IMAGE GALLERY & THUMBNAILS (STYLE 2 - APPLE/MINIMALIST)
   ========================================================================== */

/* --- Main Image Slider --- */
.product-gallery-slider {
  margin-bottom: 0 !important;
}

.product-gallery-slider .slide {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f4f4f4;
}

.product-gallery-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Clean Minimal Arrows for Main Slider */
.product-gallery-slider .flickity-prev-next-button {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(4px);
  border-radius: 50% !important;
  transition: all 0.4s var(--v3-ease) !important;
}

.product-gallery-slider .flickity-prev-next-button:hover {
  background: var(--v3-primary) !important;
  border-color: var(--v3-primary) !important;
}

.product-gallery-slider .flickity-prev-next-button:hover .flickity-button-icon {
  fill: #fff !important;
}

/* --- Thumbnails Slider --- */
.product-thumbnails {
  background: #fff;
  padding: 16px 20px !important;
  border-top: 1px solid #eee;
}

/* Remove default row margins */
.product-thumbnails.row {
  margin-left: -8px !important;
  margin-right: -8px !important;
  width: auto !important;
  /* Overrides flatsome row width */
}

/* The thumbnail wrapper */
.product-thumbnails .col {
  width: 20% !important;
  /* Show 5 items if possible */
  padding: 0 8px !important;
  cursor: pointer;
}

/* Container for thumbnail */
.product-thumbnails .col a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background-color: #fff;
  aspect-ratio: 1 / 1;
  border: none !important;
  /* Remove Flatsome default border */
  padding: 0 !important;
}

/* Image styling: start desaturated */
.product-thumbnails .col img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  filter: grayscale(80%);
  opacity: 0.5 !important;
  transition: all 0.5s var(--v3-ease);
}

/* Hover State */
.product-thumbnails .col:hover img {
  filter: grayscale(0%);
  opacity: 0.8 !important;
}

/* Active Indicator Line (Bottom Bar) */
.product-thumbnails .col a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--v3-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s var(--v3-ease);
  z-index: 2;
}

/* Active/Selected State */
.product-thumbnails .col.is-nav-selected img,
.product-thumbnails .col.is-selected img {
  filter: grayscale(0%);
  opacity: 1 !important;
}

/* Show bottom bar on active */
.product-thumbnails .col.is-nav-selected a::after,
.product-thumbnails .col.is-selected a::after {
  transform: scaleX(1);
}

/* Hide default thumbnail arrows */
.product-thumbnails .flickity-prev-next-button {
  display: none !important;
}

/* ============================================
   SINGLE PRODUCT REVIEW FORM (MINIMAL & PREMIUM)
   ============================================ */
/* Ép form review và danh sách review thành 1 cột (trên/dưới) */
#reviews, 
#reviews .row {
  display: block !important;
}

#reviews #comments,
#reviews #review_form_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  float: none !important;
  clear: both !important;
  padding: 0 !important;
  display: block !important;
}

#reviews #review_form_wrapper {
  margin-top: 40px !important;
}

.review-form-inner {
  background: var(--sp4-white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  border: none !important;
}

/* Top Accent Line */
.review-form-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--sp4-primary), var(--sp4-accent), var(--sp4-gold));
}

.comment-reply-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--sp4-dark) !important;
  margin-top: 0 !important;
  margin-bottom: 30px !important;
  line-height: 1.6 !important;
  text-align: center !important;
}

.comment-reply-title small {
  display: block;
  margin-top: 8px;
}

.comment-reply-title small a {
  color: var(--sp4-muted);
  font-size: 13px;
  text-decoration: underline;
  font-weight: 400;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.comment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--sp4-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comment-form label .required {
  color: var(--sp4-accent);
}

/* ============================================
   MODERN DISPLAY STARS (AVERAGE RATING)
   ============================================ */
.woocommerce .star-rating,
.woocommerce-page .star-rating {
  font-size: 15px !important;
  letter-spacing: 2px !important;
  width: 5.8em !important;
  margin-top: 5px !important;
  margin-bottom: 10px !important;
}

.woocommerce .star-rating::before,
.woocommerce-page .star-rating::before {
  content: "★★★★★" !important;
  color: #E2E4E8 !important;
  font-family: inherit !important;
}

.woocommerce .star-rating span::before,
.woocommerce-page .star-rating span::before {
  content: "★★★★★" !important;
  color: var(--sp4-accent) !important;
  font-family: inherit !important;
  text-shadow: 0 2px 10px rgba(252, 198, 29, 0.4) !important;
}

/* Star Rating Container */
.comment-form-rating {
  text-align: center;
  background: var(--sp4-bg);
  padding: 7px 15px !important;
  border-radius: 16px;
  border: 1px dashed var(--sp4-border);
}

.comment-form-rating label {
  margin-bottom: 16px;
}

.woocommerce p.stars {
  margin: 0 !important;
  display: flex !important;
  justify-content: center !important;
}

.woocommerce p.stars span {
  display: inline-flex !important;
  gap: 12px !important;
}

.woocommerce p.stars a {
  position: relative;
  display: inline-block !important;
  width: 36px !important;
  height: 36px !important;
  text-indent: -9999px !important;
  text-decoration: none !important;
  cursor: pointer;
  border: none !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Render Stars via Unicode */
.woocommerce p.stars a::before {
  content: "★" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  text-indent: 0 !important;
  font-size: 36px !important;
  line-height: 36px !important;
  text-align: center !important;
  color: #E2E4E8 !important;
  transition: color 0.2s ease !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  font-family: inherit !important;
  /* Xoá icon mặc định */
}

/* Active & Hover Logic (Forward DOM order) */
.woocommerce p.stars.selected a::before {
  color: var(--sp4-accent) !important;
  text-shadow: 0 4px 12px rgba(252, 198, 29, 0.3) !important;
}

.woocommerce p.stars.selected a.active~a::before {
  color: #E2E4E8 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.woocommerce p.stars:hover a::before {
  color: var(--sp4-accent) !important;
  text-shadow: 0 4px 12px rgba(252, 198, 29, 0.3) !important;
}

.woocommerce p.stars a:hover~a::before {
  color: #E2E4E8 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.woocommerce p.stars a:hover {
  transform: scale(1.15);
}

/* Textarea */
.comment-form-comment {
  margin: 0;
  width: 100%;
}

.comment-form-comment textarea {
  width: 100% !important;
  border: 1px solid var(--sp4-border) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  font-family: var(--sp4-font) !important;
  font-size: 15px !important;
  color: var(--sp4-dark) !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
  resize: vertical !important;
  min-height: 120px !important;
  background: #fff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) inset !important;
}

.comment-form-comment textarea:focus {
  outline: none !important;
  border-color: var(--sp4-primary) !important;
  box-shadow: 0 0 0 4px rgba(var(--sp4-primary-rgb), 0.1) !important;
}

/* Submit Button */
.form-submit {
  margin: 0 !important;
  display: flex !important;
}

.form-submit .submit {
  width: 100% !important;
  background: var(--sp4-primary) !important;
  color: #fff !important;
  border: none !important;
  padding: 16px 32px !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  font-family: var(--sp4-font) !important;
  box-shadow: 0 8px 20px rgba(51, 56, 160, 0.2) !important;
}

.form-submit .submit:hover {
  background: var(--sp4-dark) !important;
  box-shadow: 0 10px 25px rgba(26, 26, 46, 0.3) !important;
  transform: translateY(-2px) !important;
}/* ============================================
   UP-SELLS WIDGET (4-COLUMN SQUARE GRID - DEMO 4)
   ============================================ */

.widget-upsell {
    position: relative;
    margin-bottom: 40px;
}

/* Tiêu đề Widget */
.widget-upsell .widget-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--sp4-primary) !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    border-bottom: none !important;
}

/* Dòng kẻ dài sang trọng */
.widget-upsell .widget-title .is-divider {
    flex: 1;
    height: 2px !important;
    background: var(--sp4-border) !important;
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    max-width: none !important;
}

.widget-upsell .widget-title .is-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: -1px;
    width: 40px;
    height: 4px;
    background: var(--sp4-accent);
    border-radius: 4px;
}

/* Lưới 4 cột */
.widget-upsell .product_list_widget {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
}

/* Thẻ sản phẩm */
.widget-upsell .product_list_widget li {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    background: transparent !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    padding: 0 !important;
    border: none !important; /* Bỏ viền mặc định của widget list */
}

/* Liên kết ảnh và tên */
.widget-upsell .product_list_widget li a {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: var(--sp4-text) !important;
    flex: 1 !important;
    align-items: center !important;
    padding: 0 !important; /* Đè padding mặc định của Flatsome */
    margin: 0 !important;
    position: relative !important;
}

/* Hình ảnh vuông (Square) */
.widget-upsell .product_list_widget li a img {
    position: relative !important; /* BẮT BUỘC: Xóa position absolute của Flatsome */
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important; /* Bắt buộc để đè lại width="100" height="100" */
    aspect-ratio: 1/1 !important; 
    object-fit: cover !important;
    border-radius: var(--sp4-radius) !important;
    background: var(--sp4-bg) !important;
    margin: 0 0 16px 0 !important; /* Xóa margin mặc định */
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
    float: none !important; /* Đè CSS float left của WooCommerce list widget */
    max-width: 100% !important;
}

.widget-upsell .product_list_widget li:hover a img {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 30px rgba(51, 56, 160, 0.1) !important;
}

/* Tên sản phẩm */
.widget-upsell .product_list_widget li a .product-title {
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    transition: color 0.2s ease !important;
    margin-bottom: 8px !important;
    color: var(--sp4-text) !important; /* Đè màu xanh gốc */
}

.widget-upsell .product_list_widget li:hover a .product-title {
    color: var(--sp4-primary) !important;
}

/* Giá tiền */
.widget-upsell .product_list_widget li .amount {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--sp4-primary) !important;
    display: inline-block !important;
}

.widget-upsell .product_list_widget li .amount .woocommerce-Price-currencySymbol {
    font-size: 0.8em !important;
    vertical-align: top !important;
    opacity: 0.8 !important;
    margin-left: 2px !important;
}

/* Nút MUA NGAY ảo (Hiển thị đè lên ảnh) */
.widget-upsell .product_list_widget li::after {
    content: "MUA NGAY" !important;
    position: absolute !important;
    top: 35% !important; /* Căn giữa khoảng không gian của ảnh vuông */
    left: 50% !important;
    background: var(--sp4-white) !important;
    color: var(--sp4-primary) !important;
    border: 1px solid var(--sp4-primary) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    opacity: 0 !important;
    transform: translate(-50%, 20px) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: inline-block !important;
    pointer-events: none !important;
    z-index: 10 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

.widget-upsell .product_list_widget li:hover::after {
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
    background: var(--sp4-primary) !important;
    color: var(--sp4-white) !important;
    border-color: var(--sp4-primary) !important;
}

/* Xóa block sao đánh giá (nếu có) bị lệch trong widget dọc */
.widget-upsell .product_list_widget li .star-rating {
    display: none !important; 
}

/* Responsive */
@media (max-width: 992px) {
    .widget-upsell .product_list_widget {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .widget-upsell .product_list_widget {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}
