#wot-root, #wot-root * { box-sizing: border-box; }

:root{
  --wot-primary: #1f6feb;
  --wot-success: #16a34a;
  --wot-warning: #f59e0b;
  --wot-danger: #ef4444;
  --wot-muted: #6b7280;
  --wot-bg: #ffffff;
  --wot-border: #e6e6e6;
  --wot-radius: 12px;
}

/* Basic layout */
.wot-container{ max-width: 980px; margin: 0 auto; padding: 1rem; font-family: inherit; }
.wot-centered{ display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:70vh; }
.wot-widget{ padding: 1.5rem 0; }
.wot-title{ font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; color: #1f2937; text-align: center; }
.wot-search-form{ display:flex; flex-wrap:wrap; gap:0 !important; align-items:center; justify-content:center; margin-bottom:1rem; width:100%; }
.wot-input-wrap{ display:flex; width:100%; max-width: 980px; gap:0 !important; align-items:stretch; position: relative; }
.wot-input-container{ position: relative; flex: 1; min-width: 0; margin: 0 !important; }
/* Input styling per request */
.wot-input{ width: 100%; height:50px; padding:0 2.5rem 0 .7em; outline:0; margin-bottom:0; border:1px solid #d2d6dc; border-right:0; border-radius:var(--wot-radius) 0 0 var(--wot-radius) !important; border-top-right-radius:0 !important; border-bottom-right-radius:0 !important; font-size:1rem; font-family: inherit; box-sizing:border-box; display:block; box-shadow:0 1px 2px 0 rgba(0,0,0,.05); background:#fff; white-space:nowrap; text-overflow:ellipsis; }
.wot-search-form .wot-clear-btn{ all: unset; }
.wot-clear-btn{ position: absolute !important; right: 10px !important; top: 50% !important; transform: translateY(-50%) !important; background: transparent !important; border: 0 !important; -webkit-appearance: none !important; appearance: none !important; font-size: 1.1rem !important; color: #6b7280 !important; cursor: pointer !important; padding: 0 !important; margin: 0 !important; width: 20px !important; height: 20px !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 2 !important; box-shadow: none !important; }
.wot-clear-btn:hover{ color: #374151 !important; background: transparent !important; }
/* Button: match height and connect flush */
.wot-search-form .wot-btn{ background:#9ca3af !important; background-color:#9ca3af !important; background-image:none !important; color:#fff !important; height:50px; padding:0 1rem; border-radius:0 var(--wot-radius) var(--wot-radius) 0 !important; cursor:pointer; font-weight:600; font-family: inherit; min-width:80px; margin-left:0 !important; border:1px solid #d2d6dc; border-left:0; line-height:50px; display:flex; align-items:center; transition: background-color .15s ease-in-out; }
.wot-search-form .wot-btn:hover, .wot-search-form .wot-btn:active{ background:#6b7280 !important; background-color:#6b7280 !important; background-image:none !important; color:#fff !important; outline:none; box-shadow:none; }
.wot-search-form .wot-btn:focus, .wot-search-form .wot-btn:focus-visible{ background:#9ca3af !important; background-color:#9ca3af !important; background-image:none !important; color:#fff !important; outline:none; box-shadow:none; }

/* Ensure plugin search input matches 50px height across themes */
.wot-search-form input[type="email"],
.wot-search-form input[type="number"],
.wot-search-form input[type="password"],
.wot-search-form input[type="search"],
.wot-search-form input[type="tel"],
.wot-search-form input[type="text"]{
  height: 50px !important;
  line-height: 50px;
  /* Force left-side radius to match cards; prevent theme 0.3rem defaults */
  border-top-left-radius: var(--wot-radius) !important;
  border-bottom-left-radius: var(--wot-radius) !important;
  border-top-right-radius:0 !important;
  border-bottom-right-radius:0 !important;
}

/* Results */
.wot-no-results{ text-align:center; color: var(--wot-muted); padding: 1rem 0; }
.wot-card{ display:block; width:100%; border:1px solid var(--wot-border); background:var(--wot-bg); border-radius:var(--wot-radius); padding:1rem; margin-bottom:1rem; box-shadow:0 1px 4px rgba(0,0,0,0.04); }
.wot-card-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:.5rem; }
.wot-order-meta{ font-size:.95rem; color:var(--wot-muted); }
.wot-order-number{ font-size:1.1rem; }
.wot-order-date .wot-date-mobile{ display:none; }
@media (max-width: 480px){
  .wot-order-date .wot-date-desktop{ display:none; }
  .wot-order-date .wot-date-mobile{ display:inline; }
}
.wot-status-badge{ padding:.25rem .5rem; border-radius:999px; font-size:.85rem; color:#fff; text-transform:capitalize; }
.wot-status-completed{ background:var(--wot-success); }
.wot-status-processing{ background:var(--wot-primary); }
.wot-status-pending{ background:var(--wot-danger); color:#fff; }
.wot-status-cancelled{ background:var(--wot-danger); }
.wot-status-refunded{ background:#7c3aed; }
.wot-status-failed{ background:var(--wot-danger); }

/* Items & tracking */
.wot-items ul{ list-style:none; padding:0; margin:0 0 0.5rem 0; }
.wot-items li{ padding:.25rem 0; border-bottom:1px dashed var(--wot-border); display:grid; grid-template-columns: auto 1fr; align-items:baseline; column-gap:.2rem; }
.wot-qty{ color:var(--wot-muted); margin:0; display:block; text-align:left; min-width:0; }
.wot-item-title{ display:block; }

.wot-track-row{ display:flex; gap:1rem; padding:.5rem 0; border-top:1px solid var(--wot-border); }
.wot-carrier{ width:80px; display:flex; align-items:center; justify-content:center; }
.wot-carrier-logo{ width:48px; height:32px; display:block; object-fit:contain; object-position:center; }

.wot-track-meta{ flex:1; }
.wot-carrier-info{ margin-bottom:.25rem; }
.wot-carrier-name{ font-weight:600; font-size:1rem; color:var(--wot-muted); text-transform:uppercase; }

.wot-track-number{ font-weight:600; margin-bottom:.25rem; color: var(--wot-primary) !important; font-size:1rem; display:flex; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }
.wot-track-number a, .wot-track-number a:visited{ color: var(--wot-primary) !important; }
/* ensure no open-new-window icon */
.wot-track-number a::after{ content: none !important; }
/* Share icon next to tracking link */
.wot-share-btn{ margin-left:0; background:none; border:none; cursor:pointer; color:#374151; padding:2px; line-height:1; display:inline-flex; align-items:center; border-radius:8px; transition:background-color .15s ease-in-out, color .15s ease-in-out; vertical-align:middle; }
.wot-share-btn:hover{ background:rgba(0,0,0,0.05); }
.wot-icon-share{ width:1em; height:1em; display:inline-flex; align-items:center; justify-content:center; }
.wot-icon-share svg{ width:1em; height:1em; stroke: currentColor; fill:none; stroke-width:2; }
/* no responsive variant needed since icon removed */
.wot-track-status-badge{ margin-top:.25rem; margin-bottom:.25rem; padding:.25rem .75rem; border-radius:999px; display:inline-flex; align-items:center; gap:.35rem; font-size:.85rem; text-transform:uppercase; width:fit-content; font-weight:600; }
.wot-track-label_created{ background:#6b7280; color:#fff; }
.wot-track-in_transit{ background:#1f6feb; color:#fff; }
.wot-track-out_for_delivery{ background:#f59e0b; color:#000; }
.wot-track-delivered{ background:#16a34a; color:#fff; }
.wot-track-delivered::before{ content:'\2714'; /* checkmark */ display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; line-height:18px; border:2px solid #fff; border-radius:50%; color:#fff; font-size:12px; }
.wot-track-pickup{ background:#0f766e; color:#fff; }
.wot-track-exception{ background:#ef4444; color:#fff; }
.wot-track-transit{ background:#1f6feb; color:#fff; }
.wot-track-pre_transit{ background:#6b7280; color:#fff; }
.wot-track-returned{ background:#7c3aed; color:#fff; }
.wot-track-failure{ background:#ef4444; color:#fff; }
.wot-track-unknown{ background:#6b7280; color:#fff; }
.wot-track-label-created{ background:#6b7280; color:#fff; }
.wot-track-in-transit{ background:#1f6feb; color:#fff; }
.wot-track-out-for-delivery{ background:#f59e0b; color:#000; }
.wot-track-delivered{ background:#16a34a; color:#fff; }
.wot-track-exception{ background:#ef4444; color:#fff; }
.wot-track-transit{ background:#1f6feb; color:#fff; }
.wot-track-pre-transit{ background:#6b7280; color:#fff; }
.wot-track-returned{ background:#7c3aed; color:#fff; }
.wot-track-failure{ background:#ef4444; color:#fff; }

.wot-track-dates{ margin-top:.25rem; }
.wot-date-label{ font-weight:600; }
.wot-last-updated{ margin-top:.15rem; font-size:.85rem; color: var(--wot-muted); }

/* Mobile-only stacked date layout */
@media (max-width: 480px){
  .wot-track-dates .wot-delivered, .wot-track-dates .wot-eta{ display:block; }
  .wot-track-dates .wot-date-label{ display:block; margin-bottom:2px; }
}

/* Responsive */
/* Removed media condition for .wot-input max-width; keep 100% always */
.wot-input{ max-width:100%; }
@media (min-width: 700px){
  .wot-search-form{ flex-wrap:nowrap; width:100%; }
  .wot-input-wrap{ width:100% !important; max-width:980px; }
}

/* Scale input text on small screens so placeholder fits */
@media (max-width: 640px){ .wot-input{ font-size: clamp(0.9rem, 3.6vw, 1rem); } }
@media (max-width: 380px){ .wot-input{ font-size: clamp(0.85rem, 4.6vw, 0.95rem); } }

/* Admin Analytics */
.wot-analytics-grid{ display: grid; gap: 1rem; margin: 1rem 0; }
.wot-analytics-card{ background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; }
.wot-analytics-card h3{ margin-top: 0; color: #1f2937; }
.wot-analytics-card h4{ margin: 1rem 0 0.5rem 0; color: #374151; font-size: 0.9rem; }
.wot-analytics-card ul{ margin: 0; padding-left: 1rem; }
.wot-analytics-card li{ margin: 0.25rem 0; }
.wot-admin-actions{ margin: 1rem 0; }

.wot-results{ min-height: 0; }
.wot-results:not(.wot-has-results){ min-height: 360px; }
@media (max-width: 480px){ .wot-results:not(.wot-has-results){ min-height: 260px; } }
/* Ensure result area (including initial Loading...) matches search bar width */
#wot-results{ width:100%; max-width:980px; margin:0 auto; box-sizing:border-box; }

/* Minimal states */
.wot-state{ display:flex; align-items:center; justify-content:center; gap:.5rem; padding:.75rem 1rem; border:1px solid var(--wot-border); border-radius:var(--wot-radius); background:#fafafa; color:var(--wot-muted); width:100%; max-width:980px; margin:0.75rem auto; box-sizing:border-box; }
.wot-loading{ composes: wot-state; }
.wot-no-results{ composes: wot-state; }
.wot-error{ display:flex; align-items:center; justify-content:center; gap:.5rem; padding:.75rem 1rem; border:1px solid #fde2e2; border-radius:var(--wot-radius); background:#fff5f5; color:#b91c1c; }
.wot-loading::before{ content:""; width:14px; height:14px; border:2px solid #c7cdd5; border-top-color:#6b7280; border-radius:50%; display:inline-block; animation:wot-spin .8s linear infinite; }
@keyframes wot-spin{ to{ transform: rotate(360deg);} }

/* Payment required note for failed orders */
.wot-payment-note{ margin-top:.5rem; }

/* Mobile placeholder fit without scaling user input */
@media (max-width: 640px){
  .wot-input::placeholder,
  .wot-input::-webkit-input-placeholder,
  .wot-input::-moz-placeholder,
  .wot-input:-ms-input-placeholder{
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity:.9;
  }
}
