/*
Theme Name: ECUremap.PRO
Theme URI: 
Author: NAKTHONGKHAM Co.,Ltd.
Author URI: 
Description: ECUremap.PRO FSE Theme
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 5.7
Version: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ecuremap-pro
Tags: 
*/
/* =========================================================
   ECURemap Pro – Minimal Premium UI
   Focus: Nextend Social Login + EDD + Forms + WPML
   Font: Noto Sans Thai (สืบทอดจาก theme.json หรือไฟล์ฟอนต์)
   ========================================================= */

/* ---------- Base / Typography ---------- */
/* ===== Noto Sans Thai (self-host, subset + unicode-range) ===== */
/* Latin + Thai แยกต่อ weight เพื่อให้โหลดเท่าที่จำเป็น */

@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiLatin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiThai-400.woff2') format('woff2');
  unicode-range: U+0E00-0E7F;
}

@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiLatin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiThai-500.woff2') format('woff2');
  unicode-range: U+0E00-0E7F;
}

@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiLatin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiThai-600.woff2') format('woff2');
  unicode-range: U+0E00-0E7F;
}

@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiLatin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('assets/fonts/noto-sans-thai/NotoSansThaiThai-700.woff2') format('woff2');
  unicode-range: U+0E00-0E7F;
}

/* ใช้เป็นฟอนต์ระบบหลัก */
body {
  font-family: 'Noto Sans Thai', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html, body { overflow-x: clip; scrollbar-gutter: stable both-edges; }
body {
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background: var(--wp--preset--color--bg, #fff);
  color: var(--wp--preset--color--fg, #0f172a);
  font-family: var(--wp--preset--font-family--noto-sans-thai-system, 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
  line-height: 1.6;
}
a { text-decoration: none; color: var(--wp--preset--color--primary, #A38111); }
a:hover { opacity: .9; }

/* ---------- Container helpers ---------- */
:root {
  --ecu-viewport-w: 100svw;
  --ecu-pad: clamp(16px, 3vw, 32px);
  --ecu-radius: 16px;
  --ecu-radius-sm: 10px;
  --ecu-border: var(--wp--preset--color--border, #e5e7eb);
  --ecu-surface: var(--wp--preset--color--surface, #f8fafc);
  --ecu-muted: var(--wp--preset--color--muted, #6b7280);
  --ecu-shadow: 0 8px 24px rgba(0,0,0,.06);
}
@supports not (width: 100svw) { :root { --ecu-viewport-w: 100vw; }}

/* โครงการ์ด */
.ecu-card {
  background: #fff; border: 1px solid var(--ecu-border);
  border-radius: var(--ecu-radius); box-shadow: var(--ecu-shadow);
}

/* ---------- ฟอร์มทั่วไป (รวมหน้า Login/Register/Checkout) ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="tel"], input[type="number"], textarea, select {
  width: 100%; background: #fff; color: inherit;
  border: 1px solid var(--ecu-border); border-radius: var(--ecu-radius-sm);
  padding: 10px 12px; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary, #A38111);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #A38111) 24%, transparent);
}

/* ปุ่มพื้นฐาน (รวม .wp-element-button, EDD, Nextend จะทับด้านล่าง) */
button, .button, .wp-element-button, .wp-block-button__link,
input[type="submit"], .edd-submit, .edd-add-to-cart {
  border-radius: 999px; padding: 10px 16px; line-height: 1.2;
  background: var(--wp--preset--color--primary, #A38111); color: #fff; border: none;
  transition: filter .15s ease, transform .02s ease;
}
button:hover, .button:hover, .wp-element-button:hover,
.wp-block-button__link:hover, input[type="submit"]:hover,
.edd-submit:hover, .edd-add-to-cart:hover { filter: brightness(.95); }
button:active, .button:active, .wp-element-button:active,
.wp-block-button__link:active, input[type="submit"]:active,
.edd-submit:active, .edd-add-to-cart:active { transform: translateY(1px); }

/* ---------- NEXTEND SOCIAL LOGIN ---------- */
/* กล่องรวมปุ่มให้ดูเป็นการ์ดมินิมอล */
.nsl-container {
  padding: 0; margin: 0;
}
.nsl-container .nsl-container-block {
  border: 1px solid var(--ecu-border); border-radius: var(--ecu-radius);
  background: #fff; box-shadow: var(--ecu-shadow);
  padding: 16px;
}

/* ฟอนต์ & ไทโปฯ ให้เป็น Noto Sans Thai เหมือนธีม */
.nsl-container .nsl-button,
.nsl-container .nsl-button * {
  font-family: var(--wp--preset--font-family--noto-sans-thai-system, 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif) !important;
  font-weight: 600; letter-spacing: .2px;
}

/* สไตล์ปุ่มหลัก ๆ */
.nsl-container .nsl-button {
  border-radius: 999px !important; padding: 10px 16px !important;
  height: auto !important; min-height: 44px;
  justify-content: center !important; gap: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* ปุ่ม Google – มินิมอล โทนขาว */
.nsl-button-google {
  background: #fff !important; color: #111827 !important;
  border: 1px solid var(--ecu-border) !important;
}
.nsl-button-google:hover { background: #f9fafb !important; }

/* ปุ่ม Line – เขียวแบรนด์ นุ่มตา */
.nsl-button-line {
  background: #06c755 !important; color: #fff !important; border: none !important;
}
.nsl-button-line:hover { background: #05b44b !important; }

/* จัดไอคอนกับข้อความให้อยู่กลางทุกเคส */
.nsl-button .nsl-button-svg-container,
.nsl-button .nsl-button-label-container { align-items: center !important; }

/* ป้าย "เข้าสู่ระบบด้วยวิธีอื่น" ให้เป็น muted */
.nsl-container .nsl-inline-links a { color: var(--ecu-muted); }
.nsl-container .nsl-inline-links a:hover { color: var(--wp--preset--color--primary, #A38111); }

/* โฟกัสคีย์บอร์ดที่เห็นชัด (WCAG) */
.nsl-container .nsl-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--wp--preset--color--primary, #A38111) 35%, transparent);
  outline-offset: 2px;
}

/* ---------- EDD Minimal ---------- */
.edd_download {
  border: 1px solid var(--ecu-border); border-radius: var(--ecu-radius);
  background: #fff; box-shadow: var(--ecu-shadow); padding: 16px;
}
.edd_download .edd_download_title { margin: 0 0 8px; font-weight: 700; }
.edd_download_price, .edd_price, .price { font-weight: 700; color: #111827; }

/* ปุ่ม Add to Cart ของ EDD */
.edd-add-to-cart, .edd-submit { background: var(--wp--preset--color--primary, #A38111) !important; color: #fff !important; }

/* ตะกร้า/Checkout */
.edd-cart-item, .edd-cart-actions, .edd_empty_cart { border-color: var(--ecu-border); }
#edd_checkout_form_wrap {
  border: 1px solid var(--ecu-border); border-radius: var(--ecu-radius);
  background: #fff; box-shadow: var(--ecu-shadow); padding: 16px;
}
.edd-payment-mode-label { font-weight: 600; }

/* แจ้งเตือน/สถานะ */
.edd-alert-error   { background: #fff1f2; border: 1px solid #fecdd3; color: #b91c1c; border-radius: 12px; padding: 12px; }
.edd-alert-success { background: #ecfdf5; border: 1px solid #bbf7d0; color: #065f46; border-radius: 12px; padding: 12px; }

/* ---------- WPML Switcher ---------- */
.wpml-ls, .wpml-ls-legacy-dropdown, .wpml-ls-legacy-list-horizontal { font-size: 14px; }
.wpml-ls-legacy-dropdown a, .wpml-ls-legacy-list-horizontal a {
  border: 1px solid var(--ecu-border); border-radius: 999px; padding: 6px 10px; background: #fff;
}
.wpml-ls-current-language > a { background: var(--ecu-surface); }

/* ---------- Layout tweaks (login page) ---------- */
.page-template-login .entry-content > *:first-child,
body.login .wp-block-group.login-card {
  max-width: 720px; margin: 0 auto; padding: var(--ecu-pad);
}
.page-template-login .login-card { border-radius: var(--ecu-radius); }

/* ---------- Wide -> Full on Mobile ---------- */
.alignfull, .wp-block[data-align="full"] {
  width: var(--ecu-viewport-w); max-width: var(--ecu-viewport-w);
  margin-left: 50%; transform: translateX(-50%);
}
@media (max-width: 768px) {
  .alignwide, .wp-block[data-align="wide"] {
    width: var(--ecu-viewport-w) !important; max-width: var(--ecu-viewport-w) !important;
    margin-left: 50% !important; transform: translateX(-50%) !important;
  }
}

/* ---------- Reduced motion (เข้าถึงได้) ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* ให้คอนโทรล UI inherit ฟอนต์จาก body */
:where(button, input, select, textarea) {
  font-family: inherit !important;
}

/* เฉพาะ bottom-nav ของคุณ */
.ecu-bottom-nav,
.ecu-bottom-nav * {
  font-family: 'Noto Sans Thai', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

/* ปรับขนาดตัวอักษรให้อ่านง่ายขึ้น */
.ecu-bottom-nav .bnaw_item span {
  font-size: 12.5px; /* หรือ 13px */
  line-height: 1.2;
}

