/*
Theme Name: KeroRong Child
Theme URI: https://kerorong.com/
Description: Amayama-style auto parts storefront — Astra child theme. T1-T8 templates by KeroRong build.
Author: KeroRong
Template: astra
Version: 0.1.0
Text Domain: kerorong-child
*/

/* ============ Design tokens (Amayama-style: dense, utilitarian, blue) ============ */
:root {
  --kr-primary: #14417B;
  --kr-primary-dark: #0C2C55;
  --kr-accent: #D85A30;
  --kr-bg: #FFFFFF;
  --kr-bg-alt: #F4F6F8;
  --kr-border: #DDE3EA;
  --kr-text: #1C2530;
  --kr-text-muted: #5F6B7A;
}

body {
  color: var(--kr-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.kr-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.kr-section h2,
.kr-hero h1 {
  font-weight: 600;
}

/* ============ Global fixes (header overlap + footer credit) ============ */

/* Astra transparent header must not float over content */
body.ast-has-transparent-header .main-header-bar-wrap,
body.ast-has-transparent-header .main-header-bar {
  position: relative !important;
  background: #ffffff !important;
}

body.ast-has-transparent-header .site-header {
  position: relative !important;
  z-index: 5;
}

/* hide Astra default copyright (own credit line printed via wp_footer) */
.ast-footer-copyright {
  display: none !important;
}

/* ============ Amayama-style top line + nav (Astra header retired) ============ */

body:not(.wp-admin) .site-header {
  display: none !important;
}

.kr-topline {
  background: #fff;
  border-bottom: 1px solid var(--kr-border);
}

.kr-topline__in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.kr-topline__logo {
  font-weight: 700;
  font-size: 21px;
  color: var(--kr-primary-dark);
  text-decoration: none;
  margin-right: auto;
}

.kr-topline__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.kr-topline__login {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kr-text);
  font-size: 13px;
  text-decoration: none;
}

.kr-topline__login b {
  color: var(--kr-primary);
  font-weight: 600;
}

.kr-topline__login:hover b {
  text-decoration: underline;
}

.kr-topline__cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kr-primary);
  text-decoration: none;
}

.kr-topline__count {
  background: var(--kr-accent);
  color: #fff;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  line-height: 1.5;
}

.kr-topline__total {
  color: var(--kr-text-muted);
  font-size: 13px;
}

.kr-topline__cur {
  color: var(--kr-text-muted);
  font-size: 12px;
  border-left: 1px solid var(--kr-border);
  padding-left: 14px;
}

.kr-nav {
  background: #fff;
  border-bottom: 1px solid var(--kr-border);
}

.kr-nav .kr-topline__in {
  padding-top: 0;
  padding-bottom: 0;
}

.kr-nav__menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.kr-nav__menu a {
  display: block;
  padding: 11px 0;
  font-size: 13.5px;
  color: var(--kr-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.kr-nav__menu a:hover {
  color: var(--kr-primary);
  border-bottom-color: var(--kr-primary);
}

@media (max-width: 720px) {
  .kr-topline__in {
    flex-wrap: wrap;
    gap: 10px;
  }

  .kr-nav__menu {
    gap: 16px;
  }
}

/* logo wordmark in topline */
.kr-topline__logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.kr-logo-word {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.kr-logo-word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--kr-primary-dark);
}

.kr-logo-word__tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3.5px;
  color: var(--kr-accent);
  margin-top: 4px;
}

/* ============ Sticky header wrapper (topline + nav scroll with page) ============ */

.kr-headwrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  box-shadow: 0 1px 0 var(--kr-border);
}

/* no-JS fallback; inline script after header refines this to exact height */
body {
  padding-top: 100px;
}

.kr-topline__tag {
  color: var(--kr-text-muted);
  font-size: 12.5px;
  border-left: 1px solid var(--kr-border);
  padding-left: 14px;
  margin-left: 2px;
}

body.admin-bar .kr-headwrap {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .kr-headwrap {
    top: 46px;
  }
}

@media (max-width: 1000px) {
  .kr-topline__tag {
    display: none;
  }
}

.kr-mainPage {
  padding-top: 16px;
}

/* ============ Electro-style mobile header (burger + icons, dropdown panels) ============ */

.kr-burger,
.kr-search-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
  color: var(--kr-primary-dark);
  line-height: 0;
}

.kr-searchdrop {
  display: none;
  background: #fff;
  border-top: 1px solid var(--kr-border);
}

.kr-searchdrop.kr-open {
  display: block;
}

.kr-searchdrop .kr-searchForm {
  max-width: 100%;
  margin: 12px 0;
}

.kr-searchdrop .kr-searchForm__field {
  padding: 12px 14px;
  font-size: 15px;
}

.kr-searchdrop .kr-searchForm .kr-btn--primary {
  padding: 12px 24px;
  font-size: 14px;
}

@media (max-width: 720px) {
  /* compact single bar: burger | logo | search/account/cart icons */
  .kr-burger,
  .kr-search-toggle {
    display: inline-flex;
  }

  .kr-topline__in {
    flex-wrap: nowrap;
    padding: 8px 12px;
    gap: 10px;
  }

  .kr-topline__logo {
    margin-right: auto;
    padding: 0;
  }

  .kr-topline__right {
    width: auto;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    padding: 0;
  }

  .kr-topline__login {
    padding: 4px;
  }

  .kr-topline__login-text {
    display: none;
  }

  .kr-topline__cart {
    margin-left: 0;
    padding: 4px;
  }

  /* nav becomes a dropdown panel behind the burger */
  .kr-nav {
    display: none;
    border-top: 1px solid var(--kr-border);
  }

  .kr-nav.kr-open {
    display: block;
  }

  .kr-nav__menu {
    flex-direction: column;
    gap: 0;
  }

  .kr-nav__menu a {
    padding: 12px 0;
    border-bottom: 0;
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  /* right icon order per user: account, cart, search */
  .kr-topline__right {
    gap: 16px;
  }

  .kr-topline__login {
    order: 1;
  }

  .kr-topline__cart {
    order: 2;
  }

  .kr-search-toggle {
    order: 3;
  }
}

/* ============ Nav dropdown: two columns (menu | categories) ============ */

.kr-nav-cat-col {
  display: none;
}

.kr-nav-col__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kr-text-muted);
  margin: 0 0 6px;
  font-weight: 600;
}

.kr-nav-cats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kr-nav-cats a {
  display: block;
  padding: 10px 0;
  color: var(--kr-primary);
  text-decoration: none;
  font-size: 13.5px;
}

@media (max-width: 720px) {
  .kr-nav-in {
    display: flex;
    gap: 26px;
    align-items: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .kr-nav-menu-col,
  .kr-nav-cat-col {
    flex: 1 1 0;
    min-width: 0;
  }

  .kr-nav-cat-col {
    display: block;
    border-left: 1px solid var(--kr-border);
    padding-left: 22px;
  }

  .kr-nav__menu {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 720px) {
  .kr-nav.kr-open {
    width: 80%;
    background: #fff;
    border-right: 1px solid var(--kr-border);
    min-height: 60vh;
  }
}

/* column titles only inside the mobile dropdown, never on desktop nav row */
.kr-nav .kr-nav-col__title {
  display: none;
}

@media (max-width: 720px) {
  .kr-nav.kr-open .kr-nav-col__title {
    display: block;
  }
}

/* Trust strip links inherit the strip's own colour until hovered. */
.kr-trust a {
  color: inherit;
  text-decoration: none;
}

.kr-trust a:hover,
.kr-trust a:focus {
  text-decoration: underline;
}
/* ============ Footer (light, storefront-style) ============ */
.site-footer {
  background: #fff !important;
  background-color: #fff !important;
  border-top: 1px solid #e5e7eb;
  padding: 0;
  margin-bottom: 0 !important;
}

.site-footer .site-below-footer-wrap,
.site-footer [data-section="section-below-footer-builder"],
.site-footer .ast-builder-grid-row-container-inner,
.site-footer .ast-builder-footer-grid-columns,
.site-footer .site-footer-below-section-1 {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  min-height: 0 !important;
  line-height: 0;
}

.kr-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px 0;
  color: #5f6b7a;
}

.kr-footer__grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(200px, 1.1fr) minmax(170px, 1fr) minmax(170px, 1fr);
  gap: 48px;
}

.kr-footer__col h4 {
  margin: 4px 0 18px;
  color: #2b2f38;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.kr-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kr-footer__col li {
  margin: 0 0 12px;
}

.kr-footer__col a {
  color: #5f6b7a;
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.kr-footer__col a:hover,
.kr-footer__col a:focus {
  color: #e0552f;
  text-decoration: underline;
}

/* Two-column link list inside the category column (desktop only) */
@media (min-width: 901px) {
  .kr-footer__col--cats ul {
    column-count: 2;
    column-gap: 26px;
  }
  .kr-footer details.kr-col > summary {
    pointer-events: none;
  }
  .kr-footer details.kr-col > summary .kr-chev {
    display: none;
  }
}

/* Accordion columns (mobile behaviour, harmless on desktop) */
.kr-footer details.kr-col > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.kr-footer details.kr-col > summary::-webkit-details-marker {
  display: none;
}

.kr-footer details.kr-col > summary h4 {
  margin: 0;
}

.kr-footer details.kr-col > summary .kr-chev {
  color: #9aa0a8;
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.kr-footer details.kr-col[open] > summary .kr-chev {
  transform: rotate(180deg);
}

/* Brand column */
.kr-footer__brand {
  color: #16181d;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1;
}

.kr-footer__brand span {
  display: block;
  margin-top: 7px;
  color: #fc7978;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 5.5px;
}

.kr-footer__tag {
  margin: 16px 0 20px;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 340px;
}

.kr-footer__contact {
  margin: 0 0 20px;
  font-size: 13px;
  color: #808285;
}

.kr-footer__contact span {
  display: block;
}

.kr-footer__mail {
  display: inline-block;
  margin-top: 5px;
  color: #16181d;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.kr-footer__mail:hover,
.kr-footer__mail:focus {
  color: #e0552f;
  text-decoration: underline;
}

.kr-footer__trust {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.kr-footer__trust li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 9px;
  font-size: 13px;
  color: #5f6b7a;
}

.kr-footer__trust svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

/* Payment method badges */
.kr-footer__pay-title {
  margin: 0 0 10px;
  color: #2b2f38;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.kr-footer__pay {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kr-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 48px;
  padding: 0 9px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.kr-pay--visa {
  color: #1a1f71;
  font-style: italic;
  font-size: 12px;
}

.kr-pay--mc i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.kr-pay--mc i:first-child {
  background: #eb001b;
}

.kr-pay--mc i:last-child {
  background: #f79e1b;
  margin-left: -5px;
  mix-blend-mode: multiply;
}

.kr-pay--amex {
  background: #2e77bc;
  border-color: #2e77bc;
  color: #fff;
}

.kr-pay--disc {
  color: #f76b1c;
}

.kr-pay--pp {
  color: #003087;
  font-style: italic;
}

.kr-pay--pp i {
  color: #009cde;
}

.kr-pay--apay {
  color: #000;
}

.kr-pay--gpay {
  color: #5f6368;
  font-weight: 600;
}

.kr-pay--gpay b {
  color: #4285f4;
  font-weight: 800;
}

/* Bottom bar */
.kr-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 48px;
  padding: 18px 0 20px;
  border-top: 1px solid #e5e7eb;
}

.kr-footer__copy {
  font-size: 12.5px;
  color: #808285;
}

.kr-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.kr-footer__legal a {
  color: #5f6b7a;
  font-size: 12.5px;
  text-decoration: none;
}

.kr-footer__legal a:hover,
.kr-footer__legal a:focus {
  color: #e0552f;
  text-decoration: underline;
}

@media (max-width: 900px) {
  /* Kill Astra's stacked top padding on product/inner pages (4em #primary
     + 3.34em woo container = a huge blank band under the fixed header) */
  .ast-separate-container #primary {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  .ast-separate-container .ast-woocommerce-container {
    padding-top: 12px !important;
  }

  /* Mobile: stacked white cards on a light grey background */
  .site-footer {
    background: #f4f5f7 !important;
    background-color: #f4f5f7 !important;
  }
  .kr-footer {
    padding-top: 28px;
  }
  .kr-footer__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .kr-footer__col--brand,
  .kr-footer details.kr-col {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
  }
  .kr-footer__col--brand {
    grid-column: 1 / -1;
    order: 9;
    padding: 20px 18px 18px;
  }
  .kr-footer details.kr-col {
    padding: 0;
    overflow: hidden;
  }
  .kr-footer details.kr-col > summary {
    padding: 16px 18px;
  }
  .kr-footer details.kr-col[open] > summary {
    border-bottom: 1px solid #f0f1f3;
  }
  .kr-footer details.kr-col > ul {
    padding: 14px 18px 16px;
  }
  .kr-footer details.kr-col li {
    margin-bottom: 11px;
  }
  .kr-footer details.kr-col li:last-child {
    margin-bottom: 0;
  }
  .kr-footer__bottom {
    margin-top: 26px;
  }
}

@media (max-width: 480px) {
  .kr-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
