/* TarkMart — header search, cart drawer, free-delivery bar, partner note, rotating hero. */

/* ---- Header search ---- */
.tm-search { position: relative; display: flex; align-items: center; }
.tm-search input[type="search"] {
	width: 100%; height: 44px; box-sizing: border-box; padding: 0 16px 0 42px;
	border: 1.5px solid #E2DFDA; border-radius: 999px; background: #fff;
	font: inherit; font-size: 15px; color: var(--tm-ink); -webkit-appearance: none; appearance: none;
}
.tm-search input[type="search"]:focus { outline: 3px solid var(--tm-teal); outline-offset: 1px; border-color: var(--tm-navy); }
.tm-search-ico { position: absolute; left: 15px; color: #4b5563; pointer-events: none; }
.tm-header .tm-search.desk { flex: 0 1 240px; min-width: 150px; margin: 0 12px; }
.tm-header .tm-search-toggle { display: none; }
.tm-search-row { padding: 0 0 12px; }
.tm-search-row[hidden] { display: none; }
@media (max-width: 1099px) {
	.tm-header .tm-search.desk { display: none; }
	.tm-header .tm-search-toggle { display: grid; width: 44px; height: 44px; }
}
@media (min-width: 1100px) { .tm-search-row { display: none !important; } }

/* ---- Free-delivery bar ---- */
.tm-freebar[hidden] { display: none; }
.tm-freebar { margin-top: 14px; }
.tm-freebar-in { background: #fff; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tm-freebar-msg { font-size: 14px; font-weight: 700; color: var(--tm-navy); }
.tm-freebar-track { display: block; height: 8px; border-radius: 999px; background: #EFEDE9; overflow: hidden; }
.tm-freebar-track > span { display: block; height: 8px; border-radius: 999px; background: #0B7380; transition: width .35s ease; }
.tm-freebar-in.is-free { background: var(--tm-mint-soft); }
.tm-freebar-cart { margin: 0 0 18px; }
.tm-freebar-drawer { margin: 0 20px; }
.tm-freebar-drawer .tm-freebar-in { background: var(--tm-teal-soft); }
.tm-freebar-drawer .tm-freebar-in.is-free { background: var(--tm-mint-soft); }
.tm-freebar-drawer .tm-freebar-track { background: rgba(255, 255, 255, .85); }

/* ---- Cart drawer ---- */
.tm-drawer[hidden] { display: none; }
.tm-drawer { position: fixed; inset: 0; z-index: 100000; }
.tm-drawer-veil { position: absolute; inset: 0; background: rgba(11, 31, 77, .4); opacity: 0; transition: opacity .2s ease; }
.tm-drawer-panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
	background: var(--tm-cream); box-shadow: -20px 0 50px rgba(11, 31, 77, .25);
	display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; outline: none;
}
.tm-drawer.is-open .tm-drawer-veil { opacity: 1; }
.tm-drawer.is-open .tm-drawer-panel { transform: none; }
.tm-drawer-panel.is-busy { pointer-events: none; }
.tm-drawer-panel.is-busy .tm-drawer-sub strong, .tm-drawer-panel.is-busy .tm-freebar-drawer { opacity: .5; transition: opacity .15s; }
.tm-di.is-busy { opacity: .45; transition: opacity .15s; }
.tm-di.is-removing { opacity: 0; transform: translateX(16px); transition: opacity .2s, transform .2s; }
html.tm-drawer-lock { overflow: hidden; }
.tm-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; }
.tm-drawer-head h2 { margin: 0; font-family: var(--tm-font-display); font-size: 24px; color: var(--tm-navy); }
.tm-drawer-x { width: 44px; height: 44px; border: 0; border-radius: 999px; background: #EFEDE9; font-size: 22px; line-height: 1; color: var(--tm-navy); }
.tm-drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.tm-drawer-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tm-di { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 18px; padding: 12px; }
.tm-di-img img { width: 68px !important; height: 68px !important; border-radius: 14px; object-fit: cover; display: block; }
.tm-di-main { flex: 1; min-width: 0; }
.tm-di-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--tm-ink); text-decoration: none; }
.tm-di-meta { font-size: 13px; color: #4b5563; margin-top: 2px; overflow-wrap: anywhere; }
.tm-di-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.tm-di-qty { display: flex; align-items: center; gap: 4px; }
.tm-di-qty button { width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid #E2DFDA; background: #fff; font-size: 16px; color: var(--tm-navy); }
.tm-di-qty button:disabled { opacity: .35; }
.tm-di-qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.tm-di-remove { border: 0; background: none; padding: 8px 0; font-size: 13px; color: #4b5563; text-decoration: underline; text-underline-offset: 3px; }
.tm-di-price { font-weight: 700; color: var(--tm-teal-text, #0B7380); white-space: nowrap; font-size: 15px; }
.tm-dx { background: #EDE7DF; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tm-dx-title { font-weight: 700; font-size: 14px; color: var(--tm-navy); }
.tm-dx-item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 10px; }
.tm-dx-item img { width: 48px !important; height: 48px !important; border-radius: 10px; object-fit: cover; }
.tm-dx-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--tm-ink); text-decoration: none; line-height: 1.3; }
.tm-dx-name span { display: block; font-weight: 700; color: var(--tm-teal-text, #0B7380); }
.tm-dx-add { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--tm-navy); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; }
.tm-drawer-foot { padding: 14px 20px 20px; background: #fff; border-top: 1px solid #ECEAE6; display: flex; flex-direction: column; gap: 8px; }
.tm-drawer-sub { display: flex; justify-content: space-between; font-size: 17px; color: var(--tm-navy); }
.tm-drawer-note { margin: 0; font-size: 13px; color: #4b5563; }
.tm-drawer-btn { height: 54px; border-radius: 999px; background: var(--tm-navy); color: #fff !important; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 24px; }
.tm-drawer-link { text-align: center; font-size: 14px; font-weight: 600; color: var(--tm-navy); padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
.tm-drawer-empty { padding: 30px 20px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.tm-drawer-x:focus-visible, .tm-di-qty button:focus-visible, .tm-dx-add:focus-visible, .tm-drawer-btn:focus-visible { outline: 3px solid var(--tm-teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tm-drawer-panel, .tm-drawer-veil, .tm-freebar-track > span { transition: none; } }

/* ---- Partner-shipped note ---- */
.tm-partner-note { margin: 0 0 20px; padding: 14px 16px; border-radius: 18px; background: #EDE7DF; font-size: 14px; line-height: 1.45; color: var(--tm-ink); }
.tm-partner-note strong { color: var(--tm-navy); }

/* ---- Rotating hero ---- */
.tm-hero2-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.tm-hero2-slide.is-on { opacity: 1; pointer-events: auto; }
.tm-hero2-slide[hidden] { display: none; }
.tm-hero2-slide > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.tm-hero2-dots { position: absolute; right: 16px; top: 16px; display: flex; gap: 6px; z-index: 2; }
.tm-hero2-dots button { width: 28px; height: 28px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.tm-hero2-dots button::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(11, 31, 77, .25); }
.tm-hero2-dots button.is-on::before { background: #fff; width: 22px; }
@media (prefers-reduced-motion: reduce) { .tm-hero2-slide { transition: none; } }
.tm-di-img:empty { display: none; }

/* "Added to cart" note (1.16.8) */
.tm-toast {
  position: fixed; z-index: 99998; right: 20px; top: 92px; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: #fff; color: var(--tm-navy); border: 1px solid var(--tm-border); border-radius: 18px;
  box-shadow: 0 16px 40px -12px rgba(11, 31, 77, .28);
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.tm-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
body.admin-bar .tm-toast { top: 124px; }
.tm-toast-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--tm-mint-soft); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.tm-toast-msg { font-weight: 700; font-size: 15px; white-space: nowrap; }
.tm-toast-btn { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--tm-navy); color: #fff !important; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.tm-toast-x { width: 34px; height: 34px; border: 0; background: none; font-size: 20px; color: var(--tm-muted); cursor: pointer; border-radius: 50%; }
.tm-toast-x:hover { background: #f1f1f1; }
.tm-cart-pill.tm-bump { animation: tm-bump .45s ease; }
@keyframes tm-bump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.12); } }
@media (max-width: 600px) { .tm-toast { left: 16px; right: 16px; top: auto; bottom: 88px; } body.admin-bar .tm-toast { top: auto; } }
@media (prefers-reduced-motion: reduce) { .tm-toast, .tm-cart-pill.tm-bump { transition: none; animation: none; } }
