/* ============================================================
   Ecohomes — Status Pengiriman (Track Delivery)
   Reference: 5.Status_Pengiriman.png (green brand kept).
   ============================================================ */

.eh-ship-wrap {
	flex: 1; min-width: 0;
	--eh-ink: #1E293B; --eh-muted: #64748B; --eh-line: #EDF0F4; --eh-track: #E2E8F0;
	--eh-tint: #EAF8F0; --eh-card-sh: 0 1px 2px rgba(16,24,40,.05);
	--eh-blue: #1F6FEB; --eh-blue-tint: #E7F1FF;
	color: var(--eh-ink);
}

/* Widen account content on this page only */
.woocommerce-account .container:has(.eh-ship-wrap) { width: 100% !important; max-width: 1360px !important; }
.woocommerce-account .dashboard-wrap:has(.eh-ship-wrap) > [class*="col-"]:first-child { flex: 0 0 19%; max-width: 19%; }
.woocommerce-account .dashboard-wrap:has(.eh-ship-wrap) > [class*="col-"]:last-child { flex: 0 0 81%; max-width: 81%; }

/* Buttons */
.eh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; line-height: 1.2; transition: all .15s; }
.eh-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-btn-primary { background: var(--eh-green, #2ECC71); color: #fff; border-color: var(--eh-green, #2ECC71); }
.eh-btn-primary:hover { background: var(--eh-green-dark, #27AE60); border-color: var(--eh-green-dark, #27AE60); color: #fff; }
.eh-btn-outline { background: #fff; color: var(--eh-ink); border-color: #DCE1E8; }
.eh-btn-outline:hover { background: var(--eh-tint); color: var(--eh-green-dark); border-color: var(--eh-green); }
.eh-btn-block { width: 100%; }
.eh-btn-sm { padding: 6px 14px; font-size: .8rem; margin-left: auto; flex-shrink: 0; }
.eh-btn-doc { gap: 8px; }
.eh-btn.is-loading { opacity: .6; pointer-events: none; }

/* Normalise casing — the theme uppercases some labels/badges; the reference is title-case */
.eh-ship-wrap .eh-badge,
.eh-ship-wrap .eh-stat-label,
.eh-ship-wrap .eh-stat-link,
.eh-ship-wrap .eh-detail-subtitle,
.eh-ship-wrap .eh-fact-label,
.eh-ship-wrap .eh-result-count,
.eh-ship-detail .eh-badge,
.eh-ship-detail .eh-detail-subtitle { text-transform: none; letter-spacing: 0; }
.eh-ship-wrap .eh-addr-tag { text-transform: uppercase; letter-spacing: .04em; }

/* Badges */
.eh-badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.eh-badge-green   { background: #E6F7EE; color: #1E9E59; }
.eh-badge-blue    { background: var(--eh-blue-tint); color: #1A5FD0; }
.eh-badge-yellow  { background: #FFF8E1; color: #B7791F; }
.eh-badge-orange  { background: #FFF3E6; color: #B5651A; }
.eh-badge-red     { background: #FDECEC; color: #D64545; }
.eh-badge-gray    { background: #EEF1F5; color: #64748B; }

/* Header */
.eh-ship-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.eh-ship-header .eh-page-title { font-size: 1.5rem; font-weight: 700; color: var(--eh-ink); margin: 0; }
.eh-page-subtitle { margin: 6px 0 0; color: var(--eh-muted); font-size: .9rem; }
.eh-last-updated { font-size: .78rem; color: var(--eh-muted); white-space: nowrap; flex-shrink: 0; }

/* Stat cards (3) */
.eh-ship-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.eh-ship-stats .eh-stat-card {
	position: relative; display: grid; grid-template-columns: 44px 1fr;
	grid-template-areas: "icon label" "icon value" "link link"; column-gap: 12px; row-gap: 2px;
	text-align: left; background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 16px;
}
.eh-ship-stats .eh-stat-icon { grid-area: icon; position: static; width: 44px; height: 44px; border-radius: 11px; background: var(--eh-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.eh-ship-stats .eh-stat-label { grid-area: label; align-self: end; font-size: .8rem; color: var(--eh-muted); }
.eh-ship-stats .eh-stat-value { grid-area: value; align-self: start; font-size: 1.7rem; font-weight: 700; color: var(--eh-ink); line-height: 1.1; }
.eh-stat-link { grid-area: link; margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-stat-link .dashicons { font-size: 15px; width: 15px; height: 15px; transition: transform .15s; }
.eh-stat-link:hover .dashicons { transform: translateX(3px); }
.eh-stat-card--blue .eh-stat-icon { background: var(--eh-blue-tint); color: var(--eh-blue); }
.eh-stat-card--orange .eh-stat-icon { background: #FFF3E6; color: #E8821A; }
.eh-stat-card--success .eh-stat-icon { background: #E8F8EF; color: #1E9E59; }

/* Toolbar */
.eh-ship-toolbar { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 12px; margin-bottom: 16px; }
/* Beat the theme's global `input,select{width:100%;margin-bottom}` rules */
.eh-ship-toolbar input,
.eh-ship-toolbar select { margin: 0 !important; box-sizing: border-box; }
.eh-filter-search { position: relative; flex: 1 1 auto; min-width: 0; }
.eh-filter-search .dashicons { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94A3B8; font-size: 18px; }
.eh-search-input { width: 100%; height: 42px; padding: 0 12px 0 38px; box-sizing: border-box; border: 1px solid #DCE1E8; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff; }
.eh-search-input:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(46,204,113,.15); }
.eh-filter-select { width: auto !important; flex: 0 0 auto; min-width: 170px; max-width: 220px; height: 42px; padding: 0 34px 0 12px; border: 1px solid #DCE1E8; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center; -webkit-appearance: none; appearance: none; cursor: pointer; }
.eh-filter-select:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(46,204,113,.15); }
.eh-filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border: 1px solid #DCE1E8; border-radius: 8px; background: #fff; color: var(--eh-ink); font-size: .85rem; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.eh-filter-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-filter-btn:hover { background: var(--eh-tint); color: var(--eh-green-dark); border-color: var(--eh-green); }

/* Layout */
.eh-ship-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.eh-ship-main { min-width: 0; container-type: inline-size; container-name: ehship; }
.eh-result-row { margin-bottom: 12px; }
.eh-result-count { font-size: .85rem; color: var(--eh-muted); }

/* Accordion list */
.eh-ship-list { display: flex; flex-direction: column; gap: 14px; }
.eh-ship-row { background: #fff; border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: var(--eh-card-sh); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.eh-ship-row.is-open { border-color: var(--eh-green); box-shadow: 0 4px 18px rgba(46,204,113,.12); }
.eh-ship-row__head { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; width: 100%; background: none; border: none; cursor: pointer; padding: 18px 20px; text-align: left; }
.eh-ship-row__head:focus-visible { outline: 2px solid var(--eh-green); outline-offset: -2px; border-radius: 14px; }
.eh-ship-row__id { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.eh-ship-row__num { font-size: 1rem; font-weight: 700; color: var(--eh-ink); letter-spacing: .01em; }
.eh-ship-row__eta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; flex-shrink: 0; }
.eh-ship-row__eta-label { font-size: .7rem; color: var(--eh-muted); }
.eh-ship-row__eta-date { font-size: .85rem; font-weight: 700; color: var(--eh-ink); white-space: nowrap; }
.eh-ship-row__chevron { color: #94A3B8; transition: transform .2s; font-size: 18px; flex-shrink: 0; }
.eh-ship-row.is-open .eh-ship-row__chevron { transform: rotate(180deg); color: var(--eh-green-dark); }

.eh-ship-row__body { display: none; padding: 0 20px 22px; }
.eh-ship-row.is-open .eh-ship-row__body { display: block; animation: eh-fade .2s ease; }
@keyframes eh-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.eh-ship-facts { display: grid; grid-template-columns: 1.6fr 1.1fr 1.4fr 1fr; gap: 14px 22px; padding: 16px 0; border-top: 1px solid var(--eh-line); margin-bottom: 10px; }
.eh-ship-fact { min-width: 0; }
.eh-fact-label { display: block; font-size: .72rem; font-weight: 600; color: var(--eh-muted); margin-bottom: 5px; }
.eh-fact-value { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--eh-ink); }
.eh-fact-route { font-weight: 600; }
.eh-fact-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .01em; }
.eh-fact-courier { gap: 10px; }
.eh-fact-courier__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.eh-fact-courier__name small { font-weight: 500; font-size: .74rem; color: var(--eh-muted); }
.eh-ship-fact--total { text-align: left; }
.eh-fact-link { display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; font-size: .76rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-fact-link .dashicons { font-size: 14px; width: 14px; height: 14px; transition: transform .15s; }
.eh-fact-link:hover .dashicons { transform: translateX(2px); }

/* Courier logo — official image when present, brand wordmark fallback */
.eh-courier-logo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 44px; height: 30px; padding: 0 8px; border-radius: 6px; background: var(--eh-logo, #2ECC71); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.eh-courier-logo--sm { min-width: 38px; height: 24px; padding: 0 7px; font-size: .64rem; border-radius: 5px; }
.eh-courier-logo--img { background: #fff; border: 1px solid var(--eh-line); padding: 3px 6px; }
.eh-courier-logo--img img { display: block; height: 22px; width: auto; max-width: 64px; object-fit: contain; }
.eh-courier-logo--sm.eh-courier-logo--img img { height: 18px; max-width: 54px; }

.eh-copy { background: none; border: none; cursor: pointer; color: #94A3B8; padding: 2px; line-height: 1; }
.eh-copy:hover { color: var(--eh-green-dark); }
.eh-copy.is-copied { color: var(--eh-green); }
.eh-copy .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* Stepper (5 steps) */
.eh-stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--eh-line); }
.eh-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 4px; }
.eh-step::before, .eh-step::after { content: ""; position: absolute; top: 17px; height: 3px; background: var(--eh-track); z-index: 0; }
.eh-step::before { left: 0; width: 50%; }
.eh-step::after { right: 0; width: 50%; }
.eh-step:first-child::before, .eh-step:last-child::after { display: none; }
.eh-step.is-done::before, .eh-step.is-done::after,
.eh-step.is-current::before { background: var(--eh-green); }
.eh-step-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; background: #fff; border: 3px solid var(--eh-track); color: #94A3B8; margin-bottom: 8px; }
.eh-step.is-done .eh-step-dot { background: var(--eh-green); border-color: var(--eh-green); color: #fff; }
.eh-step.is-current .eh-step-dot { background: var(--eh-green); border-color: var(--eh-green); color: #fff; box-shadow: 0 0 0 4px rgba(46,204,113,.16); }
.eh-step-label { font-size: .77rem; font-weight: 600; color: var(--eh-ink); line-height: 1.3; }
.eh-step.is-future .eh-step-label { color: var(--eh-muted); font-weight: 500; }
.eh-step-date { font-size: .72rem; color: var(--eh-ink); margin-top: 4px; line-height: 1.3; }
.eh-step-time { font-size: .7rem; color: var(--eh-muted); margin-top: 1px; line-height: 1.3; }
.eh-step.is-future .eh-step-date { color: var(--eh-muted); }
.eh-stepper.is-cancelled .eh-step.is-cancelled .eh-step-dot { background: #FDECEC; border-color: #F3B4B4; color: #D64545; }

/* Empty */
.eh-ship-empty { background: #fff; border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: var(--eh-card-sh); padding: 48px 24px; text-align: center; color: var(--eh-muted); }
.eh-ship-empty .dashicons { font-size: 44px; width: 44px; height: 44px; color: #CBD5E1; display: block; margin: 0 auto 12px; }

/* Load more */
.eh-ship-loadmore { margin-top: 20px; display: flex; justify-content: center; }
.eh-ship-loadmore[hidden] { display: none; }
.eh-loadmore-btn { padding: 11px 26px; }
.eh-loadmore-btn.is-loading .dashicons { animation: eh-spin .8s linear infinite; }
@keyframes eh-spin { to { transform: rotate(360deg); } }

/* Detail panel */
.eh-ship-detail { background: #fff; border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: var(--eh-card-sh); padding: 18px; position: sticky; top: 24px; }
.eh-ship-detail__bar { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.eh-ship-detail__title { font-size: 1rem; font-weight: 700; color: var(--eh-ink); margin: 0; }
.eh-ship-detail__close { background: none; border: none; cursor: pointer; color: #94A3B8; padding: 2px; line-height: 1; display: none; }
.eh-ship-detail__close:hover { color: var(--eh-ink); }
.eh-ship-detail__body.is-loading { opacity: .5; pointer-events: none; }
.eh-ship-detail__empty { font-size: .85rem; color: var(--eh-muted); text-align: center; padding: 20px 0; }
.eh-detail-head { margin-bottom: 12px; }
.eh-detail-head__id { display: flex; align-items: center; gap: 10px; }
.eh-detail-num { font-size: 1rem; font-weight: 700; color: var(--eh-green-dark); }
.eh-detail-courier { padding-bottom: 14px; border-bottom: 1px solid var(--eh-line); margin-bottom: 14px; }
.eh-detail-courier__name { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--eh-ink); flex-wrap: wrap; }
.eh-detail-courier__svc { display: block; font-size: .76rem; color: var(--eh-muted); margin-top: 5px; }

/* Map placeholder */
.eh-detail-map { height: 150px; border-radius: 10px; margin-bottom: 14px; position: relative; overflow: hidden;
	background:
		radial-gradient(circle at 18% 30%, rgba(46,204,113,.10), transparent 32%),
		radial-gradient(circle at 82% 70%, rgba(31,111,235,.10), transparent 32%),
		repeating-linear-gradient(0deg, #EEF2F6 0 1px, transparent 1px 26px),
		repeating-linear-gradient(90deg, #EEF2F6 0 1px, transparent 1px 26px),
		#F1F5F9;
	border: 1px solid var(--eh-line);
	display: flex; align-items: center; justify-content: center;
}
.eh-detail-map::after { content: ""; position: absolute; left: 16%; right: 16%; top: 46%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--eh-green), var(--eh-blue)); opacity: .55; }
.eh-map-route { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.9); border: 1px solid var(--eh-line); border-radius: 999px; padding: 6px 12px; max-width: 92%; box-shadow: 0 2px 6px rgba(16,24,40,.08); }
.eh-map-pin { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; color: var(--eh-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.eh-map-pin .dashicons { font-size: 14px; width: 14px; height: 14px; }
.eh-map-pin--from .dashicons { color: var(--eh-green); }
.eh-map-pin--to .dashicons { color: var(--eh-blue); }
.eh-map-line { flex: 1; height: 2px; min-width: 18px; background: linear-gradient(90deg, var(--eh-green), var(--eh-blue)); }

.eh-col-label { display: block; font-size: .72rem; font-weight: 600; color: var(--eh-muted); }

/* ETA block */
.eh-detail-eta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #F8FAFC; border: 1px solid var(--eh-line); border-radius: 10px; margin-bottom: 16px; }
.eh-detail-eta__ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; background: var(--eh-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.eh-detail-eta__body { display: flex; flex-direction: column; line-height: 1.35; }
.eh-detail-eta__date { font-size: 1.05rem; font-weight: 700; color: var(--eh-ink); }
.eh-detail-eta__cut { font-size: .74rem; color: var(--eh-muted); }

.eh-detail-section { padding: 14px 0; border-top: 1px solid var(--eh-line); }
.eh-detail-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.eh-detail-subtitle { font-size: .85rem; font-weight: 700; color: var(--eh-ink); margin: 0 0 10px; }
.eh-detail-section__head .eh-detail-subtitle { margin: 0; }
.eh-detail-link { font-size: .76rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-detail-link:hover { text-decoration: underline; }

/* Address blocks */
.eh-addr { display: flex; gap: 10px; padding: 8px 0; }
.eh-addr + .eh-addr { border-top: 1px dashed var(--eh-line); }
.eh-addr-pin { flex-shrink: 0; margin-top: 1px; font-size: 18px; width: 18px; height: 18px; }
.eh-addr-pin--from { color: var(--eh-green); }
.eh-addr-pin--to { color: var(--eh-blue); }
.eh-addr-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.eh-addr-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--eh-muted); }
.eh-addr-body strong { font-size: .82rem; color: var(--eh-ink); }
.eh-addr-co { font-size: .78rem; font-weight: 600; color: var(--eh-ink); }
.eh-addr-line { font-size: .76rem; color: var(--eh-muted); }

/* Timeline */
.eh-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.eh-timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--eh-track); }
.eh-timeline-item { position: relative; padding: 0 0 14px 24px; }
.eh-timeline-item:last-child { padding-bottom: 0; }
.eh-timeline-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--eh-track); }
.eh-timeline-item.is-latest .eh-timeline-dot { border-color: var(--eh-green); background: var(--eh-green); }
.eh-timeline-body strong { display: block; font-size: .82rem; color: var(--eh-ink); }
.eh-timeline-time { display: block; font-size: .74rem; color: var(--eh-muted); margin-top: 1px; }
.eh-timeline-note { display: block; font-size: .74rem; color: var(--eh-muted); }

/* Courier contact */
.eh-contact-row { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.eh-help-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; background: var(--eh-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.eh-help-text { display: flex; flex-direction: column; min-width: 0; }
.eh-help-text strong { font-size: .82rem; color: var(--eh-ink); }
.eh-help-text small { font-size: .74rem; color: var(--eh-muted); }

.eh-detail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ── Responsive ── */
@container ehship (max-width: 640px) {
	.eh-ship-facts { grid-template-columns: 1fr 1fr; }
	.eh-stepper { grid-template-columns: 1fr; gap: 0; padding-top: 14px; }
	.eh-step { flex-direction: row; align-items: flex-start; text-align: left; gap: 12px; padding: 0 0 18px; }
	.eh-step::before, .eh-step::after { display: none !important; }
	.eh-step-dot { margin-bottom: 0; }
	.eh-step::before { content: ""; display: block !important; position: absolute; left: 17px; top: 36px; bottom: 0; width: 3px; height: auto; }
	.eh-step:not(:last-child)::before { display: block !important; background: var(--eh-track); }
	.eh-step.is-done:not(:last-child)::before { background: var(--eh-green); }
	.eh-step-label, .eh-step-date, .eh-step-time { text-align: left; }
}

@media (max-width: 980px) {
	.woocommerce-account .col-lg-9:has(.eh-ship-wrap),
	.woocommerce-account .col-md-8:has(.eh-ship-wrap) { flex: 0 0 100%; max-width: 100%; }
	.eh-ship-layout { grid-template-columns: 1fr; }
	.eh-ship-detail { position: static; }
	.eh-ship-detail__close { display: inline-flex; }
}
@media (max-width: 760px) {
	.eh-ship-header { flex-direction: column; }
	.eh-ship-stats { grid-template-columns: 1fr; }
	.eh-ship-toolbar { flex-wrap: wrap; }
	.eh-filter-search { flex: 1 1 100%; }
}
