/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*---------------------------   gốc của gốc   ---------------------------*/


/*--------- table ---------*/
/* cho phép scroll ngang trực tiếp trên figure.table */
figure.table {
    display: block;               /* đảm bảo là block để overflow-x có hiệu lực */
    width: 100%;                  /* chiếm hết khung chứa */
    overflow-x: auto;             /* bật scroll ngang */
    -webkit-overflow-scrolling: touch; /* cuộn mượt iOS */
    margin: 0;                    /* loại bỏ margin mặc định nếu có */
    padding: 0;                   /* loại bỏ padding mặc định nếu có */
}

/* ép table đo theo nội dung, không co lại */
figure.table table {
    width: auto !important;       /* bỏ ép 100%, cho phép rộng theo nội dung */
    min-width: max-content;       /* rộng tối thiểu vừa đủ chứa toàn bộ nội dung */
    word-break: normal;           /* không cho wrap */
    white-space: nowrap;          /* giữ nguyên trên một dòng */
    margin: 0;                    /* đồng bộ với figure */
    padding: 0;
}

/* --- Toàn bộ rule cho table chung --- */
table {
    display: block;               /* biến table thành block để overflow-x có hiệu lực */
    width: auto !important;       /* không ép rộng 100%, cho phép rộng theo nội dung */
    max-width: 100%;              /* không vượt quá khung chứa */
    overflow-x: auto;             /* bật thanh cuộn ngang khi cần */
    -webkit-overflow-scrolling: touch; /* cuộn mượt trên iOS */
    white-space: nowrap;          /* không wrap xuống dòng mới */
    border-collapse: collapse;
    background: white;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    table-layout: auto;
    box-sizing: border-box;
    word-break: break-word;       /* fix overflow nội dung dài */
}

/* Fix padding thiếu ở 2 cột ngoài */
table td:first-child,
table th:first-child,
table td:last-child,
table th:last-child {
    padding-left: 15px;
    padding-right: 15px;
}

/* Base reset */
*,
:after,
:before,
html {
    box-sizing: border-box;
}

/* đảm bảo tất cả nội dung con trong td không tràn ra */
td > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* style cho th */
th {
    background: #f8f9fa;
    color: #495057;
    padding: 15px;
    text-align: left;
    font-weight: 700 !important;
    font-size: 14px;
    border: 1px solid #dee2e6;
}

/* style cho td */
td {
    padding: 15px;
    color: #212529;
    font-size: 14px;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

/* tự động căn giữa theo chiều dọc cho merged cells */
td[rowspan] {
    vertical-align: middle;
}

/* hover nhẹ toàn hàng */
tr:hover {
    background-color: #f8f9fa;
}

/* responsive: giảm padding, font trên mobile */
@media (max-width: 768px) {
    th,
    td {
        padding: 12px 10px;
        font-size: 13px;
    }

    table td:first-child,
    table th:first-child,
    table td:last-child,
    table th:last-child {
        padding-left: 10px;
        padding-right: 10px;
    }
}


/*--------- list ---------*/

/* Cơ bản cho danh sách không thứ tự */
ul {
	padding-left: 1.25rem;
	margin: 1em 0;
	list-style-type: disc;
	color: #374151;
	font-size: 0.95rem;
	line-height: 1.8;
}

/* Danh sách có thứ tự */
ol {
	padding-left: 1.25rem;
	margin: 1em 0;
	list-style-type: decimal;
	color: #374151;
	font-size: 0.95rem;
	line-height: 1.8;
}

/* Mục con trong danh sách */
li {
	margin-bottom: 0.5em;
	position: relative;
}

/* Nếu cần tạo danh sách tuỳ chỉnh icon (tuỳ chọn) */

/* ul.custom-list li::before {
  content: "✔";
  color: #0d6efd;
  font-weight: bold;
  margin-right: 0.5em;
}
ul.custom-list {
  list-style: none;
  padding-left: 1.5em;
} */

/* Responsive danh sách trên mobile */
@media (max-width:768px) {
	ul, ol {
		padding-left: 1rem;
		font-size: 0.9rem;
	}

}

/*************** ADD CUSTOM CSS HERE.   ***************/
@media only screen and (max-width:48em) {

	/*************** ADD MOBILE ONLY CSS HERE  ***************/
}

/* TÁCH DANH MỤC CON THÀNH MỘT KHỐI RIÊNG */
.woocommerce .product-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 40px;
	padding: 15px;
	background: #f9f9f9;
	border: 1px solid #ddd;
}

.woocommerce .product-categories li {
	width: 160px;
	list-style: none;
	text-align: center;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 15px 10px;
	transition: 0.3s;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.woocommerce .product-categories li:hover {
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
	border-color: #0056b3;
}

.woocommerce .product-categories li a {
	font-weight: 500;
	text-decoration: none;
	color: #1a1a1a;
}

/* KHOẢNG CÁCH PHÂN CÁCH VỚI SẢN PHẨM */
.archive .products {
	margin-top: 40px;
}

/* Tùy chỉnh hiển thị mô tả danh mục sản phẩm (Category Description) */
.term-description {
	margin-top: 30px;     /* Thêm khoảng cách phía trên */
	padding: 25px;     /* Thêm đệm bên trong */
	background-color: #f9f9f9;     /* Màu nền nhẹ */
	border: 1px solid #eee;     /* Viền nhẹ */
	border-radius: 8px;     /* Bo góc */
	line-height: 1.8;     /* Khoảng cách dòng */
	color: #555;     /* Màu chữ */
	font-size: 0.95em;     /* Kích thước chữ */
}

.term-description h1, .term-description h2, .term-description h3, .term-description h4, .term-description h5, .term-description h6 {
	color: #333;     /* Màu tiêu đề trong mô tả */
	margin-bottom: 15px;
}

.woocommerce-term-description ul {
	list-style: disc inside !important;
	padding-left: 1em;
	margin-left: 0 !important;
}

.woocommerce-term-description li {
	margin-bottom: 0.5em;
	padding-left: 0.5em;
}

/*--------- tooltip term attribute ---------*/
.custom-attributes-table {
	margin-top: 15px;
	margin-bottom: 20px;
	width: 100%;
}

.product-attributes-table {
	width: 100%;
	border: 1px solid #e0e0e0;
	background: #fff;
	border-collapse: collapse;
}

.product-attributes-table tbody tr {
	border-bottom: 1px solid #e0e0e0;
}

.product-attributes-table tbody tr:last-child {
	border-bottom: none;
}

.product-attributes-table td {
	padding: 8px 20px;
	vertical-align: top;
	font-size: 14px;
	line-height: 1.5;
}

.product-attributes-table td:first-child {
	white-space: nowrap;
	width: 1px;
	font-weight: 500;
}

.attribute-label {
	font-weight: 600;
	color: #333;
	width: 30%;
	border-right: 1px solid #e0e0e0;
}

.attribute-value {
	color: #555;
	width: 70%;
}

.attribute-value a {
	color: #0073aa;
	text-decoration: none;
}

.attribute-value a:hover {
	text-decoration: underline;
}

.tooltip-wrapper {
	cursor: help;
	display: inline-block;
}

.tooltip-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 11px;
	height: 11px;
	font-size: 9px;
	border: 1px solid gray;
	border-radius: 50%;
	cursor: pointer;
	user-select: none;
	line-height: 1;
	vertical-align: super;
	margin-left: 3px;
}

.custom-tooltip {
	background: white !important;
	padding: 10px 14px;
	border: 1px solid rgb(204, 202, 202);
	border-radius: 6px;
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 1.2;
	z-index: 1000;
	white-space: normal;
	max-width: 400px;
	pointer-events: none;
	display: inline-block;
	position: absolute;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-tooltip * {
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.7;
}

/* Responsive cho mobile */
@media (max-width:768px) {
	.product-attributes-table {
		font-size: 13px;
	}

	.product-attributes-table td {
		padding: 8px 10px;
	}

	.attribute-label {
		width: 35%;
	}

	.attribute-value {
		width: 65%;
	}

}

/*---------------------------   sidebar   ---------------------------*/

/*--------- bộ lọc plugin ---------*/
.wpc-filter-header .widget-title.wpc-filter-title {
	font-weight: 600 !important;
}

.wpc-filters-ul-list {
	gap: 10px 2px !important;
}

li.wpc-label-item {
	font-size: small !important;
	margin: 0 !important;
}

.wpc-filters-main-wrap .wpc-filters-labels li.wpc-term-item label span.wpc-filter-label-wrapper {
	padding: 5px 7px 4px !important;
}

/*---------------------------   Label Product   ---------------------------*/

/* Direct positioning with !important to override theme styles */
div.product-labels {
	display: flex !important;
	position: relative !important;
	top: unset !important;
	left: unset !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	z-index: unset !important;
	margin-bottom: .5rem;
	font-family: Arial, Helvetica, sans-serif;
}

/* Strong styling for labels */
.product-label {
	display: inline-block !important;
	border: 1px solid #e2e7e3;
	border-radius: 4px !important;
	background-color: whitesmoke !important;
	padding: 2px 6px !important;
	color: hsl(0, 0%, 34%) !important;
	font-weight: normal !important;
	font-size: 12px !important;
	line-height: 1.4 !important;

	&:hover {
		color: var(--global-palette-highlight) !important;
	}

}

/*---------------------------   Header   ---------------------------*/

/*--------- Menu ---------*/
ul.sub-menu li a::before {
	content: "\f0da";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	margin-right: 8px;
	color: inherit;
}

/*---------------------------   danh mục sản phẩm   ---------------------------*/
details {
	margin-bottom: 1.5rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #f9fafb;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	overflow: hidden;
}

details[open] {
	border-color: #9ca3af;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

summary {
	position: relative;
	display: block;
	padding: 1.25rem 1.5rem 1.25rem 3.5rem;     /* 👈 TEXT CÁCH TRÁI XA HẲN */
	font-size: 1rem;
	font-weight: 600;
	color: #111827;
	background-color: #f3f4f6;
	cursor: pointer;
	user-select: none;
	border: none;
	outline: none;
	appearance: none;
	text-shadow: rgb(17, 24, 39) 0px 0px 0px !important;     /* nếu bạn vẫn cần */
}

summary::marker, summary::-webkit-details-marker {
	display: none;
}

/* Mũi tên trái */
summary::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 1.25rem;     /* 👈 mũi tên sát trái */
	transform: translateY(-50%) rotate(45deg);
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid #6b7280;
	border-bottom: 2px solid #6b7280;
	transition: transform 0.3s ease;
}

details[open] summary::before {
	transform: translateY(-50%) rotate(135deg);
	border-color: #4b5563;
}

details > summary + * {
	padding: 1.25rem 1.5rem;
	margin: 0;
	background: white;
	color: #555;
	font-size: 0.95rem;
	line-height: 1.6;
	border-top: 1px solid #e5e7eb;
	text-shadow: rgb(85, 85, 85) 0px 0px 0px !important;
}

/* Responsive */
@media (max-width:768px) {
	summary {
		padding: 1rem 1rem 1rem 3rem;
		font-size: 0.95rem;
	}

	details > summary + * {
		padding: 1rem 1.25rem;
		font-size: 0.9rem;
	}

}

/*---------------------------   sản phẩm   ---------------------------*/
.product-summary {
	max-width: 55%;
}
