/* ==========================================================================
   quote.css — مقايسة الشقة (الحاسبة) + ورقة الطباعة A4
   ========================================================================== */

.sec--calc{background:var(--cream);border-top:1px solid var(--line)}

.quote{
  --qpad:clamp(14px,2.4vw,26px);
  margin-top:clamp(24px,4vw,40px);
  background:#fff;
  border:1px solid var(--line);
  padding:var(--qpad);
}

.quote__fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 12px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}

.quote__body{
  display:grid;
  gap:18px;
  margin-top:16px;
}


/* ---------- حقول الإدخال ---------- */
.field{display:grid;gap:6px;min-width:0}
.field__label{
  font-size:.84rem;
  color:var(--muted);
  line-height:1.5;
}
.field__box{
  display:flex;
  align-items:stretch;
  min-width:0;
  border:1px solid var(--line);
  background:var(--cream);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.field__box:focus-within{
  border-color:var(--gold);
  box-shadow:0 0 0 2px rgba(201,164,92,.22);
}
.field__box input{
  width:100%;
  min-width:0;
  border:0;
  background:none;
  padding:11px 10px;
  font-family:var(--font-display);
  font-size:1.05rem;
  font-weight:700;
  color:var(--navy);
  text-align:center;
  direction:ltr;
  appearance:textfield;
  -moz-appearance:textfield;
}
.field__box input:focus{outline:none}
.field__box input::-webkit-outer-spin-button,
.field__box input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.field__unit{
  display:flex;
  align-items:center;
  flex:none;
  padding-inline:12px;
  border-inline-start:1px solid var(--line);
  font-size:.8rem;
  color:var(--muted);
  background:rgba(0,19,74,.03);
}

/* ---------- البنود ---------- */
.quote__items{display:grid;gap:0}
.q-item{
  display:grid;
  gap:9px;
  padding-block:15px;
  border-bottom:1px solid var(--line);
}
.q-item:first-child{padding-top:2px}
.q-item:last-child{border-bottom:0;padding-bottom:2px}

.q-item__head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}
.q-item__name{
  font-family:var(--font-display);
  font-weight:600;
  font-size:.97rem;
  color:var(--navy);
  line-height:1.5;
}
.q-item__sum{
  flex:none;
  font-family:var(--font-display);
  font-weight:700;
  font-size:.88rem;
  color:var(--gold-ink);
  white-space:nowrap;
}
.q-item__qty{
  font-size:.76rem;
  color:var(--muted);
  line-height:1.6;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.chip{position:relative;display:inline-flex}
.chip input{
  position:absolute;
  opacity:0;
  width:1px;height:1px;
  margin:0;
}
.chip span{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:6px 14px;
  border:1px solid var(--line);
  background:var(--cream);
  color:var(--navy);
  font-size:.85rem;
  font-weight:700;
  line-height:1.4;
  cursor:pointer;
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
}
.chip span:hover{border-color:var(--gold)}
.chip input:checked + span{
  background:var(--navy);
  border-color:var(--navy);
  color:#fff;
}
.chip input:focus-visible + span{
  outline:2px solid var(--gold);
  outline-offset:2px;
}

/* ---------- كارت الإجمالي ---------- */
.quote__card{
  background:var(--navy);
  color:#fff;
  padding:clamp(16px,3vw,26px);
  border:1px solid var(--navy);
}
.quote__label{
  font-size:.76rem;
  letter-spacing:.02em;
  color:rgba(255,255,255,.55);
}
.quote__num{
  display:flex;
  align-items:baseline;
  gap:8px;
  margin-top:4px;
  font-family:var(--font-display);
  font-weight:800;
  font-size:clamp(2rem,8vw,2.7rem);
  line-height:1.15;
  color:var(--gold-soft);
  letter-spacing:-.01em;
}
.quote__cur{
  font-family:var(--font-body);
  font-weight:700;
  font-size:.85rem;
  color:rgba(255,255,255,.6);
}
.quote__sent{
  margin-top:8px;
  font-size:.92rem;
  line-height:1.8;
  color:rgba(255,255,255,.88);
}
.quote__btns{
  display:grid;
  gap:8px;
  margin-top:16px;
}
.quote__btns .btn{width:100%}
.quote__note{
  margin-top:11px;
  font-size:.73rem;
  line-height:1.7;
  color:rgba(255,255,255,.5);
}

.calc-note{
  margin-top:18px;
  font-size:.82rem;
  line-height:1.8;
  color:var(--muted);
  border-inline-start:2px solid var(--line);
  padding-inline-start:12px;
}

/* الموبايل: الإجمالي يلزق في تحت الشاشة وهو بيتنقل بين البنود */
@media (max-width:899px){
  .quote__card{
    position:sticky;
    bottom:0;
    z-index:5;
    margin-inline:calc(var(--qpad) * -1);
    padding:14px var(--qpad) 12px;
    box-shadow:0 -10px 26px rgba(0,19,74,.22);
  }
  .quote__num{font-size:clamp(1.9rem,9vw,2.4rem)}
  .quote__btns{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .quote__btns .btn{
    font-size:.86rem;
    padding:10px 12px;
    min-height:46px;
  }
}

@media (min-width:600px){
  .quote__fields{grid-template-columns:repeat(2,minmax(0,260px))}
}

@media (min-width:900px){
  .quote__body{
    grid-template-columns:1fr 350px;
    gap:32px;
    align-items:start;
  }
  .quote__card{position:sticky;top:96px}
  .quote__btns{grid-template-columns:1fr}
}

/* ==========================================================================
   ورقة المقايسة — بتظهر في الطباعة بس
   ========================================================================== */

.sheet{display:none}

@media print{
  @page{size:A4;margin:13mm 11mm}

  html,body{
    background:#fff !important;
    color:#000 !important;
    font-size:10pt;
  }
  body>*{display:none !important}

  .sheet{
    display:block !important;
    font-family:var(--font-body);
    color:#111;
    font-size:9.5pt;
    line-height:1.55;
  }

  .sheet__head{
    display:flex;
    align-items:center;
    gap:12px;
    border-bottom:2px solid #00134A;
    padding-bottom:9px;
  }
  .sheet__logo{height:44px;width:auto}
  .sheet__name{
    font-family:var(--font-display);
    font-weight:700;
    font-size:14pt;
    color:#00134A;
    line-height:1.3;
  }
  .sheet__sub{font-size:8.5pt;color:#555;margin-top:2px}

  .sheet__title{
    font-family:var(--font-display);
    font-size:17pt;
    color:#00134A;
    margin:16px 0 8px;
    line-height:1.3;
  }

  .sheet__meta{
    display:flex;
    flex-wrap:wrap;
    gap:4px 20px;
    margin-bottom:12px;
    font-size:9pt;
    color:#333;
  }
  .sheet__meta b{color:#00134A}

  .sheet__table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:8.6pt;
  }
  .sheet__table th,
  .sheet__table td{
    border:1px solid #c8c2b4;
    padding:5px 6px;
    vertical-align:top;
    text-align:start;
  }
  .sheet__table thead th{
    background:#00134A;
    color:#fff;
    font-weight:700;
    font-size:8.2pt;
    border-color:#00134A;
  }
  .sheet__table tbody tr:nth-child(even) td{background:#FAF7F0}
  .sheet__table tr{page-break-inside:avoid}
  .sheet__table .c-item{width:15%}
  .sheet__table .c-desc{width:45%}
  .sheet__table .c-qty{width:11%}
  .sheet__table .c-rate{width:14%}
  .sheet__table .c-sum{width:15%}
  .sheet__table td.num{white-space:nowrap;font-weight:700}

  .sheet__tot{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:12px;
    padding:9px 12px;
    border:1.5px solid #00134A;
    background:#F7F3EA;
    font-family:var(--font-display);
    font-weight:700;
    font-size:13pt;
    color:#00134A;
    page-break-inside:avoid;
  }

  .sheet__note{
    margin-top:10px;
    font-size:8.2pt;
    color:#555;
    line-height:1.7;
  }
  .sheet__foot{
    margin-top:14px;
    padding-top:7px;
    border-top:1px solid #ccc;
    font-size:7.8pt;
    color:#666;
  }
}
