/* ----------  فونت‌های محلی  ---------- */
@font-face {
    font-family: 'Vazir';
    src: url('/font/Vazir-Bold.woff2') format('woff2'),
         url('/font/Vazir-Bold.woff') format('woff');
    font-weight: bold;
}
@font-face {
    font-family: 'BNazanin';
    src: url('/font/BNazanin.woff') format('woff');
}
@font-face {
    font-family: 'BTitrBold';
    src: url('/font/BTitrBold.woff') format('woff');
}

   /* تنظیمات کلی */
        body {
            font-family: 'Tahoma', 'Segoe UI', sans-serif;
            
			 background-color: #454545;
            margin: 0;
            padding: 15px;
            color: #444;
            -webkit-text-size-adjust: 100%;
            padding-bottom: 120px; /* فاصله برای منوی شناور */
        }

        #invoice-box {
            background: white;
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
            padding: 25px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(20,30,40,0.05);
            box-sizing: border-box;
        }

        h2 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 25px;
            font-size: 1.6rem;
            font-weight: bold;
        }

        .form-group {
            margin-bottom: 18px;
            margin-top: 1px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: #444;
            font-size: 1.1rem;
        }

        input[type="text"],
        input[type="tel"],
        input[type="number"],
        textarea {
            width: 100%;
            padding: 14px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-family: inherit;
            font-size: 1.2rem;
            box-sizing: border-box;
            background-color: #fafafa;
            transition: all 0.3s;
        }

        input:focus, textarea:focus {
            border-color: #3498db;
            box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
            outline: none;
            background-color: #fff;
        }

        textarea {
            resize: vertical;
            min-height: 100px;
            font-size: 1.1rem;
        }

        .row {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 15px;
        }

        .col {
            flex: 1;
            min-width: 250px;
        }

        .section-title {
            background-color: #eef2f5;
            padding: 10px 15px;
            border-radius: 8px;
            color: #2c3e50;
            font-weight: bold;
            margin: 25px 0 15px 0;
            border-right: 5px solid #3498db;
            font-size: 1.3rem;
        }

        .page-footer {
            margin-top: 30px;
            text-align: center;
            padding-top: 20px;
            border-top: 2px solid #eee;
            color: #eeeeee;
            font-size: 1.2rem;
        }

        .page-footer a {
            color: #fff;
            text-decoration: none;
            font-weight: bold;
            font-size: 1.3rem;
        }
.print-header {
                display: flex !important; /* نمایش در چاپ */
                
		 justify-content: space-between;
                align-items: center;
                padding: 5px 5px;
                background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
                color: white;
                border-radius: 10px;
                margin-bottom: 10px;
                box-shadow: 0 4px 10px rgba(0,0,0,0.1);
                border: 2px solid #fff;
                position: relative;
                overflow: hidden;

       /* display:  none;*/


            }

 .page-container {
 page-break-before: always;
 		break-before: page;          
        background-color: #454545; /* پس‌زمینه کارت کمی روشن‌تر از بدنه */
           /* width: 100%;
 	    height: 100%;*/
 		height: 1060px;
            max-width: 800px; /* عرض حداکثر برای کارت‌ها 
            max-height: 1300px;*/
	 margin-bottom: 20px;
            border-radius: 10px;
            overflow: hidden; /* برای اینکه گوشه‌های گرد خراب نشن */
            box-shadow: 0 10px 25px rgba(0,0,0,0.5);
            /* page-break-after: always;*/
 	   
          /*   break-after: page;*/
            display: flex;
            flex-direction: column;
        }

        /* --- بخش نمایش عکس‌ها --- */
        #all-image-previews {
            margin-top: 15px;
        }

        .preview-section {
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px dashed #eee;


        }
  

        .preview-section:last-child {
            border-bottom: none;
        }

        .preview-section h4 {
            margin: 0 0 10px 0;
            color: #555;
            font-size: 1rem;
            border-bottom: 1px solid #ddd;
            padding-bottom: 5px;
        }
  .preview-section h2 {
            margin: 0 0 10px 0;
            color: #fff;
            font-size: 1.3rem;
            border-bottom: 1px solid #000;
            padding-bottom: 5px;
        }
        .preview-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .preview-item {
            max-width: 1000px;
         
            max-height: 1500px;
            object-fit: cover;
            border-radius: 6px;
            border: 2px solid #888;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            filter: contrast(1.2) brightness(1.09);
aspect-ratio: auto; 
        }

        .page-break {
            page-break-before: always;
            break-before: page;
            height: 10px;
            margin: 20px 0;
            border-top: 1px dashed #ccc;
        }

        /* --- منوی شناور --- */
        .floating-menu {
            position: fixed;
            bottom: 6px;
            left: 50%;
            transform: translateX(-50%);
            width: 85%;
            max-width: 600px;
            background: rgba(100, 100, 100, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            padding: 5px;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            z-index: 1000;
            border: 1px solid rgba(255,255,255,0.5);
        }

        .upload-btn-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
            flex: 1 1 auto;
            min-width: 100px;
        }

        .upload-btn-wrapper input[type=file] {
            font-size: 100px;
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            cursor: pointer;
            width: 100%;
            height: 100%;
        }

        .btn {
            background: linear-gradient(135deg, #666666 0%, #111111 100%);
            color: white;
            border: none;
            padding: 10px 10px;
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: bold;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 4px 6px rgba(0,0,0,0.2);
            transition: transform 0.2s, box-shadow 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            line-height: 1.2;
            height: 45px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }

        .btn span {
            font-size: 1.1rem;
            margin-bottom: 4px;
        }

        .btn-pdf {
            background: linear-gradient(135deg, #242424 0%, #dddddd 100%);
            flex: 2 1 120px;
            min-width: 100px;
        }

        .btn-pdf:hover {
            box-shadow: 0 6px 12px rgba(56, 239, 125, 0.4);
        }

        .no-print {
            display: block !important;
        }

        /* --- تنظیمات مخصوص چاپ (مهم‌ترین بخش) --- */
        @media print {
            /* حذف پس‌زمینه و حاشیه‌های اضافی */
            body {
                background: white;
                margin: 0;
                padding: 0;
                -webkit-print-color-adjust: exact; /* برای چاپ دقیق رنگ‌ها */
                print-color-adjust: exact;
            }

            /* تنظیم کانتینر اصلی برای چاپ */
        #invoice-box {
            background: white;
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(20,30,40,0.05);
            box-sizing: border-box;
        }

            /* حذف منوی شناور */
            .floating-menu {
                display: none !important;
            }

            /* استایل فرم‌ها در چاپ (حذف کادرهای رنگی) */
            input, textarea {
                border: none;
                border-bottom: 1px solid #ccc;
                border-radius: 0;
                background: transparent;
                padding: 5px 0;
                font-size: 1.1rem;
                box-shadow: none;
            }

            /* حذف سایه و رنگ پس‌زمینه تیترها */
            .section-title {
                background-color: transparent;
                border: none;
                border-bottom: 2px solid #333;
                margin-top: 15px;
                padding: 0;
                color: #000;
            }

            /* تنظیم حاشیه‌های چاپگر */
            @page {
                size: A4;
                margin: 5mm; /* حاشیه استاندارد A4 */
            }
        }

      .page-header {
            display: flex ;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
            color: white;
            border-radius: 10px;
            margin-bottom: 25px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
            border: 2px solid #fff;
            position: relative;
            overflow: hidden;
        }
 
        /* افکت تزئینی برای زیبایی */
        .page-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(90deg, #f1c40f, #e67e22, #e74c3c);
        }

        .header-title {
            font-size: 1.4rem;
            font-weight: bold;
            text-align: right;
            direction: rtl;
        }

        .header-date {
            font-size: 1.1rem;
            font-weight: normal;
            text-align: left;
            direction: ltr; /* برای نمایش صحیح تاریخ */
            background: rgba(255,255,255,0.2);
            padding: 5px 15px;
            border-radius: 20px;
        }


      /* کانتینر اصلی برای نگهداری گرید عکس‌ها */
        .image-container {
            width: 100%;
            max-width: 800px; /* حداکثر عرض کادر */
            display: flex;
            flex-wrap: wrap;
            gap: 15px; /* فاصله بین عکس‌ها */
            justify-content: center; /* وسط‌چین کردن کل گرید */
        }

        /* استایل هر آیتم عکس */
        .preview-item {
            /* تنظیم ارتفاع ثابت */ height: auto; 
           
	
           
 width: 98%;
    max-width: 100%;
    height: auto;
 max-height: 225mm;
   /* max-height: 100vh;*/
    object-fit: contain;
    display: block;
    margin: 0 auto;



  border: 2px solid #666;
            border-radius: 15px;
            box-shadow: 0 7px 8px rgba(0,0,0,0.2);




   
   

        }

        /* اگر می‌خواهید عرض عکس‌ها در موبایل محدودتر شود تا از کادر بیرون نزند */
        @media (max-width: 600px) {
            .preview-item {
                max-width: 100%; /* در موبایل عرض را 100% کادر می‌کنیم اما ارتفاع ثابت می‌ماند */

            }
        }

