/* *************** Porto Child Theme Custom CSS *************** */

/* Logo căn giữa */
.logo-main {
  margin: 0 auto !important;
}

@media (min-width: 992px) {
  /* Chỉ áp dụng cho text "Danh mục sản phẩm" trong submenu trên PC */
  ul.sub-menu > li.menu-item > a {
    color: #000 !important;
    font-size: 18px !important;
    font-weight: 600;
    text-transform: none;
  }
}


/* Không áp dụng style này cho các link con trong menu block */
ul.sub-menu .menu-block a {
  color: inherit !important;
}


/* ===================================================== */
/* 1. Submenu hiện mượt (desktop only) */
/* ===================================================== */
.main-menu > li.menu-item-has-children > .popup {
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-menu > li.menu-item-has-children:hover > .popup {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* ===================================================== */
/* 2. Danh mục bên trái hiện lần lượt (desktop only) */
/* ===================================================== */
.menu-block .elementor-icon-list-item {
  opacity: 0 !important;
  transform: translateY(-25px) !important;
  transition: opacity 0.9s cubic-bezier(0.25, 0.8, 0.25, 1), 
              transform 0.9s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(1) { transition-delay: 0.15s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(2) { transition-delay: 0.28s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(3) { transition-delay: 0.41s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(4) { transition-delay: 0.54s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(5) { transition-delay: 0.67s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(6) { transition-delay: 0.80s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(7) { transition-delay: 0.93s !important; }
.main-menu > li.menu-item-has-children:hover .elementor-icon-list-item:nth-child(8) { transition-delay: 1.06s !important; }

/* ===================================================== */
/* 3. Sản phẩm bên phải hiện từng cái (desktop only) */
/* ===================================================== */
.menu-block .products .product,
.menu-block .products .porto-tb-item {
  opacity: 0 !important;
  transform: translateX(-40px) !important;
  transition: opacity 0.9s cubic-bezier(0.25, 0.8, 0.25, 1), 
              transform 1s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  transition-delay: 0s !important;
}
.main-menu > li.menu-item-has-children:hover .products .product,
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.main-menu > li.menu-item-has-children:hover .products .product:nth-child(1),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(1) { transition-delay: 1.30s !important; }
.main-menu > li.menu-item-has-children:hover .products .product:nth-child(2),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(2) { transition-delay: 1.48s !important; }
.main-menu > li.menu-item-has-children:hover .products .product:nth-child(3),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(3) { transition-delay: 1.66s !important; }
.main-menu > li.menu-item-has-children:hover .products .product:nth-child(4),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(4) { transition-delay: 1.84s !important; }
.main-menu > li.menu-item-has-children:hover .products .product:nth-child(5),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(5) { transition-delay: 2.02s !important; }
.main-menu > li.menu-item-has-children:hover .products .product:nth-child(6),
.main-menu > li.menu-item-has-children:hover .products .porto-tb-item:nth-child(6) { transition-delay: 2.20s !important; }

/* Animation cho các product items */
.porto-posts-grid .porto-tb-item {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}
.porto-posts-grid .porto-tb-item:nth-child(1) { animation-delay: 0.1s; }
.porto-posts-grid .porto-tb-item:nth-child(2) { animation-delay: 0.2s; }
.porto-posts-grid .porto-tb-item:nth-child(3) { animation-delay: 0.3s; }
.porto-posts-grid .porto-tb-item:nth-child(4) { animation-delay: 0.4s; }
.porto-posts-grid .porto-tb-item:nth-child(5) { animation-delay: 0.5s; }
.porto-posts-grid .porto-tb-item:nth-child(6) { animation-delay: 0.6s; }
.porto-posts-grid .porto-tb-item:nth-child(7) { animation-delay: 0.7s; }
.porto-posts-grid .porto-tb-item:nth-child(8) { animation-delay: 0.8s; }

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

/* ===== Sidebar Widget (PC only) ===== */
.widget_product_categories {
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
}
.widget_product_categories .widget-title {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  color: #ffffff;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid #ff4444;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}
.widget_product_categories .widget-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
}
.widget_product_categories .widget-title:hover {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}
.widget_product_categories .product-categories {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #1a1a1a;
}
.widget_product_categories .product-categories .cat-item {
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
  justify-content: space-around;
  transition: all 0.3s ease;
  position: relative;
}
.widget_product_categories .product-categories .cat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff4444 0%, transparent 100%);
  transition: width 0.4s ease;
}
.widget_product_categories .product-categories .cat-item:hover::before {
  width: 100%;
}
.widget_product_categories .product-categories .cat-item:hover {
  background: rgba(255, 68, 68, 0.05);
}
.widget_product_categories .product-categories .cat-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  color: #d0d0d0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  gap: 15px;
}
.widget_product_categories .product-categories .cat-item a::before {
  content: "▸";
  position: absolute;
  left: 6px;
  color: #ff4444;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
}
.widget_product_categories .product-categories .cat-item:hover a {
  color: #ffffff;
  padding-left: 26px;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.widget_product_categories .product-categories .cat-item .count {
  color: #ffffff;
  padding: 4px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  min-width: 30px;
  text-align: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.widget_product_categories .product-categories .cat-item:hover .count {
  transform: scale(1.1);
}
.widget_product_categories .product-categories .cat-item.current {
  background: linear-gradient(90deg, #ff4444 0%, transparent 100%);
}
.widget_product_categories .product-categories .cat-item.current a {
  color: #ffffff;
  padding-left: 26px;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

@media (min-width: 992px) {
  .sidebar.porto-woo-category-sidebar {
    position: sticky;
    top: 100px;
    align-self: flex-start;
    height: fit-content;
    z-index: 10;
    transition: top 0.5s ease;
  }
}


/* ===== FIX SIDEBAR PUSHING MOBILE VIEWPORT ===== */
@media (max-width: 991px) {
  .widget_product_categories {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    z-index: 999;
  }

  html, body {
    overflow-x: hidden !important;
  }

  * {
    box-sizing: border-box;
    max-width: 100vw;
  }
}

.e-con.shop-loop-before.sticky {
    position: static !important;
    top: auto !important;
}
.CSKH .elementor-icon-box-icon .elementor-icon {
    background-color: #FFD700;   /* Nền vàng */
    border-radius: 50%;          /* Bo tròn */
    width: 35px;                 /* Kích thước nền tròn */
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.CSKH .elementor-icon-box-icon i {
    color: #fff;
    font-size: 22px;
}

.review-form-collapsed {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
}

.review-form-expanded {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height .4s ease;
}

#toggle-review-form-btn {
    margin: 12px 0;
    padding: 10px 15px;
    font-weight: 500;
    background: #f2f2f2;
    border: 1px solid #ddd;
    cursor: pointer;
    display: inline-block;
}

/* ========== FIX PRODUCT IMAGE AREA ========== */
.posts-wrap .product-image {
    width: 100%;
    height: 450px;              /* thay theo nhu cầu */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;           /* nền trắng để ảnh nhỏ không bị khoảng đen */
    overflow: hidden;
}

/* Ảnh bên trong luôn lấp đầy khung */
.posts-wrap .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;  /* AVOID CROPPING */
    object-position: center;
}

/* Title constant height */
.posts-wrap .post-title {
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price luôn ở dưới */
.posts-wrap .tb-woo-price {
    margin-top: auto;
}

/* ========== MOBILE RESPONSIVE ========== */
@media(max-width: 767px) {
    .posts-wrap .product-image {
        height: 180px !important; /* Thấp hơn cho mobile */
    }
	
    .posts-wrap .post-title {
        min-height: 40px;
    }
	
	.relay-product .posts-wrap .product-image {
		height: 180px !important;
	}
}

/* ----- FIX ẢNH SẢN PHẨM TRONG KHỐI SẢN PHẨM LIÊN QUAN ----- */

.relay-product .posts-wrap .product-image {
    width: 100%;
    height: 350px; /* chỉnh theo ý bạn: 300 / 350 / 400 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

/* Ảnh luôn vừa khung, không crop */
.relay-product .posts-wrap .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center !important;
}


/* RESET ảnh hưởng từ theme Porto */
.button-shop .single_add_to_cart_button,
.button-shop .wc-buy-now-btn-single {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
    text-shadow: none !important;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    color: #fff !important;
    z-index: 1;
}


/* ================================
   NÚT ADD TO CART – ĐỎ #e70012
================================ */
.button-shop .single_add_to_cart_button {
    background-color: #e70012 !important;
	border-radius: 35px !important;
}

/* Overlay hiệu ứng */
.button-shop .single_add_to_cart_button::before {
    content: "";
    position: absolute;
    bottom: -100%;     /* chạy từ dưới lên */
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.25);
    transition: bottom .35s cubic-bezier(.215,.61,.355,1);
    z-index: -1;
}

.button-shop .single_add_to_cart_button:hover::before {
    bottom: 0;
}


/* ================================
   NÚT BUY WITH SHOP – TÍM #4524DB
================================ */
.button-shop .wc-buy-now-btn-single {
    background-color: #4524DB !important;
}

/* Overlay hiệu ứng */
.button-shop .wc-buy-now-btn-single::before {
    content: "";
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.25);
    transition: bottom .35s cubic-bezier(.215,.61,.355,1);
    z-index: -1;
}

.button-shop .wc-buy-now-btn-single:hover::before {
    bottom: 0;
}

/* Hover text giữ trắng */
.button-shop .single_add_to_cart_button:hover,
.button-shop .wc-buy-now-btn-single:hover {
    color: #fff !important;
}

/* Xếp dọc toàn bộ khối button-shop */
.button-shop .product-summary-wrap form.cart {
    display: flex;
    flex-direction: column;
    align-items: stretch;   /* full width */
    width: 100%;
    gap: 12px;
}

/* Quantity full width */
.button-shop .cart .quantity {
    width: 100%;
}

/* ===== Nút ADD TO CART ===== */
.button-shop .single_add_to_cart_button {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
}

/* ===== Nút BUY WITH SHOP ===== */
.button-shop .wc-buy-now-btn-single {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
}

.searchform .live-search-list {
	width: 100% !important;
	margin-top: 10px !important;
}

.searchform .live-search-list .autocomplete-suggestions {
	border-radius: 15px;
}

.search-pc .searchform .live-search-list {
	min-width: 500px !important;
}

.search-mobile .searchform .live-search-list {
	min-width: unset !important;
}

.search-mobile .searchform .live-search-list .autocomplete-suggestions {
	overflow-y: auto;
	border-radius: 12px;
}

.searchform .live-search-list {
	left: auto !important;
	right: auto !important;
}

.porto-icon-circle-thin::before{
  content: none !important;
  display: none !important;
}

.header-wrapper {
  position: sticky;
  top: 0;          /* Luôn dính vào đỉnh trang */
  z-index: 9999;
  background: #000;
}

@media (max-width: 767px) {
    .share-links {
        display: none !important;
    }
}

i.porto-icon-circle-thin {
    display: contents !important;
}

.footer-text .elementor-icon-list-text {
    font-style: normal !important;
}


.e-hosted-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.e-hosted-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
  span.price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

	span.price > span[aria-hidden="true"] {
    line-height: 0.5;
    color: #000000;
  }
}