/* Style/orderTracking.css */
:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:rgba(15,23,42,.10);
  --shadow:0 18px 45px rgba(2,8,23,.08);
  --shadow2:0 10px 25px rgba(2,8,23,.06);
  --radius:18px;
  --radius2:14px;
  --brand:#c80000;
  --brandSoft: rgba(200,0,0,.10);
  --dark:#111827;
}

*{ box-sizing:border-box; }
body{
  background: radial-gradient(1200px 600px at 20% -10%, rgba(200,0,0,.06), transparent 55%),
              radial-gradient(900px 450px at 90% 0%, rgba(17,24,39,.06), transparent 50%),
              var(--bg);
  font-family: "Poppins", sans-serif;
  color: var(--text);
}

/* === layout helpers === */
.container1{
  padding: clamp(14px, 2.2vw, 26px);
}

.track-hero,
.order-card{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.2vw, 26px);
  backdrop-filter: blur(10px);
}

/* ===== Hero ===== */
.track-hero{
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}

.track-hero::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(135deg, rgba(200,0,0,.08), transparent 40%, rgba(17,24,39,.06));
  pointer-events:none;
}

.track-hero > *{ position: relative; }

.track-hero h1{
  margin:0 0 6px;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -.3px;
}
.track-hero p{
  margin:0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== Search Row ===== */
.track-search{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.track-search input{
  flex: 1;
  min-width: 260px;
  height: 48px;
  padding: 0 14px;

  border-radius: 14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.95);

  outline:none;
  transition: .2s ease;
}

.track-search input::placeholder{ color: rgba(100,116,139,.9); }

.track-search input:focus{
  border-color: rgba(200,0,0,.35);
  box-shadow: 0 0 0 4px rgba(200,0,0,.10);
}

.track-search button{
  height: 48px;
  padding: 0 16px;

  border:1px solid rgba(15,23,42,.12);
  border-radius: 14px;

  background: var(--dark);
  color:#fff;
  font-weight: 600;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: var(--shadow2);
}

.track-search button ion-icon{ font-size: 18px; }

.track-search button:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.track-search button:active{
  transform: translateY(0px);
}

.track-hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.track-msg{
  margin-top: 10px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(15,23,42,.12);
  background: rgba(17,24,39,.02);
}
.track-msg:empty{ display:none; }

.track-msg.ok{
  border-color: rgba(16,185,129,.35);
  background: rgba(16,185,129,.08);
  color: #065f46;
}
.track-msg.err{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.08);
  color: #a52525;
}

/* ===== Order Card ===== */
.order-card{ margin-top: 18px; }
.hidden{ display:none; }

.order-top{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}

.order-top h2{
  margin:0;
  letter-spacing: -.2px;
}

.order-meta{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,.10);
  font-size: 12px;
  color: var(--text);
  background: rgba(255,255,255,.8);
}

.chip-muted{ color: var(--muted); }

.status-box{
  text-align:right;
  min-width: 150px;
}
.status-label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.status-pill{
  display:inline-flex;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
}

/* status colors */
.status-pill.pending{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); }
.status-pill.processing{ background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
.status-pill.shipped{ background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
.status-pill.delivered{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); }
.status-pill.cancelled{ background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.25); }

/* ===== Grid ===== */
.order-grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px){
  .order-grid{ grid-template-columns: 1fr; }
}

/* ===== Boxes ===== */
.box,
.items-box,
.requests{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(2,8,23,.04);
  padding: 14px;
}

.box h3,
.items-box h3{
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: -.1px;
}

.kv{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(15,23,42,.10);
  font-size: 14px;
}
.kv:last-child{ border-bottom: 0; }
.kv span{ color: var(--muted); }
.kv strong{ color: var(--text); font-weight: 600; }
.kv-total strong{ color: #0f172a; font-size: 16px; }

.notice{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  background: rgba(17,24,39,.03);
  border:1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  line-height: 1.55;
}

.notes{
  font-size: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ===== Items ===== */
.items-box{ margin-top: 12px; }

.items-list{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.item-row{
  display:flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  transition: transform .15s ease, box-shadow .2s ease;
}

.item-row:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(2,8,23,.06);
}

.item-row img{
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,.08);
}

.item-info{ flex:1; min-width: 0; }
.item-title{
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-sub{ color: var(--muted); font-size: 13px; }
.item-price{ font-weight: 800; color: #0f172a; }

/* ===== Requests ===== */
.requests{ margin-top: 12px; }

.requests-head h3{ margin:0; }
.requests-head p{
  margin:6px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* form fields */
.req-form select,
.req-form textarea{
  width: 100%;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,.12);
  padding: 12px 12px;
  outline:none;
  margin-bottom: 10px;
  background: rgba(255,255,255,.95);
  transition: .2s ease;
}

.req-form textarea{ resize: vertical; min-height: 120px; }

.req-form textarea:focus,
.req-form select:focus{
  border-color: rgba(200,0,0,.35);
  box-shadow: 0 0 0 4px rgba(200,0,0,.10);
}

/* actions */
.req-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

#sendReqBtn{
  height: 46px;
  padding: 0 14px;

  border: 1px solid rgba(200,0,0,.20);
  border-radius: 14px;

  background: linear-gradient(135deg, var(--brand), #a30000);
  color:#fff;
  font-weight: 800;

  display:inline-flex;
  align-items:center;
  gap: 8px;

  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 12px 22px rgba(200,0,0,.12);
}

#sendReqBtn:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

#sendReqBtn:disabled{
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.req-msg{ font-size: 13px; color: var(--muted); }

/* history */
.req-history{ margin-top: 14px; }
.req-history h4{ margin: 0 0 10px; }

.req-list{ display:grid; gap: 10px; }

.req-card{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  padding: 12px 12px;
  background: rgba(17,24,39,.02);
}

.req-card .top{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.req-card .type{
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .7px;
}

.req-card .msg{
  white-space: pre-wrap;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== Rating Modal (NEW) ===== */
.rate-modal{ 
  display:none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}

.rate-modal:not([hidden]){
  display:flex;
}

.rate-panel{
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(15,23,42,.12);
}

.rate-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.rate-head h3{ margin:0; }

.rate-close{
  border:0;
  background:transparent;
  font-size:22px;
  cursor:pointer;
}

.rate-sub{
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
}

.rate-stars{
  margin-top: 12px;
  display:flex;
  gap: 8px;
  font-size: 22px;
}

.rate-stars .starBtn{
  border:0;
  background:transparent;
  cursor:pointer;
  padding: 0 2px;
}

.rate-textarea{
  width:100%;
  margin-top:12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  padding:10px;
  outline:none;
}

.rate-actions{
  margin-top:12px;
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
}

.rate-submit{
  height:44px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  background:#111827;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.rate-submit:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.rate-msg{
  font-size: 13px;
  color: #64748b;
}

/* small screens polish */
@media (max-width: 520px){
  .status-box{ text-align:left; }
  .track-search input{ min-width: 100%; }
  .track-search button{ width: 100%; }
}

/* ====== Mobile Bottom Bar ====== */
.bottom-bar{ display:none; }

@media (max-width: 820px){

  #navbar{ display:none; }

  .header_top{ padding-bottom: 10px; }

  #cartBtnTop{ display:none; }

  body{ padding-bottom: 78px; }

  .bottom-bar{
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;

    height: 64px;
    padding: 8px 10px;

    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 18px;
    box-shadow: 0 18px 35px rgba(2,8,23,.14);

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;

    backdrop-filter: blur(10px);
    z-index: 9998;
  }

  .bb-item{
    position: relative;
    text-decoration: none;
    border: 0;
    background: transparent;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;
    color: #111827;
    font-size: 11px;
    cursor: pointer;
    border-radius: 14px;
  }

  .bb-item ion-icon{ font-size: 20px; }

  .bb-active{
    background: rgba(17,24,39,.08);
    font-weight: 600;
  }

  .bb-cart{ outline: none; }

  .bb-badge{
    position: absolute;
    top: 6px;
    right: 18px;

    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    background: #111827;
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    border-radius: 999px;
    font-style: normal;
  }
}
.rate-modal[hidden] { 
  display: none !important; 
}
[hidden] { 
  display: none !important; 
}
