/*
Theme Name: TALADKRU - ตลาดครู
Theme URI: https://taladkru.local
Author: TALADKRU Team
Author URI: https://taladkru.local
Description: ธีมตลาดครู (สีกากีชุดข้าราชการ) ออกแบบสำหรับร้านค้าสื่อการสอนและอุปกรณ์ครู รองรับ WooCommerce เต็มรูปแบบ
Version: 1.0.0
Text Domain: taladkru
*/

:root {
  --kk: #7C6B43;
  --kk-d: #57492A;
  --kk-l: #A2915F;
  --kk-x: #C8BB92;
  --sand: #EFE8D4;
  --sand2: #F9F6EC;
  --gold: #B8912F;
  --gold-l: #E3C765;
  --ink: #2E2A1E;
  --muted: #80785F;
  --line: #DFD7BF;
  --ok: #4F7A3A;
  --warn: #C08A1E;
  --danger: #A9432F;
  --r: 14px;
  --sh: 0 6px 20px rgba(87,73,42,.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', 'Noto Sans Thai', system-ui, sans-serif;
  background: var(--sand2);
  color: var(--ink);
  padding-bottom: 72px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 14px; }

/* HEADER */
header {
  background: linear-gradient(135deg, var(--kk), var(--kk-d));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(0,0,0,.18);
  border-bottom: 3px solid var(--gold);
}
.topline {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
  opacity: .92;
  gap: 12px;
  flex-wrap: wrap;
}
.topline .r { display: flex; gap: 14px; }
.topline a:hover { color: var(--gold-l); }
.hbar { display: flex; align-items: center; gap: 14px; padding: 8px 0 12px; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo .em {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.logo b { font-size: 23px; letter-spacing: -.5px; display: block; line-height: 1.1; color: #fff; }
.logo small { font-size: 10px; opacity: .85; letter-spacing: 3px; color: #fff; }

.searchbox {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 7px;
  padding: 3px;
  min-width: 0;
  position: relative;
}
.searchbox input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 12px;
  min-width: 0;
  color: var(--ink);
}
.searchbox button {
  background: var(--kk);
  color: #fff;
  padding: 0 22px;
  border-radius: 5px;
  font-size: 16px;
}
.ico { position: relative; font-size: 24px; color: #fff; background: none; padding: 0 5px; }
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 6px;
  border: 2px solid var(--kk-d);
}

.kw { display: flex; gap: 12px; font-size: 12px; opacity: .85; padding-bottom: 8px; overflow: auto; }
.kw a { color: #fff; white-space: nowrap; }
.kw a:hover { color: var(--gold-l); }

/* HERO & BANNER */
.hero {
  background: linear-gradient(120deg, var(--kk-d), var(--kk) 60%, var(--kk-l));
  border-radius: var(--r);
  color: #fff;
  padding: 26px;
  margin: 16px 0 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--kk-d);
}
.hero:after { content: '🎓'; position: absolute; right: -10px; bottom: -24px; font-size: 150px; opacity: .13; }
.hero h2 { font-size: 25px; margin-bottom: 6px; }
.hero p { opacity: .92; font-size: 14px; max-width: 60%; }
.hero .pill {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 30px;
  margin-top: 14px;
}

.flash {
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: var(--r);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.flash b { font-size: 17px; }

/* CATEGORIES */
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  background: #fff;
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.cat { text-align: center; padding: 12px 4px; border-radius: 10px; font-size: 12px; transition: .15s; color: var(--ink); }
.cat:hover { background: var(--sand); }
.cat.on { background: var(--kk); color: #fff; }
.cat b { display: block; font-size: 26px; margin-bottom: 6px; font-weight: 400; }

/* PRODUCT GRID */
.sechead { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 12px; gap: 10px; flex-wrap: wrap; }
.sechead h3 { color: var(--kk-d); font-size: 19px; border-left: 5px solid var(--gold); padding-left: 10px; }

ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 14px !important;
  list-style: none !important;
  margin: 0 0 24px 0 !important;
  padding: 0 !important;
}
ul.products li.product {
  background: #fff !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(46,42,30,.07) !important;
  transition: .18s !important;
  border: 1px solid var(--line) !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 0 12px 0 !important;
  width: auto !important;
}
ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh) !important;
  border-color: var(--kk-l) !important;
}
ul.products li.product a.woocommerce-loop-product__link {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  color: var(--ink) !important;
}
ul.products li.product img {
  width: 100% !important;
  aspect-ratio: 1 !important;
  object-fit: cover !important;
  background: var(--sand) !important;
  margin: 0 !important;
}
ul.products li.product .woocommerce-loop-product__title {
  font-size: 13px !important;
  line-height: 1.45 !important;
  height: 38px !important;
  overflow: hidden !important;
  margin: 9px 10px 5px !important;
  color: var(--ink) !important;
  font-weight: 600 !important;
}
ul.products li.product .price {
  color: var(--kk-d) !important;
  font-weight: 800 !important;
  font-size: 17px !important;
  padding: 0 10px !important;
  margin-top: auto !important;
}
ul.products li.product .price del {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  margin-right: 5px !important;
}
ul.products li.product .price ins {
  text-decoration: none !important;
}
ul.products li.product .button {
  margin: 8px 10px 0 !important;
  background: var(--kk) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 7px 10px !important;
}
ul.products li.product .button:hover {
  background: var(--kk-d) !important;
}
.onsale {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  margin: 0 !important;
  background: var(--danger) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 0 0 0 8px !important;
  min-height: auto !important;
  line-height: normal !important;
}

/* PANELS & COMMON WIDGETS */
.panel {
  background: #fff;
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh);
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
.btn {
  background: var(--kk);
  color: #fff;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
}
.btn:hover { background: var(--kk-d); }

/* BOTTOM NAV */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 100;
}
.nav a {
  flex: 1;
  padding: 8px 0;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}
.nav a b { font-size: 20px; font-weight: 400; }
.nav a:hover, .nav a.active { color: var(--kk); }
.nav .dot {
  position: absolute;
  top: 4px;
  right: 26%;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 20px;
  padding: 0 5px;
}

@media(max-width: 760px) {
  .hero p { max-width: 100%; }
  .logo b { font-size: 19px; }
}
