/* Khmer Auto Market selectable desktop/tablet header styles — 2026-10-04.
   Scope is intentionally limited to header presentation. Existing mobile header stays untouched. */
.kam-desktop-top{display:none}

@media(min-width:768px){
  .kam-legacy-top{display:none!important}
  .kam-desktop-top{display:block!important;position:sticky!important;top:0!important;z-index:1200!important;width:100%!important;background:#fff!important;border:0!important;box-shadow:0 3px 14px rgba(22,47,78,.07)!important}
  .kam-desktop-header .wrap{max-width:1440px!important;padding-left:22px!important;padding-right:22px!important}
  .kam-header-main{background:#fff;border-bottom:1px solid #e4eaf1}
  .kam-header-row{height:76px;display:flex;align-items:center;gap:12px;min-width:0}
  .kam-tablet-menu{display:none;width:39px;height:39px;min-width:39px;padding:0;border:0;border-radius:10px;background:#eef5fd;color:#103f78;font-size:21px;cursor:pointer}
  .kam-new-brand{display:flex;align-items:center;flex:0 0 auto;min-width:0}
  .kam-new-brand img{display:block;width:auto;height:45px;max-width:220px;object-fit:contain}

  .kam-desktop-language{position:relative;flex:0 0 auto}
  .kam-new-language-button{height:43px;min-width:50px;padding:5px 8px;border:0;background:transparent;border-radius:10px;display:flex;align-items:center;gap:5px;cursor:pointer;color:#103f78}
  .kam-new-language-button:hover,.kam-desktop-language.open .kam-new-language-button{background:#edf5ff}
  .kam-new-language-flag img,.kam-new-language-menu img{width:29px;height:29px;display:block;border-radius:50%;object-fit:cover;box-shadow:0 0 0 1px rgba(20,40,65,.12)}
  .kam-new-language-chevron{font-size:15px}
  .kam-new-language-menu{display:none;position:absolute;left:0;top:calc(100% + 9px);width:205px;padding:7px;background:#fff;border:1px solid #dce5ef;border-radius:13px;box-shadow:0 16px 36px rgba(15,35,65,.18);z-index:1300}
  .kam-desktop-language.open .kam-new-language-menu{display:block}
  .kam-new-language-menu button{width:100%;height:46px;border:0;border-radius:9px;background:transparent;color:#1b2e45;display:flex;align-items:center;gap:12px;padding:0 11px;font:inherit;font-size:14px;cursor:pointer;text-align:left}
  .kam-new-language-menu button:hover{background:#eef7ff;color:#126dcc}
  .kam-new-language-menu img{width:26px;height:26px}

  .kam-header-category{position:relative;flex:0 0 auto}
  .kam-category-trigger{height:43px;min-width:152px;padding:0 13px;border:1px solid #d4dde8;border-radius:7px;background:#fff;color:#1c2a3d;display:flex;align-items:center;justify-content:space-between;gap:8px;font:inherit;font-size:14px;cursor:pointer;white-space:nowrap}
  .kam-category-trigger:hover,.kam-header-category.open .kam-category-trigger{border-color:#87b6e5;box-shadow:0 0 0 3px rgba(27,96,173,.08)}
  .kam-category-trigger-icon{display:none;color:#1B60AD;font-size:17px}
  .kam-category-caret{font-size:12px;color:#6b7a8d}
  .kam-category-menu{display:none;position:absolute;left:0;top:calc(100% + 8px);width:335px;max-height:min(690px,calc(100vh - 135px));overflow-y:auto;padding:7px 7px 10px;background:#fff;border:1px solid #d9e2ec;border-radius:10px;box-shadow:0 18px 42px rgba(17,39,67,.20);z-index:1350;scrollbar-width:thin}
  .kam-header-category.open .kam-category-menu{display:block}
  .kam-category-menu a,.kam-category-group-title{min-height:45px;padding:8px 12px;display:flex;align-items:center;gap:12px;border-radius:8px;color:#202c3d;font-size:14px;text-decoration:none}
  .kam-category-menu a:hover{background:#edf6ff;color:#0f66b9}
  .kam-category-group-title{margin-top:2px;font-size:15px;font-weight:800;background:#fafbfd}
  .kam-category-all{font-size:15px!important}
  .kam-cat-icon{width:26px;min-width:26px;text-align:center;font-size:20px;line-height:1}
  .kam-category-divider{height:1px;background:#e5eaf0;margin:7px 9px}

  .kam-header-search{height:43px;display:flex;align-items:center;flex:1 1 360px;min-width:150px;max-width:620px;border:1px solid #d4dde8;border-radius:7px;background:#fff;overflow:hidden}
  .kam-header-search:focus-within{border-color:#79aadd;box-shadow:0 0 0 3px rgba(27,96,173,.08)}
  .kam-header-search input{width:100%;min-width:0;height:100%;padding:0 13px;border:0!important;outline:0!important;background:transparent!important;color:#1b2b40!important;font:inherit!important;font-size:14px!important;box-shadow:none!important}
  .kam-header-search input::placeholder{color:#a2abb7}
  .kam-header-search button{width:47px;height:100%;flex:0 0 47px;border:0;background:transparent;color:#52657c;font-size:27px;line-height:1;cursor:pointer}
  .kam-header-search button:hover{color:#1B60AD;background:#f5f9fd}

  .kam-new-theme{width:65px;height:39px;min-width:65px;border:0;border-radius:999px;background:#e8eef4;box-shadow:inset 0 0 0 1px #d9e2eb,0 3px 9px rgba(25,50,75,.12);padding:3px 6px;display:flex;align-items:center;justify-content:space-between;gap:3px;cursor:pointer;color:#fff}
  .kam-new-theme span{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:13px;line-height:1}
  .kam-new-theme-sun{background:#fff;color:#ff641d!important;box-shadow:0 2px 7px rgba(0,0,0,.12)}
  .kam-new-theme-moon{color:#fff!important;font-size:15px!important}
  .kam-new-theme.is-dark{background:#263a4d}
  .kam-new-theme.is-dark .kam-new-theme-sun{background:transparent!important;color:#b7c4cf!important;box-shadow:none!important}
  .kam-new-theme.is-dark .kam-new-theme-moon{background:#fff;color:#1B60AD!important;box-shadow:0 2px 7px rgba(0,0,0,.18)}

  .kam-new-header-account{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-width:0;white-space:nowrap}
  .kam-header-signin,.kam-header-dashboard{font-weight:750;color:#26364c;font-size:14px;padding:9px 3px}
  .kam-header-signin:hover,.kam-header-dashboard:hover{color:#1B60AD}
  .kam-header-register{display:inline-flex;align-items:center;justify-content:center;min-height:43px;padding:0 17px;border-radius:10px;background:linear-gradient(135deg,#1B60AD,#2979d2);color:#fff!important;font-weight:800;box-shadow:0 6px 15px rgba(27,96,173,.18)}
  .kam-header-register:hover{transform:translateY(-1px);box-shadow:0 9px 20px rgba(27,96,173,.23)}
  .kam-header-return{font-size:11px;font-weight:800;color:#fff;background:#D6464D;border-radius:8px;padding:8px 9px}
  .kam-header-profile-wrap{min-width:0;max-width:285px}
  .kam-header-user-chip{min-width:0;max-width:285px;padding:3px 2px!important;gap:7px!important;color:#1c2b3e}
  .kam-header-user-chip .nav-company-logo{width:37px;height:37px;min-width:37px;border-radius:50%;object-fit:cover;border:1px solid #d9e2ec;background:#fff}
  .kam-header-user-chip .avatar{width:37px;height:37px;min-width:37px}
  .kam-header-user-copy{max-width:210px;min-width:0}
  .kam-header-user-copy b,.kam-header-user-copy small{display:block;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .kam-header-user-copy b{font-size:13px}
  .kam-header-user-copy small{font-size:10px;color:#718096}
  .kam-header-profile-wrap .profile-dropdown{top:calc(100% + 13px)}

  .kam-header-topbar{height:34px;background:#082d59;color:#fff}
  .kam-header-topbar-inner{height:34px;display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:11.5px}
  .kam-topbar-contact,.kam-topbar-links{display:flex;align-items:center;gap:19px;min-width:0}
  .kam-topbar-contact span{white-space:nowrap;color:#f4f8fc}
  .kam-topbar-links{margin-left:auto;gap:16px}
  .kam-topbar-links a{color:#eaf2fb;white-space:nowrap}
  .kam-topbar-links a:hover{color:#fff;text-decoration:underline}
  .kam-topbar-links .kam-social{width:21px;height:21px;border-radius:50%;display:grid;place-items:center;background:#126dcc;color:#fff!important;text-decoration:none!important;font-size:10px;font-weight:900}
  .kam-topbar-links .kam-social:nth-last-child(3){background:#e11}
  .kam-topbar-links .kam-social:nth-last-child(2){background:#111}
  .kam-topbar-links .kam-social:nth-last-child(1){background:#179bd7}

  /* Keep authenticated dashboard sidebars aligned below the selected desktop header. */
  body.kam-header-style1 .app-shell{min-height:calc(100vh - 76px)}
  body.kam-header-style1 .sidebar{top:76px;height:calc(100vh - 76px)}
  body.kam-header-style4 .app-shell{min-height:calc(100vh - 110px)}
  body.kam-header-style4 .sidebar{top:110px;height:calc(100vh - 110px)}
  body.business-persistent-sidebar.kam-header-style1 .business-persistent-sidebar-wrap{top:76px!important}
  body.business-persistent-sidebar.kam-header-style1 .business-persistent-sidebar-wrap .business-sidebar{min-height:calc(100vh - 76px)!important}
  body.business-persistent-sidebar.kam-header-style4 .business-persistent-sidebar-wrap{top:110px!important}
  body.business-persistent-sidebar.kam-header-style4 .business-persistent-sidebar-wrap .business-sidebar{min-height:calc(100vh - 110px)!important}

  html[data-theme="dark"] .kam-desktop-top,html[data-theme="dark"] .kam-header-main{background:#111a23!important;border-color:#2f4150!important}
  html[data-theme="dark"] .kam-category-trigger,html[data-theme="dark"] .kam-header-search,html[data-theme="dark"] .kam-category-menu,html[data-theme="dark"] .kam-new-language-menu{background:#151e27!important;border-color:#344758!important;color:#edf4fa!important}
  html[data-theme="dark"] .kam-header-search input{color:#edf4fa!important}
  html[data-theme="dark"] .kam-category-menu a,html[data-theme="dark"] .kam-category-group-title,html[data-theme="dark"] .kam-new-language-menu button,html[data-theme="dark"] .kam-header-signin,html[data-theme="dark"] .kam-header-dashboard,html[data-theme="dark"] .kam-header-user-chip{color:#e7eef5!important}
  html[data-theme="dark"] .kam-category-group-title{background:#101922!important}
  html[data-theme="dark"] .kam-category-menu a:hover,html[data-theme="dark"] .kam-new-language-menu button:hover{background:#1c3143!important;color:#fff!important}
  html[data-theme="dark"] .kam-category-divider{background:#304251}
  html[data-theme="dark"] .kam-new-language-button{color:#edf4fa}
}

/* Tablet: selected Style 1 / Style 4 remains active, but compresses without overlap. */
@media(min-width:768px) and (max-width:1023px){
  .kam-desktop-header .wrap{padding-left:12px!important;padding-right:12px!important}
  .kam-header-row{height:70px;gap:7px}
  .kam-tablet-menu{display:grid;place-items:center}
  .kam-new-brand img{height:38px;max-width:160px}
  .kam-new-language-button{height:39px;min-width:43px;padding:4px 5px}
  .kam-new-language-flag img{width:27px;height:27px}
  .kam-category-trigger{height:39px;min-width:45px;width:45px;padding:0;justify-content:center}
  .kam-category-trigger-icon{display:inline}
  .kam-category-trigger-text,.kam-category-caret{display:none}
  .kam-category-menu{width:320px;max-height:calc(100vh - 125px)}
  .kam-header-search{height:39px;flex-basis:210px;min-width:120px}
  .kam-header-search input{font-size:12.5px!important;padding:0 9px}
  .kam-header-search button{width:40px;flex-basis:40px;font-size:24px}
  .kam-new-theme{width:48px;min-width:48px;height:36px;padding:3px 4px}
  .kam-new-theme span{width:22px;height:22px;font-size:11px}
  .kam-header-dashboard{font-size:12px;padding-left:0;padding-right:0}
  .kam-header-register{min-height:39px;padding:0 11px;font-size:12px}
  .kam-header-signin{font-size:12px}
  .kam-header-profile-wrap{max-width:48px}
  .kam-header-user-chip{max-width:48px}
  .kam-header-user-copy,.kam-header-user-chip .menu-caret{display:none!important}
  .kam-header-return{display:none}
  .kam-header-profile-wrap .profile-dropdown{right:0;width:290px}
  .kam-header-topbar{height:31px}
  .kam-header-topbar-inner{height:31px;font-size:10px;gap:8px}
  .kam-topbar-contact{gap:10px;overflow:hidden}
  .kam-topbar-contact span:nth-child(2){display:none}
  .kam-topbar-links{gap:9px}
  .kam-topbar-links>a:not(.kam-social){display:none}
  .kam-topbar-links .kam-social{width:19px;height:19px}
  body.kam-header-style1 .app-shell{min-height:calc(100vh - 70px)}
  body.kam-header-style1 .sidebar{top:70px;height:calc(100vh - 70px)}
  body.kam-header-style4 .app-shell{min-height:calc(100vh - 101px)}
  body.kam-header-style4 .sidebar{top:101px;height:calc(100vh - 101px)}
  body.business-persistent-sidebar.kam-header-style1 .business-persistent-sidebar-wrap{top:70px!important}
  body.business-persistent-sidebar.kam-header-style4 .business-persistent-sidebar-wrap{top:101px!important}
}

@media(min-width:768px) and (max-width:880px){
  .kam-new-brand img{max-width:132px;height:34px}
  .kam-header-signin{display:none}
  .kam-header-dashboard{font-size:0;width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:#edf5ff;color:#1B60AD}
  .kam-header-dashboard:before{content:'▦';font-size:18px}
  .kam-new-header-account{gap:6px}
  .kam-header-search input::placeholder{font-size:11px}
}

/* Mobile remains the pre-existing header. No new desktop/tablet elements appear. */
@media(max-width:767px){
  .kam-desktop-top{display:none!important}
  .kam-legacy-top{display:block!important}
}

/* 2026-10-04 FINAL strict desktop header reference.
   Scope: ONLY desktop top bar + white navigation header. Homepage hero/search/cards unchanged. */
@media(min-width:1024px){
  .kam-desktop-top{box-shadow:none!important}
  .kam-desktop-header .wrap{max-width:1220px!important;padding-left:10px!important;padding-right:10px!important}

  .kam-header-topbar,.kam-header-topbar-inner{height:30px!important;min-height:30px!important}
  .kam-header-topbar-inner{font-size:10px!important;gap:14px!important}
  .kam-topbar-contact{gap:16px!important}
  .kam-topbar-links{gap:12px!important}
  .kam-topbar-links .kam-social{width:20px!important;height:20px!important;font-size:10px!important}

  .kam-header-main{border-bottom:0!important}
  .kam-header-row{height:62px!important;min-height:62px!important;max-height:62px!important;gap:10px!important;padding-top:0!important;padding-bottom:0!important}
  .kam-new-brand img{height:34px!important;max-width:186px!important}

  .kam-new-language-button{height:40px!important;min-width:46px!important;padding:0 5px!important}
  .kam-new-language-flag img{width:28px!important;height:28px!important}

  .kam-category-trigger{height:42px!important;min-width:154px!important;padding:0 13px!important;font-size:13px!important;border-radius:8px!important}
  .kam-header-search{height:42px!important;flex:1 1 365px!important;min-width:250px!important;max-width:395px!important;border-radius:8px!important}
  .kam-header-search input{font-size:13px!important;padding:0 14px!important}
  .kam-header-search button{width:44px!important;flex-basis:44px!important;font-size:24px!important}

  .kam-new-theme{width:60px!important;min-width:60px!important;height:38px!important;padding:3px 5px!important}
  .kam-new-theme span{width:24px!important;height:24px!important;font-size:12px!important}

  .kam-new-header-account{gap:12px!important}
  .kam-header-signin,.kam-header-dashboard{font-size:13px!important;padding:0 2px!important}
  .kam-header-register{min-height:38px!important;height:38px!important;padding:0 14px!important;font-size:12px!important;border-radius:9px!important}
  .kam-header-profile-wrap{max-width:220px!important}
  .kam-header-user-chip{max-width:220px!important;min-height:40px!important;padding:0!important;gap:7px!important}
  .kam-header-user-chip .nav-company-logo,.kam-header-user-chip .avatar{width:34px!important;height:34px!important;min-width:34px!important}
  .kam-header-user-copy{max-width:160px!important}
  .kam-header-user-copy b,.kam-header-user-copy small{max-width:160px!important}
  .kam-header-user-copy b{font-size:12px!important}
  .kam-header-user-copy small{font-size:9px!important}
  .kam-header-profile-wrap .profile-dropdown{top:calc(100% + 8px)!important}

  body.kam-header-style1 .app-shell{min-height:calc(100vh - 62px)!important}
  body.kam-header-style1 .sidebar{top:62px!important;height:calc(100vh - 62px)!important}
  body.kam-header-style4 .app-shell{min-height:calc(100vh - 92px)!important}
  body.kam-header-style4 .sidebar{top:92px!important;height:calc(100vh - 92px)!important}
  body.business-persistent-sidebar.kam-header-style1 .business-persistent-sidebar-wrap{top:62px!important}
  body.business-persistent-sidebar.kam-header-style1 .business-persistent-sidebar-wrap .business-sidebar{min-height:calc(100vh - 62px)!important}
  body.business-persistent-sidebar.kam-header-style4 .business-persistent-sidebar-wrap{top:92px!important}
  body.business-persistent-sidebar.kam-header-style4 .business-persistent-sidebar-wrap .business-sidebar{min-height:calc(100vh - 92px)!important}
}

/* 2026-10-04 RIGHT-SIDE ONLY alignment fix.
   User-approved scope: keep top bar, logo, flag, categories, header height,
   hero and all lower content unchanged. Only let the desktop header search
   grow into the unused space so theme + Sign In/Register or Dashboard/User
   move to the right edge of the existing header container. */
@media(min-width:1024px){
  .kam-header-search{
    flex:1 1 430px!important;
    min-width:300px!important;
    max-width:none!important;
  }
  .kam-new-theme{flex:0 0 60px!important}
  .kam-new-header-account{flex:0 0 auto!important;margin-left:0!important}
}

/* Mobile browser wordmark sizing only. Desktop and app layouts unchanged. */
@media (max-width:600px) {
  .kam-legacy-top .nav .kam-site-brand {
    display:flex!important;align-items:center!important;flex:0 1 auto!important;
    min-width:0!important;max-width:calc(100% - 146px)!important;
    margin-right:auto!important;
  }
  .kam-legacy-top .nav .kam-site-brand picture {
    display:block!important;width:100%!important;min-width:0!important;
  }
  .kam-legacy-top .nav .kam-site-brand img {
    display:block!important;width:clamp(116px,38vw,162px)!important;
    max-width:100%!important;height:46px!important;
    object-fit:contain!important;object-position:left center!important;
  }
}
