/*
Theme Name: Điện Máy Minh Châu
Theme URI: https://dienmayminhchau.net
Author: Tài Coder
Author URI: https://dienmayminhchau.net
Description: Giao diện chuyên nghiệp dành cho Siêu Thị Điện Máy Minh Châu – Tối ưu tốc độ, chuẩn SEO, responsive 100% cho mobile & desktop.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: dienmayminhchau
*/

:root {
  --primary-color: #d70018;
  --primary-hover: #b80015;
  --primary-light: #fff0f1;
  --secondary-color: #ff9800;
  --secondary-hover: #e68900;
  --dark-color: #1a1a1a;
  --text-color: #333333;
  --text-muted: #666666;
  --bg-light: #f4f6f8;
  --border-color: #e5e7eb;
  --white: #ffffff;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 8px 24px rgba(215, 0, 24, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:
    "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
}

/* Bảo vệ FontAwesome & Dashicons không bị đè font */
.fa,
.fas,
.far,
.fal,
.fad,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
[class^="fa-"],
[class*=" fa-"],
i.fa-solid,
i.fa-brands,
i.fa-regular,
i[class*="fa-"] {
  font-family:
    "Font Awesome 6 Free", "Font Awesome 6 Brands", FontAwesome !important;
  display: inline-block;
}

.fa-brands,
[class^="fa-brands"],
[class*=" fa-brands"] {
  font-family: "Font Awesome 6 Brands" !important;
}

.fa-solid,
.fas,
[class^="fa-solid"],
[class*=" fa-solid"] {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.dashicons,
[class^="dashicons-"],
[class*=" dashicons-"] {
  font-family: "dashicons" !important;
}

/* Custom Global Modern Scrollbar (Thanh cuộn chuột sắc nét, hiện rõ cục trượt để kéo) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
  background: #d70018;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   Article Content & Typography Styling (Prose & Tables)
   ========================================================================== */
.prose,
.entry-content,
.post-content {
  color: #334155;
  line-height: 1.8;
  font-size: 16px;
}

.prose h1,
.entry-content h1,
.post-content h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
}

.prose h2,
.entry-content h2,
.post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  border-left: 4px solid #d70018;
  padding-left: 12px;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
}

.woocommerce h2,
.woocommerce-page h2,
.cart-empty-wrapper h2,
.prose .cart-empty-wrapper h2,
.prose .woocommerce h2 {
  border-left: none !important;
  padding-left: 0 !important;
}

.prose h3,
.entry-content h3,
.post-content h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.65em;
}

.prose h4,
.entry-content h4,
.post-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
}

.prose h5,
.entry-content h5,
.post-content h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.prose h6,
.entry-content h6,
.post-content h6 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.prose p,
.entry-content p {
  margin-bottom: 1.25em;
}

.prose ul,
.entry-content ul,
.post-content ul {
  list-style-type: disc !important;
  margin: 1.25em 0;
  padding-left: 1.75em !important;
}

.prose ol,
.entry-content ol,
.post-content ol {
  list-style-type: decimal !important;
  margin: 1.25em 0;
  padding-left: 1.75em !important;
}

.prose ul ul,
.entry-content ul ul {
  list-style-type: circle !important;
}

.prose ol ol,
.entry-content ol ol {
  list-style-type: lower-alpha !important;
}

.prose li,
.entry-content li,
.post-content li {
  margin-bottom: 0.5em;
  display: list-item !important;
}

.prose ol > li::marker,
.entry-content ol > li::marker,
.post-content ol > li::marker {
  font-weight: 700;
  color: #0f172a;
}

/* Beautiful Table Styling */
.prose table,
.entry-content table,
.post-content table,
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75em 0;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.prose table thead,
.entry-content table thead {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.prose table th,
.entry-content table th,
.post-content table th,
table th {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.prose table td,
.entry-content table td,
.post-content table td,
table td {
  padding: 13px 18px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  vertical-align: middle;
  line-height: 1.6;
}

.prose table td:last-child,
.entry-content table td:last-child,
table td:last-child {
  border-right: none;
}

.prose table tbody tr:nth-child(even),
.entry-content table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.prose table tbody tr:hover,
.entry-content table tbody tr:hover,
table tbody tr:hover {
  background-color: #fef2f2;
  transition: background-color 0.2s ease;
}

.prose table tbody tr:last-child td,
.entry-content table tbody tr:last-child td,
table tbody tr:last-child td {
  border-bottom: none;
}

/* Blockquote */
.prose blockquote,
.entry-content blockquote {
  border-left: 4px solid #d70018;
  background-color: #f8fafc;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #475569;
  margin: 1.5em 0;
}

/* Post Images & Captions */
.prose img,
.entry-content img {
  border-radius: 12px;
  margin: 1.5em auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wp-caption {
  max-width: 100%;
  margin: 1.5em auto;
  text-align: center;
}

.wp-caption-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
  font-style: italic;
}

/* ==========================================================================
   Custom Modern Pagination (Phân trang cao cấp)
   ========================================================================== */
.pagination,
.posts-pagination,
.navigation.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  width: 100%;
}

.pagination .nav-links,
.navigation.pagination .nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination .page-numbers,
.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}

.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
  border-color: #dc2626;
  color: #dc2626;
  background-color: #fef2f2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.12);
}

.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  cursor: default;
  transform: none;
}

.pagination .page-numbers.dots,
.navigation.pagination .page-numbers.dots {
  border: none;
  background: transparent;
  box-shadow: none;
  color: #94a3b8;
  padding: 0 0.25rem;
  min-width: auto;
}

/* ==========================================================================
   Custom WooCommerce Product Reviews & Rating Styles (Thiết kế Đánh giá Cao cấp)
   ========================================================================== */
.woocommerce-Reviews {
  margin-top: 2rem;
}

.woocommerce-Reviews #reply-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  margin-bottom: 1rem;
}

.woocommerce-Reviews .comment-respond {
  margin-top: 1rem;
}

.woocommerce-Reviews .comment-form-rating label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.5rem;
}

.woocommerce-Reviews p.stars,
p.stars,
.comment-form-rating p.stars {
  display: flex !important;
  align-items: center;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.woocommerce-Reviews p.stars span,
p.stars span,
.comment-form-rating p.stars span {
  display: flex !important;
  align-items: center;
  gap: 0.35rem;
}

.woocommerce-Reviews p.stars span a,
p.stars span a,
p.stars a,
.comment-form-rating p.stars a {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.75rem !important;
  height: 1.75rem !important;
  font-size: 1.35rem !important;
  text-indent: 0 !important;
  overflow: visible !important;
  text-decoration: none !important;
  cursor: pointer !important;
  color: transparent !important;
}

.woocommerce-Reviews p.stars span a::before,
p.stars span a::before,
p.stars a::before,
.comment-form-rating p.stars a::before,
.comment-form-rating p.stars span a::before {
  content: "★" !important;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-size: 1.5rem !important;
  line-height: 1 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-indent: 0 !important;
  color: #cbd5e1 !important;
  transition: all 0.15s ease !important;
}

.woocommerce-Reviews p.stars span a:hover::before,
.woocommerce-Reviews p.stars span a.active::before,
.woocommerce-Reviews p.stars span:hover a::before,
p.stars span a:hover::before,
p.stars span a.active::before,
p.stars span:hover a::before,
p.stars a:hover::before,
p.stars a.active::before,
.comment-form-rating p.stars a:hover::before,
.comment-form-rating p.stars a.active::before {
  color: #f59e0b !important;
  transform: scale(1.15) !important;
}

.woocommerce-Reviews p.stars span a:hover ~ a::before,
p.stars span a:hover ~ a::before,
.comment-form-rating p.stars span a:hover ~ a::before {
  color: #cbd5e1 !important;
  transform: scale(1) !important;
}

.woocommerce-Reviews .comment-form input[type="text"],
.woocommerce-Reviews .comment-form input[type="email"],
.woocommerce-Reviews .comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.woocommerce-Reviews .comment-form input[type="text"]:focus,
.woocommerce-Reviews .comment-form input[type="email"]:focus,
.woocommerce-Reviews .comment-form textarea:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.woocommerce-Reviews .form-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 2rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s ease;
}

.woocommerce-Reviews .form-submit input[type="submit"]:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
}

/* ==========================================================================
   Carousel & Slider Drag Physics (Chống Kéo Rời Ảnh, Trượt Quán Tính Siêu Mượt)
   ========================================================================== */
[id^="cat-slider-"],
[id^="cat-slider-"] * {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ==========================================================================
   Scroll Reveal Animation Engine (Hiệu Ứng Xuất Hiện Mượt Mà Khi Cuộn Trang)
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-stagger.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale.is-revealed {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Tách bạch & Tối ưu hiển thị Giá Sản Phẩm (Giá gốc vs Giá khuyến mãi)
   ========================================================================== */
.price,
.prod-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  line-height: 1.25;
}

del,
.price del,
.prod-price del,
del .woocommerce-Price-amount {
  color: #94a3b8 !important; /* Xám slate nhẹ nhàng */
  font-size: 11.5px !important;
  font-weight: 400 !important;
  text-decoration: line-through !important;
  margin-right: 4px;
}

ins,
.price ins,
.prod-price ins,
ins .woocommerce-Price-amount {
  color: #dc2626 !important; /* Đỏ tươi nổi bật */
  font-size: 13.5px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

@media (min-width: 640px) {
  del,
  del .woocommerce-Price-amount {
    font-size: 12px !important;
  }
  ins,
  ins .woocommerce-Price-amount {
    font-size: 14.5px !important;
  }
}

/* ==========================================================================
   Sửa triệt để lỗi Avatar bình luận bị nhảy lệch do WooCommerce CSS
   ========================================================================== */
.woocommerce #reviews #comments ol.commentlist li,
.woocommerce-page #reviews #comments ol.commentlist li,
#comments ol.commentlist li {
  position: static !important;
  padding-left: 0 !important;
}

.woocommerce #reviews #comments ol.commentlist li img.avatar,
.woocommerce-page #reviews #comments ol.commentlist li img.avatar,
#comments ol.commentlist li img.avatar,
.dmmc-review-avatar img,
.dmmc-review-avatar img.avatar {
  position: static !important;
  float: none !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 9999px !important;
  display: block !important;
}
