/* تصميم الليبل المربع الجديد - 9سم × 9سم */

@media print {
  @page {
    size: 10cm 10cm;
    margin: 0.2cm;
  }
  
  body { 
    font-family: 'Arial', sans-serif; 
    margin: 0; 
    padding: 0; 
    color: #000; 
    background: white; 
    direction: rtl;
  }
  
  .label-page {
    width: 10cm;
    height: 10cm;
    box-sizing: border-box;
    background: white;
    position: relative;
    page-break-after: always;
  }
}

.square-label {
  width: 100%;
  height: 100%;
  border: 2px solid #1d4ed8;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  position: relative;
  background: white;
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
  gap: 6px;
  font-family: 'Arial', sans-serif;
  direction: rtl;
  overflow: hidden;
}

.qr-code-container {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

.qr-code {
  width: 60px;
  height: 60px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.label-header {
  text-align: center;
  margin-bottom: 12px;
  margin-top: 8px;
}

.company-name {
  font-size: 16px;
  font-weight: bold;
  color: #1d4ed8;
  margin-bottom: 2px;
}

.company-subtitle {
  font-size: 10px;
  color: #666;
}

.main-info {
  margin-bottom: 12px;
  text-align: center;
}

.order-id {
  font-size: 14px;
  font-weight: bold;
  color: #1d4ed8;
  margin-bottom: 4px;
}

.client-name {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}

.product-name {
  font-size: 11px;
  color: #333;
}

.product-details {
  margin-bottom: 12px;
  flex-grow: 1;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 10px;
  border-bottom: 1px dotted #ccc;
  padding-bottom: 2px;
}

.detail-row .label {
  font-weight: bold;
  color: #555;
}

.detail-row .value {
  color: #000;
}

.date-info {
  margin-bottom: 8px;
  font-size: 9px;
  text-align: center;
  color: #666;
}

.date-row {
  margin-bottom: 2px;
}

.label-footer {
  text-align: center;
  border-top: none;
  padding-top: 0;
  margin-top: auto;
}

.barcode-text {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: #666;
}

/* تحسينات للمعاينة */
@media screen {
  .square-label {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 6px;
    max-width: 300px;
    max-height: 300px;
    margin: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }
  
  .qr-code {
    width: 50px;
    height: 50px;
  }
  
  .company-name {
    font-size: 14px;
  }
  
  .order-id {
    font-size: 12px;
  }
  
  .client-name {
    font-size: 10px;
  }
  
  .product-name {
    font-size: 9px;
  }
  
  .detail-row {
    font-size: 8px;
  }
  
  .date-info {
    font-size: 7px;
  }
  
  .barcode-text {
    font-size: 6px;
  }
}

/* تحسينات للطباعة الحرارية */
@media print {
  * { 
    -webkit-print-color-adjust: exact !important; 
    print-color-adjust: exact !important; 
    color-adjust: exact !important; 
  }
  
  .square-label {
    border: 2px solid #000 !important;
  }
  
  .company-name {
    color: #000 !important;
  }
  
  .order-id {
    color: #000 !important;
  }
  
  .qr-code {
    border: 1px solid #000 !important;
  }
}
