/* Custom CSS for Flatsome Child Theme */

/* Example: Custom button styles */
div.wpcf7-mail-sent-ok {
  border: 2px solid #ffffff;
  color: #ffffff;
}
.mat_bang_can_ho_title {
  position: relative;
}
.mat_bang_can_ho_title span {
  color: #c99232;
  margin-bottom: 18px;
}
.mat_bang_can_ho_title::before {
  content: "";
  width: 30px;
  height: 1px;
  background: #c99232;
  position: absolute;
  bottom: 0;
  left: 50%;
  -webkit-transform: translateX(-50%);
  -moz-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  -o-transform: translateX(-50%);
  transform: translateX(-50%);
}
/* Add your custom styles below */

/**
 * Fix PageSpeed: Touch targets do not have sufficient size or spacing
 * Minimum touch target size: 48x48 pixels
 */
@media (max-width: 849px) {
  /* Main navigation menu links */
  .nav-sidebar li > a,
  .mobile-sidebar-menu li > a,
  .header-nav li > a,
  .nav li > a,
  .menu li > a,
  .sidebar-menu li > a {
    min-height: 48px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
  }

  /* Sub-menu items */
  .nav-sidebar .sub-menu li > a,
  .mobile-sidebar-menu .sub-menu li > a,
  .header-nav .sub-menu li > a {
    min-height: 44px;
    padding: 10px 15px 10px 25px;
  }

  /* Ensure sufficient spacing between items */
  .nav-sidebar li,
  .mobile-sidebar-menu li,
  .header-nav li {
    margin-bottom: 2px;
  }

  /* Off-canvas menu links */
  .off-canvas-left li > a,
  .off-canvas-right li > a,
  .mfp-content .sidebar-menu li > a {
    min-height: 48px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
  }
}

/**
 * Fix PageSpeed: Background and foreground colors do not have sufficient contrast ratio
 * WCAG AA requires contrast ratio of at least 4.5:1 for normal text
 */

/* 1. Contact Form 7 Submit Button - improve contrast */
.wpcf7-submit.mh-submit,
input.wpcf7-submit.mh-submit,
.wpcf7-form .mh-submit {
  background-color: #b8860b !important; /* Darker gold for better contrast */
  color: #ffffff !important;
}

/* 2. "Đọc tiếp" / Read More button links */
.button.secondary.is-link,
.button.secondary.is-link.is-small,
a.button.secondary.is-link {
  color: #1a5276 !important; /* Darker blue for better contrast */
}

.button.secondary.is-link:hover {
  color: #154360 !important;
}

/* 3. Post date badge text */
.badge .post-date-day,
.badge .post-date-month,
.badge-inner .post-date-day,
.badge-inner .post-date-month {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-inner {
  background-color: #c99232 !important; /* Ensure solid background */
}

/* 4. WooCommerce Product links */
.woocommerce-LoopProduct-link,
a.woocommerce-loop-product__link,
.products .product-title a {
  color: #1a1a1a !important; /* Dark text for better contrast */
}

.woocommerce-LoopProduct-link:hover,
a.woocommerce-loop-product__link:hover {
  color: #b8860b !important;
}

/* 5. Form input placeholder text - improve contrast */
input::placeholder,
textarea::placeholder,
.wpcf7-form-control::placeholder,
.mh-input::placeholder {
  color: #666666 !important; /* Darker placeholder for better contrast */
  opacity: 1;
}

/* 6. Absolute footer text */
.absolute-footer,
.absolute-footer .dark,
.absolute-footer a,
.copyright-footer {
  color: #e0e0e0 !important; /* Light enough to read on dark bg */
}

.absolute-footer a:hover {
  color: #ffffff !important;
}

/* 7. Generic link improvements for dark backgrounds */
/* Exclude dropdown menus which have light backgrounds */
.dark:not(.nav-dropdown) a:not(.nav-dropdown a),
.dark .button.is-link,
footer.dark a,
.footer-wrapper.dark a {
  color: #f0f0f0 !important;
}

/* Reset submenu/dropdown links to dark color - MAXIMUM SPECIFICITY */
.nav-dropdown a,
.sub-menu a,
.nav-dropdown .sub-menu a,
header .nav-dropdown a,
.header-nav .nav-dropdown a,
.header-bottom .nav-dropdown a,
.wide-nav .nav-dropdown a,
#wide-nav .nav-dropdown a,
.nav-dropdown li > a,
.nav-dropdown ul li a,
ul.nav-dropdown li a,
.nav-dropdown > li > a,
.header-nav-main .nav-dropdown a,
.nav-dark .nav-dropdown a,
.header-wrapper .nav-dropdown a,
/* Nested dropdown - level 2, 3 */
.nav-dropdown .nav-dropdown a,
.nav-dropdown .nav-dropdown li a,
.nav-dropdown .nav-dropdown .nav-dropdown a,
.nav-dropdown ul.children a,
.nav-dropdown ul.sub-menu a,
ul.nav-dropdown ul a,
.nav-dropdown ul a,
li.menu-item .nav-dropdown a {
  color: #333333 !important;
  text-shadow: none !important;
  background-color: transparent;
}

/* Dropdown container background */
.nav-dropdown,
ul.nav-dropdown,
.sub-menu {
  background-color: #ffffff !important;
}

.nav-dropdown a:hover,
.sub-menu a:hover,
.nav-dropdown li > a:hover,
.nav-dropdown .nav-dropdown a:hover {
  color: #c99232 !important;
  background-color: #f5f5f5 !important;
}

/* 8. Small text improvements */
.is-xsmall,
.is-xxsmall,
.op-7,
.op-8 {
  color: #555555;
}

.dark .is-xsmall,
.dark .is-xxsmall {
  color: #cccccc !important;
}

/* 9. Nav top links - header menu on slider/banner background */
.nav-top-link,
a.nav-top-link,
.header-bottom .nav-top-link,
.wide-nav .nav-top-link,
.nav-dark .nav-top-link {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.nav-top-link:hover {
  color: #ffd700 !important;
}

/* 10. Header bottom wide-nav - keep red background, add text-shadow for contrast */

.wide-nav.nav-dark a,
#wide-nav.nav-dark a,
.header-bottom a,
.wide-nav a {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 11. Product category text - improve contrast */
.product-cat,
.product-cat.op-8,
p.category.uppercase.is-smaller,
.category.uppercase.is-smaller.product-cat {
  color: #555555 !important;
  opacity: 1 !important;
}

/* 12. Badge date with stronger background - HIGH SPECIFICITY */
.badge.post-date .badge-inner,
.badge .badge-inner,
.badge-outline .badge-inner,
.badge-inner,
div.badge-inner,
.box .badge .badge-inner {
  background-color: #996600 !important; /* Even darker gold for better contrast */
  color: #ffffff !important;
}

span.post-date-day,
span.post-date-month,
.badge-inner span.post-date-day,
.badge-inner span.post-date-month,
.badge .badge-inner .post-date-day,
.badge .badge-inner .post-date-month {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  font-weight: bold;
}

/* 13. Form inputs with better placeholder contrast - HIGH SPECIFICITY */
input[placeholder]::placeholder,
textarea[placeholder]::placeholder,
.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder,
input.wpcf7-form-control::placeholder,
input.wpcf7-text::placeholder,
input.wpcf7-tel::placeholder,
input.wpcf7-email::placeholder,
.mh-input::placeholder,
input.mh-input::placeholder {
  color: #444444 !important;
  opacity: 1 !important;
}

/* 14. Dark section inputs - light placeholder */
.dark input::placeholder,
.dark textarea::placeholder,
.dark .wpcf7-form input::placeholder,
.section.dark input::placeholder,
.section.dark textarea::placeholder,
.section.mh-no-padding-bottom input::placeholder,
.section.mh-no-padding-bottom textarea::placeholder {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Universal mh-input placeholder - WHITE for dark backgrounds */
input.mh-input::placeholder,
.mh-input::placeholder,
.wpcf7-form .mh-input::placeholder,
input.wpcf7-form-control.mh-input::placeholder {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Ensure all wpcf7 inputs on dark bg have white placeholder */
.dark .mh-input::placeholder,
.dark input.wpcf7-text::placeholder,
.dark input.wpcf7-tel::placeholder,
.dark input.wpcf7-email::placeholder,
[class*="section_"] input.mh-input::placeholder,
section input.mh-input::placeholder {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* 15. Submit button - STRONGER CONTRAST */
input[type="submit"].wpcf7-submit,
input.wpcf7-submit.mh-submit,
.wpcf7-form input[type="submit"],
.wpcf7-form .mh-submit,
button.mh-submit,
input.mh-submit {
  background-color: #8b6914 !important; /* Dark gold - better contrast */
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border: none !important;
}

input[type="submit"].wpcf7-submit:hover,
input.wpcf7-submit.mh-submit:hover {
  background-color: #6b5210 !important;
}

ul#menu-san-pham ul.sub-menu li a {
  color: #000000 !important;
}

/* Fix mobile menu submenu text color - ensure dark text on white background */
.off-canvas-left .sub-menu li a,
.off-canvas-right .sub-menu li a,
.off-canvas-left .nav-sidebar .sub-menu a,
.off-canvas-right .nav-sidebar .sub-menu a,
.mfp-content .sidebar-menu .sub-menu li a,
.mfp-content .nav-sidebar .sub-menu li a,
.off-canvas-left .children li a,
.off-canvas-right .children li a,
/* Target category/product submenus specifically */
.off-canvas-left .menu-item-has-children .sub-menu a,
.off-canvas-right .menu-item-has-children .sub-menu a,
.off-canvas-left .menu-item-has-children .children a,
.off-canvas-right .menu-item-has-children .children a,
/* Account menu submenu */
.off-canvas-left .menu .sub-menu li a,
.off-canvas-right .menu .sub-menu li a,
/* All nested submenus in mobile */
.mfp-content .sub-menu a,
.mfp-content .children a {
  color: #1e2842 !important;
  text-shadow: none !important;
}

/* Category headings in mega menu / submenu - fix yellow/faded text */
.off-canvas-left .sub-menu .nav-column-title,
.off-canvas-right .sub-menu .nav-column-title,
.off-canvas-left .sub-menu .menu-item > span,
.off-canvas-right .sub-menu .menu-item > span,
.mfp-content .sub-menu .nav-column-title,
.mfp-content .sub-menu li.menu-item-type-taxonomy > a,
.mfp-content .sub-menu li.menu-item-object-product_cat > a,
/* All submenu parent category items */
.off-canvas-left .sub-menu > li.menu-item-has-children > a,
.off-canvas-right .sub-menu > li.menu-item-has-children > a,
.mfp-content .sub-menu > li.menu-item-has-children > a,
/* Mega menu column headers */
.off-canvas-left .sub-menu .ux-menu-title,
.off-canvas-right .sub-menu .ux-menu-title,
.mfp-content .sub-menu .ux-menu-title {
  color: #1e2842 !important;
  text-shadow: none !important;
  font-weight: 600;
}

/* Submenu hover state */
.off-canvas-left .sub-menu li a:hover,
.off-canvas-right .sub-menu li a:hover,
.mfp-content .sub-menu a:hover,
.mfp-content .children a:hover {
  color: #c99232 !important;
}

.home table {
  border: none !important;
}

/* ====================================================
   Product Grid & Card Styling - Similar to Reference
   ==================================================== */

/* Product grid container */

/* Product card box */
.product-small.box,
.product-small .box,
.product .box-image,
.woocommerce ul.products li.product {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: all 0.3s ease;
  position: relative;
}

/* Remove default box shadow if any */
.product-small.box,
.product-small .box,
.product-small .col-inner {
  box-shadow: none;
}

/* Card hover effect */
.product-small.box:hover,
.product-small .box:hover,
.woocommerce ul.products li.product:hover {
  border-color: #d32f2f;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Product image container */
.product-small .box-image,
.product-small .product-image,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
  position: relative;
  overflow: hidden;
  background: #f9f9f9;
}

/* Product image */
.product-small .box-image img,
.product-small .product-image img,
.woocommerce ul.products li.product img {
  transition: transform 0.4s ease;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Image hover zoom effect */
.product-small:hover .box-image img,
.product-small:hover .product-image img,
.woocommerce ul.products li.product:hover img {
  transform: scale(1.05);
}

/* Product info/text section */
.product-small .box-text,
.product-small .product-info,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  padding: 15px;
  text-align: left;
}

/* Product category label - Red/Orange style */
.product-small .product-cat,
.product-small .category,
.woocommerce ul.products li.product .product-cat,
p.category.uppercase.is-smaller.no-text-overflow.product-cat {
  color: #d32f2f !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  opacity: 1 !important;
  display: block;
}

/* Product title */
.product-small .product-title,
.product-small .name,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
}

.product-small .product-title a,
.product-small .name a {
  color: #000 !important;
  font-weight: 600 !important;
  text-decoration: none;
}

.product-small .product-title a:hover,
.product-small .name a:hover {
  color: #d32f2f !important;
}

/* Product badges - Bán Chạy, Mới, etc */
.product-small .badge,
.product-small .onsale,
.woocommerce span.onsale,
.callout.badge {
  position: absolute;
  z-index: 10;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

/* Sale/Discount badge - Red */
.product-small .onsale,
.woocommerce span.onsale {
  background: #d32f2f !important;
  color: #fff !important;
  top: 10px;
  left: 10px;
}

/* Hot/Best Seller badge - Orange/Red */
.callout.badge .callout-inner,
.badge.hot-product .badge-inner {
  background: #ff5722 !important;
  color: #fff !important;
}

/* New badge - Green */
.badge.new-product .badge-inner,
.callout.badge[data-badge*="Mới"] .callout-inner {
  background: #4caf50 !important;
  color: #fff !important;
}

/* Custom badge text */
.product-small .callout .callout-inner,
.product .callout .callout-inner {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
}

/* Badge positioning */
.product-small .callout,
.product .callout {
  top: 10px !important;
  left: 10px !important;
  right: auto !important;
}

/* Remove any triangle/arrow from badges */
.callout-inner::after,
.badge-inner::after {
  display: none !important;
}

/* Hide price and add to cart if not needed */
/* Uncomment these if you want to hide them
.product-small .price-wrapper,
.product-small .price,
.product-small .add-to-cart-button,
.product-small .add_to_cart_button {
  display: none !important;
}
*/

/* Pagination styling */

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 8px 14px;
  margin: 0 3px;
  color: #333;
  background: #fff;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-numbers.current,
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: #d32f2f;
  color: #fff;
  border-color: #d32f2f;
}

.page-numbers:hover,
.woocommerce nav.woocommerce-pagination ul li a:hover {
  border-color: #d32f2f;
  color: #d32f2f;
}

/* Filter/Sort dropdown styling */
.woocommerce .woocommerce-ordering select,
select.orderby {
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 8px 15px;
  font-size: 13px;
  color: #333;
}

/* Products count text */
.woocommerce-result-count {
  color: #666;
  font-size: 13px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .product-small .box-text,
  .product-small .product-info {
    padding: 10px;
  }

  .product-small .product-title,
  .product-small .name {
    font-size: 13px;
    min-height: 36px;
  }

  .product-small .product-cat,
  .product-small .category {
    font-size: 10px !important;
  }
}

/* ====================================================
   Solar Calculator Page Styling - Tính công suất NLMT
   ==================================================== */

/* Page background - light gray like mockup */
body.page-tinh-cong-suat-lap-nlmt,
body[class*="tinh-cong-suat"] {
  background-color: #f0f2f5;
}

body.page-tinh-cong-suat-lap-nlmt .main,
body[class*="tinh-cong-suat"] .main {
  background-color: #f0f2f5;
}

/* Calculator iframe - white card with shadow */
iframe[src*="script.google.com"] {
  background: #fff !important;
  border: none !important;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto;
}

/* The p wrapper around iframe */
p:has(> iframe[src*="script.google.com"]) {
  background: transparent;
  padding: 20px;
  margin: 0;
}

/* The col-inner wrapper */
.col-inner:has(iframe[src*="script.google.com"]) {
  background: #f0f2f5;
  padding: 40px 20px;
}

/* Section wrapper */
.section:has(iframe[src*="script.google.com"]) {
  background-color: #f0f2f5 !important;
}

footer#footer table {
  border: none !important;
}

/* Fix breadcrumbs visibility on product category pages */
.shop-page-title .breadcrumbs,
.shop-page-title .breadcrumbs a,
.shop-page-title .breadcrumbs span,
.category-page-title .breadcrumbs,
.category-page-title .breadcrumbs a,
.category-page-title .breadcrumbs span,
.woocommerce-breadcrumb,
.woocommerce-breadcrumb a,
.woocommerce-breadcrumb span,
.breadcrumbs a,
.breadcrumbs span,
nav.woocommerce-breadcrumb,
nav.woocommerce-breadcrumb a {
  color: #333333 !important;
}

.shop-page-title .breadcrumbs a:hover,
.category-page-title .breadcrumbs a:hover,
.woocommerce-breadcrumb a:hover,
.breadcrumbs a:hover {
  color: #d32f2f !important;
}

/* Ensure breadcrumb separator is visible */
.breadcrumbs .divider,
.woocommerce-breadcrumb .breadcrumb-separator,
nav.woocommerce-breadcrumb > span:not(:last-child)::after {
  color: #666666 !important;
}

/* ====================================================
   Hide top breadcrumb bar on product category pages
   and reposition sorting controls
   ==================================================== */

/* Hide the top red breadcrumb/page-title bar on shop/category pages */
.shop-page-title.category-page-title.page-title,
.woocommerce-archive .shop-page-title,
.tax-product_cat .shop-page-title {
  display: none !important;
}

/* Move sorting controls - display as block below products header */
.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering {
  float: none !important;
  text-align: left;
  margin-bottom: 20px;
}

/* Result count and ordering wrapper */
.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
  float: none !important;
  margin-bottom: 10px;
}

/* Make them display on same line */
.woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-notices-wrapper + .woocommerce-ordering {
  display: inline-block;
  margin-right: 15px;
}
.single-product .woocommerce-breadcrumb {
  display: none !important;
}
form#inputForm input {
  padding: 10px;
  height: 50px;
}
.tax-product_cat ul {
  padding-left: 30px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
  iframe[src*="script.google.com"] {
    border-radius: 12px;
    width: 100% !important;
    left: 0 !important;
    transform: none !important;
  }

  .col-inner:has(iframe[src*="script.google.com"]) {
    padding: 20px 10px;
  }
}

/* Blog Single Headings Font Weight */
.blog-single h1,
.blog-single h2,
.blog-single h3,
.blog-single h4,
.blog-single h5,
.blog-single h6,
.blog-single h1 *,
.blog-single h2 *,
.blog-single h3 *,
.blog-single h4 *,
.blog-single h5 *,
.blog-single h6 * {
  font-weight: 700 !important;
}
.wp-caption .wp-caption-text {
  font-weight: 400 !important;
}

/* Fix cart icon - smaller size and dark color on light header */
.header-main .cart-icon i,
.header-main .cart-icon svg,
header:not(.nav-dark) .cart-icon i,
header:not(.nav-dark) .cart-icon svg {
  color: #333333 !important;
  fill: #333333 !important;
  font-size: 18px !important;
}

/* Keep cart icon white on dark header */
.nav-dark .cart-icon i,
.header-main.nav-dark .cart-icon i,
.stuck .header-main .cart-icon i {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* ====================================================
   Mobile Menu Icon - Red circle with white hamburger
   ==================================================== */
@media (max-width: 849px) {
  /* Menu button container - red circle background */
  .header-main .mobile-menu a,
  .header-main .mfp-hamburger,
  .header-main .nav-icon,
  .header-main a.nav-dropdown-toggle,
  .header-main .off-canvas-toggle,
  .header .mobile-menu a,
  .header .mfp-hamburger,
  a.off-canvas-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    background-color: #d32f2f !important;
    border-radius: 50% !important;
    padding: 0 !important;
  }

  /* Menu hamburger icon - white color */
  .header-main .mobile-menu a i,
  .header-main .mfp-hamburger i,
  .header-main .nav-icon i,
  .header-main .off-canvas-toggle i,
  .header .mobile-menu a i,
  .header .mfp-hamburger i,
  a.off-canvas-toggle i,
  .off-canvas-toggle .icon-menu {
    color: #ffffff !important;
    font-size: 22px !important;
  }

  /* Cart icon - smaller on mobile */
  .header-main .cart-icon i,
  .header .cart-icon i {
    font-size: 20px !important;
    color: #333333 !important;
  }
}
