/* ── Search Bar (Amazon-style) ───────────────────────────────────────── */
.trw-search-bar {
  background: #fafafa;
  padding: 8px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 3px solid var(--primary-color);
}

.trw-search-form {
  display: flex;
  max-width: 860px;
  margin: 0 auto;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.trw-search-form:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(253,183,27,.25);
}

.trw-search-form__cat {
  position: relative;
  border-right: 2px solid var(--primary-color);
  flex-shrink: 0;
  background: var(--primary-color);
}

.trw-search-form__cat select {
  height: 100%;
  padding: 0 32px 0 12px;
  border: none;
  background: var(--primary-color);
  font-size: 13px;
  color: #000;
  cursor: pointer;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  min-width: 140px;
}

.trw-search-form__cat select:focus {
  outline: none;
  background: var(--primary-hover);
}

.trw-search-form__caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 10px;
  color: #000;
}

.trw-search-form__input {
  flex: 1;
  padding: 11px 14px;
  border: none;
  font-size: 15px;
  color: #000 !important;
  background: transparent;
}

.trw-search-form__input:focus {
  outline: none;
}

.trw-search-form__input::placeholder {
  color: #666;
}

/* Force color on WooCommerce autocomplete/history */
.trw-search-form__input:-webkit-autofill {
  -webkit-text-fill-color: #000 !important;
}

.trw-search-form__btn {
  padding: 0 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.trw-search-form__btn img {
  display: block;
  width: 20px;
  height: 20px;
  filter: brightness(0);
}

.trw-search-form__btn:hover {
  background: var(--primary-color);
}

.trw-search-form__btn:hover img {
  filter: brightness(0);
}

/* AJAX results — dropdown overlay, does NOT push content down */
.trw-search-bar {
  position: relative; /* anchor for the absolute dropdown */
}

.trw-search-results {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 860px;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--primary-color);
  border-top-width: 3px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  overflow: hidden;
  margin: 0;
}

.trw-search-results[hidden] {
  display: none;
}

.trw-search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid #e0e0e0;
  transition: var(--transition);
}

.trw-search-result-item:last-child {
  border-bottom: none;
}

.trw-search-result-item:hover {
  background: var(--primary-color);
}

.trw-search-result-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--primary-color);
}

.trw-search-result-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.trw-search-result-item__title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
}

.trw-search-result-item__price {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
  white-space: nowrap;
}

/* WooCommerce price amount styling */
.trw-search-result-item__price .woocommerce-Price-amount {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.trw-search-result-item__price .woocommerce-Price-amount bdi,
.trw-search-result-item__price .woocommerce-Price-amount bdo {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

/* Sale price styling */
.trw-search-result-item__price del .woocommerce-Price-amount bdi,
.trw-search-result-item__price ins .woocommerce-Price-amount bdi {
  font-size: 14px;
}

.trw-search-result-item__price del .woocommerce-Price-amount bdi {
  text-decoration: line-through;
  color: #999;
  font-weight: 400;
}

.trw-search-result-item__price ins .woocommerce-Price-amount bdi {
  color: #000;
  font-weight: 700;
  text-decoration: none;
}

.trw-search-results__footer {
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  background: var(--primary-color);
}

.trw-search-results__footer a {
  color: #000;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 4px;
  transition: var(--transition);
}

.trw-search-results__footer a:hover {
  background: #000;
  color: var(--primary-color);
}

.trw-search-results__msg {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Mobile Header Top - More visible ───────────────────────────────── */
@media (max-width: 768px) {
  .trw-main-header .trw-top-bar {
    padding: 6px 0 !important;
    min-height: 28px;
  }

  button#trw-hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    z-index: 1000 !important;
    position: relative !important;
    color: #000 !important;
    background: transparent !important;
  }

  button#trw-hamburger svg {
    width: 32px !important;
    height: 32px !important;
    color: #000 !important;
    fill: currentColor !important;
  }

  .trw-top-bar__item img {
    width: 20px !important;
    height: 20px !important;
  }

  .trw-top-bar__item,
  .trw-top-bar__item > a {
    font-weight: 700 !important;
  }
}

@media (max-width: 480px) {
  .trw-main-header .trw-top-bar {
    padding: 5px 0 !important;
    min-height: 26px;
  }

  button#trw-hamburger {
    width: 44px !important;
    height: 44px !important;
  }

  button#trw-hamburger svg {
    width: 28px !important;
    height: 28px !important;
  }

  .trw-top-bar__item img {
    width: 18px !important;
    height: 18px !important;
  }
}

/* ── Responsive: Search ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .trw-search-bar { padding: 5px 0; }

  /* Single-line horizontal on mobile — NO stacking */
  .trw-search-form {
    flex-direction: row;
    border-radius: 4px;
    height: 36px;
  }

  /* Hide category dropdown on mobile to save space */
  .trw-search-form__cat { display: none; }

  .trw-search-form__input {
    padding: 0 10px;
    font-size: 13px;
    height: 100%;
  }

  .trw-search-form__btn {
    padding: 0 12px;
    height: 100%;
    flex-shrink: 0;
  }

  .trw-search-form__btn img {
    width: 16px;
    height: 16px;
  }

  /* AJAX results compact */
  .trw-search-results {
    left: 0;
    transform: none;
    width: calc(100% - 0px);
    max-width: 100%;
    margin-top: 0;
  }
  .trw-search-result-item { padding: 7px 10px; gap: 8px; }
  .trw-search-result-item img { width: 34px; height: 34px; }
  .trw-search-result-item__info { gap: 6px; }
  .trw-search-result-item__title { font-size: 12px; }
  .trw-search-result-item__price,
  .trw-search-result-item__price .woocommerce-Price-amount,
  .trw-search-result-item__price .woocommerce-Price-amount bdi { font-size: 12px; }
}

@media (max-width: 480px) {
  .trw-search-bar { padding: 4px 0; }
  .trw-search-form { height: 34px; }
  .trw-search-form__input { font-size: 12px; padding: 0 8px; }
  .trw-search-form__btn { padding: 0 10px; }
  .trw-search-form__btn img { width: 14px; height: 14px; }
}

/* ── Cart Modal - Nested selectors to prevent override ──────────────── */
.trw-cart-modal .trw-cart-modal__title {
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  line-height: 1.3 !important;
}

.trw-cart-modal .trw-cart-modal__item-remove {
  background: transparent !important;
  border: 1px solid #dc3545 !important;
  cursor: pointer !important;
  color: #dc3545 !important;
  padding: 3px 6px !important;
  font-size: 10px !important;
  border-radius: 3px !important;
  transition: var(--transition) !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
  text-decoration: none !important;
}

.trw-cart-modal .trw-cart-modal__item-remove .trw-remove-icon {
  display: inline-block !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-style: normal !important;
}

.trw-cart-modal .trw-cart-modal__item-remove:hover {
  background: #dc3545 !important;
  color: #fff !important;
}

.trw-cart-modal .trw-cart-modal__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  border-bottom: 2px solid #000 !important;
  background: var(--primary-color) !important;
  flex-shrink: 0 !important;
}

.trw-cart-modal .trw-cart-modal__close {
  background: transparent !important;
  border: 1px solid #dc3545 !important;
  cursor: pointer !important;
  color: #dc3545 !important;
  padding: 3px 7px !important;
  border-radius: 3px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  transition: var(--transition) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  text-decoration: none !important;
}

.trw-cart-modal .trw-cart-modal__close .trw-remove-icon {
  display: inline-block !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-style: normal !important;
}

.trw-cart-modal .trw-cart-modal__close:hover {
  background: #dc3545 !important;
  color: #fff !important;
}

/* Cart modal item info - flex row layout */
.trw-cart-modal .trw-cart-modal__item-info {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

/* ── Header Icons - Larger icons, smaller labels ───────────────────── */
.trw-main-header .trw-icon-btn.trw-cart-btn img {
  width: 24px !important;
  height: 24px !important;
}

.trw-main-header .trw-icon-btn.trw-cart-btn .trw-cart-badge {
  min-width: 16px !important;
  height: 16px !important;
  font-size: 10px !important;
}

.trw-main-header .trw-icon-btn:not(.trw-cart-btn) img {
  width: 24px !important;
  height: 24px !important;
}

.trw-main-header .trw-account-btn .trw-account-icon {
  width: 24px !important;
  height: 24px !important;
}

.trw-main-header .trw-account-btn .trw-account-label {
  font-size: 12px !important;
}

.trw-main-header .trw-search-toggle img {
  width: 24px !important;
  height: 24px !important;
}

/* ── Mobile Menu - Nested selectors to prevent override ─────────────── */
.trw-mobile-menu .trw-mobile-menu__close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  background: transparent !important;
  border: 1px solid #dc3545 !important;
  cursor: pointer !important;
  color: #dc3545 !important;
  padding: 4px 8px !important;
  border-radius: 3px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  transition: var(--transition) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

.trw-mobile-menu .trw-mobile-menu__close:hover {
  background: #dc3545 !important;
  color: #fff !important;
}

.trw-mobile-menu .trw-mobile-menu__logo {
  padding: 16px 20px 12px !important;
  text-align: center !important;
  border-bottom: 2px solid #000 !important;
  background: var(--primary-color) !important;
}

.trw-mobile-menu .trw-mobile-menu__logo a {
  display: inline-block !important;
}

.trw-mobile-menu .trw-mobile-menu__logo img {
  display: block !important;
  width: 120px !important;
  height: auto !important;
  margin: 0 auto !important;
}
