/* =========================
   FA COMPANY - SİFARİŞ FORMASI
   Fayl: css/order.css

   Korporativ rənglər:
   Sarı: #F8B216
   Tünd: #373435
   Ağ: #FEFEFE
   Açıq fon: #F7F4EE
   ========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: #373435;
  color: #373435;
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

/* =========================
   A4 FORM KONTEYNERİ
   ========================= */

.order-page {
  min-height: 100vh;
  padding: 22px 10px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.order-paper {
  width: min(1080px, 100%);
  background: #F7F4EE;
  border-radius: 28px;
  padding: 26px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

/* =========================
   ÜST BAŞLIQ
   ========================= */

.order-top {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.order-brand-card,
.order-info-card {
  background: #FEFEFE;
  border: 1px solid #D8CFC1;
  border-radius: 18px;
}

.order-brand-card {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.order-logo {
  width: 116px;
  height: 116px;
  border-radius: 8px;
  background: #F8B216;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.order-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.order-brand-card h1 {
  font-size: 34px;
  line-height: 1.1;
  color: #373435;
  margin-bottom: 9px;
}

.order-brand-card p {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(55, 52, 53, 0.72);
}

.order-info-stack {
  display: grid;
  gap: 12px;
}

.order-info-card {
  padding: 16px 20px;
}

.order-info-card span {
  display: block;
  font-size: 14px;
  color: #373435;
  margin-bottom: 6px;
  font-weight: 700;
}

.order-info-card strong {
  font-size: 20px;
  color: #373435;
}

/* =========================
   FORM INPUTLARI
   ========================= */

.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
  margin-bottom: 18px;
}

.form-group,
.delivery-box,
.note-box {
  background: #FEFEFE;
  border: 1px solid #D8CFC1;
  border-radius: 18px;
  padding: 14px 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #373435;
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #D8CFC1;
  background: #FEFEFE;
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 14px;
  outline: none;
  color: #373435;
  font-family: inherit;
}

input:focus,
textarea:focus {
  border-color: #F8B216;
  box-shadow: 0 0 0 3px rgba(248, 178, 22, 0.22);
}

/* =========================
   MƏHSUL SƏTİRLƏRİ
   ========================= */

.products-box {
  background: #FEFEFE;
  border: 1px solid #D8CFC1;
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h2 {
  color: #373435;
  font-size: 27px;
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
}

.section-title h2::after {
  content: "";
  width: 54px;
  height: 3px;
  background: #F8B216;
  position: absolute;
  left: 0;
  bottom: -8px;
}

#productCountBadge {
  background: rgba(248, 178, 22, 0.18);
  color: #373435;
  border-radius: 50px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.order-table {
  border: 1px solid #D8CFC1;
  border-radius: 16px;
  overflow: hidden;
  background: #FEFEFE;
}

.table-head,
.product-row {
  display: grid;
  grid-template-columns: 80px 1fr 180px 190px 60px;
  align-items: center;
}

.table-head {
  background: #EEE8DC;
  font-size: 13px;
  font-weight: 900;
  color: #373435;
}

.table-head div {
  padding: 13px 10px;
  text-align: center;
}

.table-head div:nth-child(2) {
  text-align: left;
}

.product-row {
  border-top: 1px solid #E5DED2;
}

.product-row > div {
  padding: 8px 10px;
}

.row-number {
  display: grid;
  place-items: center;
  font-weight: 900;
}

.row-number span {
  width: 42px;
  height: 42px;
  border: 1px solid #D8CFC1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #FEFEFE;
}

.product-row input {
  height: 42px;
  padding: 8px 12px;
  border-radius: 11px;
  text-align: center;
}

.product-row .product-name {
  text-align: left;
}

.delete-row {
  width: 40px;
  height: 40px;
  border: 1px solid #ff8b8b;
  background: #FEFEFE;
  color: #e02626;
  border-radius: 11px;
  font-weight: 900;
  cursor: pointer;
}

.add-row-btn {
  margin-top: 16px;
  width: 100%;
  border: 1px dashed #F8B216;
  background: transparent;
  color: #373435;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.add-row-btn:hover {
  background: rgba(248, 178, 22, 0.16);
}

/* =========================
   ÇATDIRILMA VƏ QEYD
   ========================= */

.delivery-note-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 18px;
  margin-bottom: 18px;
}

.delivery-box input[type="date"] {
  margin-bottom: 12px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #373435;
  margin-bottom: 0;
}

.check-label input {
  width: auto;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

/* =========================
   ALT DÜYMƏLƏR
   ========================= */

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.order-actions button {
  border: none;
  border-radius: 17px;
  min-height: 64px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
}

.whatsapp-btn {
  background: #373435;
  color: #FEFEFE;
}

.whatsapp-btn::before {
  content: "● ";
  color: #25D366;
}

.invoice-btn {
  background: #F8B216;
  color: #373435;
  display: grid;
  place-items: center;
  line-height: 1.1;
}

.invoice-btn span {
  font-size: 12px;
  font-weight: 700;
}

.reset-btn {
  background: #373435;
  color: #FEFEFE;
}

.secure-note {
  text-align: center;
  font-size: 12px;
  color: rgba(55, 52, 53, 0.68);
}

/* =========================
   QAİMƏ MODAL
   ========================= */

.invoice-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(55, 52, 53, 0.82);
  z-index: 9999;
  padding: 20px;
  overflow: auto;
}

.invoice-modal.active {
  display: block;
}

.invoice-modal-panel {
  width: min(980px, 100%);
  margin: 0 auto;
  background: #FEFEFE;
  border-radius: 18px;
  overflow: hidden;
}

.invoice-toolbar {
  background: #373435;
  color: #FEFEFE;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.invoice-toolbar h3 {
  font-size: 17px;
}

.invoice-toolbar div {
  display: flex;
  gap: 10px;
}

.invoice-toolbar button {
  border: 1px solid rgba(254, 254, 254, 0.35);
  background: transparent;
  color: #FEFEFE;
  border-radius: 9px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}

.invoice-a4 {
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  background: #FEFEFE;
  border: 1px dashed #F8B216;
  padding: 22mm 18mm;
  color: #000;
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

/* =========================
   QAİMƏ İÇ GÖRÜNÜŞÜ
   ========================= */

.invoice-head {
  display: grid;
  grid-template-columns: 110px 1fr 180px;
  align-items: start;
  gap: 20px;
  margin-bottom: 26px;
}

.invoice-head img {
  width: 88px;
}

.invoice-head h2 {
  font-size: 22px;
  margin-top: 10px;
}

.invoice-number {
  text-align: right;
}

.invoice-number strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.invoice-customer {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #BEBEBE;
  padding: 8px;
}

.invoice-table th {
  background: #F7F4EE;
}

.invoice-table td:first-child,
.invoice-table th:first-child {
  width: 45px;
  text-align: center;
}

.invoice-table td:nth-child(3),
.invoice-table th:nth-child(3),
.invoice-table td:nth-child(4),
.invoice-table th:nth-child(4) {
  width: 120px;
  text-align: center;
}

.invoice-note {
  border: 1px solid #BEBEBE;
  min-height: 54px;
  padding: 9px;
  font-size: 13px;
  margin-bottom: 55px;
}

.invoice-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  margin-top: 35px;
  font-size: 13px;
}

.invoice-signatures div {
  border-top: 1px solid #000;
  padding-top: 8px;
  text-align: center;
}

/* =========================
   MOBİL KOMPAKT GÖRÜNÜŞ
   ========================= */

@media (max-width: 700px) {
  .order-page {
    padding: 8px;
  }

  .order-paper {
    padding: 14px;
    border-radius: 20px;
  }

  .order-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .order-brand-card {
    padding: 12px;
    gap: 12px;
  }

  .order-logo {
    width: 58px;
    height: 58px;
  }

  .order-brand-card h1 {
    font-size: 22px;
  }

  .order-brand-card p {
    font-size: 11px;
  }

  .order-info-stack {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .order-info-card {
    padding: 10px;
    border-radius: 12px;
  }

  .order-info-card span {
    font-size: 11px;
  }

  .order-info-card strong {
    font-size: 12px;
  }

  .customer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .form-group,
  .delivery-box,
  .note-box {
    padding: 10px;
    border-radius: 12px;
  }

  label {
    font-size: 11px;
    margin-bottom: 6px;
  }

  input,
  textarea {
    padding: 9px;
    font-size: 11px;
    border-radius: 10px;
  }

  .products-box {
    padding: 12px;
    border-radius: 16px;
  }

  .section-title h2 {
    font-size: 20px;
    letter-spacing: 2px;
  }

  #productCountBadge {
    font-size: 10px;
    padding: 6px 9px;
  }

  .table-head,
  .product-row {
    grid-template-columns: 38px minmax(0, 1fr) 58px 70px 36px;
  }

  .table-head div {
    padding: 8px 3px;
    font-size: 9px;
  }

  .product-row > div {
    padding: 5px 3px;
  }

  .row-number span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 11px;
  }

  .product-row input {
    height: 31px;
    padding: 5px;
    font-size: 10px;
    border-radius: 8px;
  }

  .delete-row {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 12px;
  }

  .add-row-btn {
    padding: 12px;
    font-size: 13px;
    border-radius: 12px;
  }
.add-row-btn * {
  font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
  .delivery-note-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  textarea {
    min-height: 68px;
  }

  .order-actions {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .order-actions button {
    min-height: 48px;
    border-radius: 12px;
    font-size: 12px;
    padding: 8px;
  }

  .invoice-btn span {
    font-size: 9px;
  }

  .secure-note {
    font-size: 10px;
  }

  .invoice-modal {
    padding: 8px;
  }

  .invoice-toolbar {
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-toolbar div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .invoice-a4 {
    width: 100%;
    min-height: auto;
    padding: 18px;
    overflow-x: auto;
  }
}

/* =========================
   PRINT
   ========================= */

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  body * {
    visibility: hidden !important;
  }

  .invoice-modal,
  .invoice-modal-panel,
  .invoice-a4,
  .invoice-a4 * {
    visibility: visible !important;
  }

  .invoice-modal {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  .invoice-modal-panel {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  .invoice-toolbar {
    display: none !important;
  }

  .invoice-a4 {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 18mm !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
    break-before: avoid !important;
    break-after: avoid !important;
  }
}

/* =========================
   FONT PROBLEMİ DÜZƏLİŞİ
   ========================= */

body,
button,
input,
textarea,
select {
  font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
}

.add-row-btn {
  font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  text-transform: none !important;
  font-variant: normal !important;
  font-feature-settings: normal !important;
  line-height: 1.2 !important;
}

.add-row-btn::first-letter {
  text-transform: none !important;
}

@media (max-width: 700px) {
  .order-table {
    overflow: visible !important;
  }

  .table-body {
    width: 100% !important;
  }

  .table-head,
  .product-row {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) 52px 60px 30px !important;
    width: 100% !important;
  }

  .table-head div,
  .product-row > div {
    min-width: 0 !important;
    padding: 4px 2px !important;
  }

  .product-row input {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 9px !important;
  }

  .product-row .product-name {
    font-size: 9px !important;
  }

  .row-number span {
    width: 24px !important;
    height: 28px !important;
    font-size: 10px !important;
  }

  .delete-row {
    width: 24px !important;
    height: 28px !important;
    font-size: 10px !important;
    padding: 0 !important;
  }
}


.add-row-btn span {
  display: inline-block;
  font-weight: 900;
  letter-spacing: 0 !important;
}

html,
body,
button,
input,
textarea,
select,
.add-row-btn,
.add-row-btn * {
  font-family: "Inter", Arial, "Segoe UI", sans-serif !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  text-transform: none !important;
}