/*
Theme Name: Sửa Chữa Tủ Lạnh 247
Theme URI: http://localhost/suatulanh/
Author: WEB360.VN & Antigravity
Author URI: https://web360.vn
Description: WordPress theme converted from custom repair services HTML template. Designed for professional refrigerator repair, maintenance, and booking. Includes Advanced Custom Fields Pro integration.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: suachuatulanh
*/

/* --- LOGO SWAP ON SCROLL (WP CUSTOMIZER SITE LOGO vs. STICKY LOGO) --- */
.site-header .logo-normal {
  display: block !important;
}
.site-header .logo-sticky {
  display: none !important;
}
.site-header.scrolled .logo-normal {
  display: none !important;
}
.site-header.scrolled .logo-sticky {
  display: block !important;
}

/* Offcanvas mobile brand logo controls */
.mobile-menu-header .logo-normal {
  display: block !important;
}
.mobile-menu-header .logo-sticky {
  display: none !important;
}

.wpcf7-spinner {
  display: none !important;
}

/* --- CUSTOM TABLE STYLING FOR CONTENT AREAS --- */
.service-main-content table,
.article-content-body table,
.wp-block-table table {
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-dark, #333);
  border-collapse: collapse;
  font-size: 0.95rem;
  background-color: var(--bg-white, #fff);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.05));
}

.service-main-content table th,
.service-main-content table td,
.article-content-body table th,
.article-content-body table td,
.wp-block-table th,
.wp-block-table td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
  border: 1px solid var(--border-color, #eef2f5);
  font-weight: 600;
  text-align: center;
}

/* Header Cells Default styling (light grey headers) */
.service-main-content table th,
.article-content-body table th,
.wp-block-table th {
  background-color: var(--bg-light, #f8f9fa);
  color: var(--text-dark, #333);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  border-color: var(--border-color, #eef2f5);
}

/* Specific Header Row Title Cell style (First Row) */
.service-main-content table tr:first-child th,
.service-main-content table tr:first-child td,
.article-content-body table tr:first-child th,
.article-content-body table tr:first-child td,
.wp-block-table tr:first-child th,
.wp-block-table tr:first-child td {
  background: linear-gradient(90deg, var(--primary-dark, #b31b1b) 0%, var(--primary, #dc3545) 100%) !important;
  color: var(--bg-white, #fff) !important;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1.25rem 1.5rem;
  text-align: center !important;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem) !important;
  letter-spacing: 0.05em;
  border-color: var(--primary-dark, #b31b1b) !important;
}

/* Second Row: Column Headers */
.service-main-content table tr:nth-child(2) th,
.service-main-content table tr:nth-child(2) td,
.article-content-body table tr:nth-child(2) th,
.article-content-body table tr:nth-child(2) td,
.wp-block-table tr:nth-child(2) th,
.wp-block-table tr:nth-child(2) td {
  background-color: var(--bg-light, #f8f9fa) !important;
  color: var(--text-dark, #333) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  border-color: var(--border-color, #eef2f5) !important;
}

.service-main-content table tr:nth-child(even),
.article-content-body table tr:nth-child(even),
.wp-block-table tr:nth-child(even) {
  background-color: rgba(245, 245, 245, 0.4);
}

.service-main-content table tr:hover,
.article-content-body table tr:hover,
.wp-block-table tr:hover {
  background-color: rgba(230, 0, 18, 0.03);
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* First Column: Hạng mục sửa chữa (left-aligned, bold, with custom indentation) */
.service-main-content table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:first-child,
.article-content-body table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:first-child,
.wp-block-table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:first-child {
  color: var(--text-dark, #333);
  font-weight: 700;
  text-align: left;
  padding-left: 2rem;
}

/* Second Column: ĐVT (muted text) */
.service-main-content table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:nth-child(2),
.article-content-body table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:nth-child(2),
.wp-block-table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:nth-child(2) {
  color: var(--text-muted, #777);
}

/* Last Column: Đơn giá (bold red) */
.service-main-content table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:last-child,
.article-content-body table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:last-child,
.wp-block-table tr:not(:first-child):not(:nth-child(2)):not(:last-child) td:last-child {
  color: var(--primary, #e60012) !important;
  font-weight: 800;
  font-size: 1.05rem;
}

/* Style for Caption Row inside tables if present */
.service-main-content table tr:last-child td:has(.table-caption),
.article-content-body table tr:last-child td:has(.table-caption),
.wp-block-table tr:last-child td:has(.table-caption) {
  background-color: var(--bg-white, #fff) !important;
  background: none !important;
  border: 1px solid var(--border-color, #eef2f5) !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.service-main-content table tr:last-child td:has(.table-caption):hover,
.article-content-body table tr:last-child td:has(.table-caption):hover,
.wp-block-table tr:last-child td:has(.table-caption):hover {
  background-color: var(--bg-white, #fff) !important;
}

.table-caption {
  text-align: center;
  font-style: italic;
  color: var(--text-muted, #777);
  font-size: 0.85rem;
  padding: 1rem;
  display: block;
  width: 100%;
}

/* Responsiveness wrap wrapper */
.wp-block-table {
  overflow-x: auto;
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border-color, #eef2f5);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.05));
}
.service-main-content table-wrapper,
.article-content-body table-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Show floating action buttons on mobile, override display: none */
@media (max-width: 991.98px) {
  .floating-actions {
    display: flex !important;
    bottom: 20px !important;
    right: 20px !important;
  }
}
