/* OKW – Header theo thiết kế mới. Chỉ áp dụng khi <body> có class "okw-newhome" (trang dùng các khối okw_*). Xoá file này = header trở lại như cũ. */

/* ---------- Thanh trên cùng (hotline + liên kết nhanh) ---------- */
.okw-topbar { background: linear-gradient(90deg, #9E0C24, #C8102E); color: #fff; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 600; line-height: 1; position: relative; z-index: 30; }
.okw-topbar-in { max-width: 1200px; margin: 0 auto; padding: 0 15px; height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.okw-topbar a { color: #fff; text-decoration: none; }
.okw-topbar a:hover { color: #F1D77A; }
.okw-topbar .okw-hotline { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.okw-topbar .okw-hotline svg { width: 14px; height: 14px; fill: currentColor; }
.okw-topbar .okw-toplinks { display: flex; align-items: center; gap: 18px; white-space: nowrap; }

/* ---------- Hàng chính: nền đỏ thương hiệu ---------- */
body.okw-newhome .header-wrapper .header-bg-container,
body.okw-newhome .header-wrapper .header-bg-color { background: linear-gradient(180deg, #C8102E 0%, #A90E27 100%) !important; }
body.okw-newhome #masthead.header-main { background: transparent !important; }

/* Ô tìm kiếm dạng viên thuốc, nút kính lúp tròn nằm trong ô */
body.okw-newhome #masthead .searchform .flex-row { position: relative; align-items: center; }
body.okw-newhome #masthead .searchform input.search-field { height: 44px; border: 0; border-radius: 999px; background: #fff; box-shadow: none; margin: 0; padding: 0 54px 0 20px; font-family: 'Montserrat', sans-serif; font-size: 14px; color: #1f2937; }
body.okw-newhome #masthead .searchform input.search-field::placeholder { color: #9ca3af; }
body.okw-newhome #masthead .searchform .flex-col:last-child { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin: 0; padding: 0; }
body.okw-newhome #masthead .searchform .ux-search-submit { width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #C8102E !important; color: #fff !important; display: grid; place-items: center; box-shadow: none; }
body.okw-newhome #masthead .searchform .ux-search-submit:hover { background: #9E0C24 !important; }

/* ---------- Máy tính ---------- */
@media (min-width: 850px) {
  /* các liên kết nhỏ đã đưa lên thanh trên cùng → ở hàng chính chỉ giữ giỏ hàng */
  body.okw-newhome #masthead .header-nav-main.nav-right > li:not(.cart-item) { display: none; }
  body.okw-newhome #masthead .header-nav-main.nav-right > li.cart-item > a { color: #fff; }

  /* hàng menu: đỏ đậm, chữ trắng đậm */
  body.okw-newhome #wide-nav { background: #9E0C24 !important; border: 0 !important; box-shadow: none !important; }
  body.okw-newhome #wide-nav .header-bottom-nav { flex-wrap: nowrap; justify-content: center; }
  body.okw-newhome #wide-nav .header-nav > li { margin: 0 !important; }
  body.okw-newhome #wide-nav .header-nav > li > a { color: #fff !important; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; white-space: nowrap; padding: 12px 11px; }
  body.okw-newhome #wide-nav .header-nav > li > a:after { display: none; }
  body.okw-newhome #wide-nav .header-nav > li { flex-shrink: 0; }
  body.okw-newhome #wide-nav .header-nav > li > a { display: inline-flex; align-items: center; gap: 5px; flex-direction: row; flex-wrap: nowrap; line-height: 1.2; }
  body.okw-newhome #wide-nav .header-nav > li > a i { margin: 0; font-size: 13px; line-height: 1; }
  body.okw-newhome #wide-nav .header-nav > li > a img.ux-menu-icon { display: none; }
  body.okw-newhome #wide-nav .header-nav > li > a i,
  body.okw-newhome #wide-nav .header-nav > li > a .icon-angle-down { color: #fff !important; opacity: .85; }
  body.okw-newhome #wide-nav .header-nav > li > a:hover,
  body.okw-newhome #wide-nav .header-nav > li.active > a,
  body.okw-newhome #wide-nav .header-nav > li.current-menu-item > a { background: #C8102E; color: #fff !important; }
}

/* Màn hình trung bình: cho phép menu xuống 2 dòng thay vì tràn ra ngoài */
@media (min-width: 850px) and (max-width: 1260px) {
  body.okw-newhome #wide-nav .header-bottom-nav { flex-wrap: wrap; }
  body.okw-newhome #wide-nav .header-nav > li { flex-shrink: 1; }
  body.okw-newhome #wide-nav .header-nav > li > a { padding: 10px 9px; }
}

/* ---------- Điện thoại ---------- */
@media (max-width: 849px) {
  .okw-topbar-in { height: 32px; }
  .okw-topbar .okw-toplinks a.okw-hide-m { display: none; }

  body.okw-newhome #masthead.header-main,
  body.okw-newhome #masthead .header-inner { height: auto !important; }
  body.okw-newhome #masthead .header-inner { position: relative; flex-wrap: wrap; align-items: center; padding: 10px 14px 0; }

  /* logo ở giữa */
  body.okw-newhome #masthead #logo { order: 1; margin: 0 auto; }

  /* nút menu (gạch ngang) ở bên trái, bỏ chữ MENU */
  body.okw-newhome #masthead .header-inner > .flex-col.show-for-medium.flex-right { position: absolute; left: 6px; top: 8px; margin: 0; padding: 0; }
  body.okw-newhome #masthead .nav-icon .menu-title,
  body.okw-newhome #masthead .nav-icon a > span { display: none !important; }
  body.okw-newhome #masthead .nav-icon i { font-size: 28px; }
  body.okw-newhome #masthead .nav-icon a { color: #fff; }

  /* ô tìm kiếm hiển thị thành một hàng riêng bên dưới (thay vì ẩn trong nút kính lúp) */
  body.okw-newhome #masthead .header-inner > .flex-col.show-for-medium.flex-left,
  body.okw-newhome #masthead .header-inner > .flex-col.show-for-medium.flex-left > ul.mobile-nav { display: contents; }
  body.okw-newhome #masthead .mobile-nav > li.header-search { order: 3; flex: 0 0 100%; padding: 10px 0 12px; margin: 0; }
  body.okw-newhome #masthead .mobile-nav > li.header-search > .header-button { display: none; }
  body.okw-newhome #masthead .mobile-nav > li.header-search > .nav-dropdown {
    display: block !important; position: static !important; opacity: 1 !important; visibility: visible !important; transform: none !important;
    width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  body.okw-newhome #masthead .mobile-nav > li.header-search > .nav-dropdown::before,
  body.okw-newhome #masthead .mobile-nav > li.header-search > .nav-dropdown::after { display: none; }
  body.okw-newhome #masthead .mobile-nav > li.header-search .header-search-form,
  body.okw-newhome #masthead .mobile-nav > li.header-search .header-search-form-wrapper { padding: 0; margin: 0; width: 100%; }
  /* khung chứa ô tìm kiếm của Flatsome có chiều cao 0 (kiểu menu xổ xuống) → phải mở ra để nền đỏ phủ trọn ô tìm kiếm */
  body.okw-newhome #masthead .mobile-nav > li.header-search > .nav-dropdown { height: auto !important; max-height: none !important; overflow: visible !important; }
  /* ô tìm kiếm giống ảnh mẫu: kính lúp xám bên trái, bỏ nút đỏ bên phải */
  body.okw-newhome #masthead .mobile-nav > li.header-search .searchform .flex-col:last-child { display: none; }
  body.okw-newhome #masthead .mobile-nav > li.header-search .searchform input.search-field {
    height: 48px; border-radius: 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); padding: 0 16px 0 46px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center / 20px;
  }
}

/* ===== Nút tìm kiếm nổi bật + hiệu ứng ===== */
@keyframes okw-spin { to { transform: rotate(360deg); } }
@keyframes okw-pulse { 0% { box-shadow: 0 0 0 0 rgba(241,215,122,.75); } 70% { box-shadow: 0 0 0 12px rgba(241,215,122,0); } 100% { box-shadow: 0 0 0 0 rgba(241,215,122,0); } }
@keyframes okw-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* viền vàng phát sáng khi đang gõ vào ô tìm kiếm */
body.okw-newhome #masthead .searchform input.search-field { transition: box-shadow .25s ease; }
body.okw-newhome #masthead .searchform input.search-field:focus { box-shadow: 0 0 0 4px rgba(241, 215, 122, .65), 0 6px 18px rgba(0, 0, 0, .18) !important; }
/* bấm tìm khi chưa nhập: ô rung nhẹ */
body.okw-newhome #masthead .searchform.okw-shake { animation: okw-shake .45s ease; }

@media (min-width: 850px) {
  /* nút tìm kiếm tách riêng, màu TRẮNG, biểu tượng đỏ → nổi bật trên nền đỏ */
  body.okw-newhome #masthead .searchform .flex-row { flex-wrap: nowrap; gap: 10px; align-items: center; }
  body.okw-newhome #masthead .searchform .flex-col:last-child { position: static !important; transform: none !important; flex: 0 0 auto; margin: 0; padding: 0; }
  body.okw-newhome #masthead .searchform input.search-field { height: 46px; padding: 0 22px; }
  body.okw-newhome #masthead .searchform .ux-search-submit {
    width: 46px; height: 46px; border-radius: 50% !important; background: #fff !important; color: #C8102E !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25); display: grid; place-items: center; position: relative;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }
  body.okw-newhome #masthead .searchform .ux-search-submit i { font-size: 18px; color: #C8102E !important; line-height: 1; transition: transform .25s ease; }
  /* rê chuột: nút nhún lên, kính lúp nghiêng, nền vàng nhạt */
  body.okw-newhome #masthead .searchform .ux-search-submit:hover { background: #FFF1BF !important; transform: translateY(-2px) scale(1.08); box-shadow: 0 8px 20px rgba(0, 0, 0, .3), 0 0 0 4px rgba(241, 215, 122, .5); }
  body.okw-newhome #masthead .searchform .ux-search-submit:hover i { transform: rotate(-12deg) scale(1.1); }
  body.okw-newhome #masthead .searchform .ux-search-submit:active { transform: scale(.94); }
  /* đang gõ: nút nhấp nháy nhẹ để gợi ý bấm tìm */
  body.okw-newhome #masthead .searchform:focus-within .ux-search-submit { animation: okw-pulse 1.4s ease-out infinite; }
}

/* đang tìm: kính lúp thay bằng vòng quay */
body.okw-newhome #masthead .searchform.okw-searching .ux-search-submit i { opacity: 0; }
body.okw-newhome #masthead .searchform.okw-searching .ux-search-submit::after {
  content: ""; position: absolute; width: 20px; height: 20px; left: 50%; top: 50%; margin: -10px 0 0 -10px;
  border: 3px solid rgba(200, 16, 46, .25); border-top-color: #C8102E; border-radius: 50%; animation: okw-spin .7s linear infinite;
}
body.okw-newhome #masthead .searchform.okw-searching input.search-field { opacity: .8; }
