@font-face {
    font-family: 'iranyekanwebextrablackfanum';

    src:
        url('iranyekanwebextrablackfanum.woff')
            format('woff'),

        url('iranyekanwebextrablackfanum.ttf');

        
    font-weight: 900;

    font-style: normal;

    font-display: swap;
}

@font-face {
    font-family: 'iranyekanwebboldfanum';

    src:
        url('iranyekanwebboldfanum.woff')
            format('woff'),

        url('iranyekanwebboldfanum.ttf');

        
    font-weight: 600;

    font-style: normal;

    font-display: swap;
}

@font-face {
    font-family: 'iranyekanwebmediumfanum';

    src:
        url('iranyekanwebmediumfanum.woff')
            format('woff'),

        url('iranyekanwebmediumfanum.ttf');

        
    font-weight: 300;

    font-style: normal;

    font-display: swap;
}

/* =========================================================
   FARAZ POSTAL LABEL
   RESET
========================================================= */

.faraz-post-label-app {
    width: 100%;
    min-height: 100vh;
    padding: 30px;
    background: #f1f1f1;
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    box-sizing: border-box;
}

.faraz-post-label-app *,
.faraz-post-label-app *::before,
.faraz-post-label-app *::after {
    box-sizing: border-box;
}


/* =========================================================
   BUILDER
========================================================= */

.faraz-builder {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(430px, 560px);

    gap: 28px;
    align-items: start;
}


/* =========================================================
   PREVIEW PANEL
========================================================= */

.faraz-preview-panel {
    width: 100%;
    min-width: 0;
}

.faraz-preview-title {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
    padding: 0 5px;
}

.faraz-preview-title span {
    font-size: 18px;
    font-weight: 900;
    color: #222;
}

.faraz-preview-title small {
    font-size: 12px;
    color: #777;
}


/* =========================================================
   PREVIEW STAGE
========================================================= */

.faraz-preview-stage {
    width: 100%;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: 35px;

    background:
        linear-gradient(
            135deg,
            #e8e8e8,
            #f6f6f6
        );

    border: 1px solid #ddd;
    border-radius: 18px;

    overflow: auto;
}


/* =========================================================
   POSTAL LABEL
   EXACT 13.5 × 9.5 CM
========================================================= */

.faraz-postal-label {

    width: 13.5cm !important;
    height: 9.5cm !important;

    min-width: 13.5cm !important;
    min-height: 9.5cm !important;

    max-width: 13.5cm !important;
    max-height: 9.5cm !important;

    flex: 0 0 13.5cm;

    position: relative;
    overflow: hidden;

    border: 10px solid transparent;

    /*
       حاشیه قرمز و آبی
       به صورت gradient
       تا در html2canvas نیز ذخیره شود
    */

    background:

        linear-gradient(
            #ffffff,
            #ffffff
        ) padding-box,

        repeating-linear-gradient(
            135deg,

            #d92312 0px,
            #d92312 17px,

            #ffffff 17px,
            #ffffff 28px,

            #36a9e8 28px,
            #36a9e8 45px,

            #ffffff 45px,
            #ffffff 56px
        ) border-box;

    color: #111;

    direction: rtl;

    font-family:
        Tahoma,
        Arial,
        sans-serif;

    padding:
        .30cm
        .35cm
        .22cm;

    box-shadow:
        0 8px 28px rgba(0,0,0,.18);

    isolation: isolate;
}


/* =========================================================
   HEADER
========================================================= */

.faraz-label-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-sizing: border-box;
}


/* =========================================
   SOCIAL IMAGE
========================================= */

.faraz-social-icon {

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

}


.faraz-social-icon img {

    width: 70px !important;

    height: 70px !important;

    max-width: 70px !important;

    max-height: 70px !important;

    object-fit: contain !important;

    display: block !important;

    margin: 0 !important;

    padding: 0 !important;

}


/* =========================================
   SOCIAL TITLE
========================================= */

.faraz-social-title {

    width: 100%;

    margin-top: 2px;

    font-size: 5px;

    font-weight: 600;

    color: #333;

    line-height: 1.2;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


/* =========================================
   CENTER LOGO
========================================= */

.faraz-label-logo {
    width: 90px;
    height: 62px;

    flex: 0 0 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    box-sizing: border-box;
}



/* تصویر لوگو */

.faraz-label-logo img {

    width: auto !important;

    height: auto !important;

    max-width: 150px !important;

    max-height: 58px !important;

    object-fit: contain !important;

    display: block !important;

    margin: 0 !important;

    padding: 0 !important;

}


/* =========================================
   HEADER LINE
========================================= */

.faraz-header-line {

    width: 100%;

    height: 2px;

    margin-top: 6px;

    background: #1b1b1d;

}

/* =========================================================
   QR
========================================================= */

.faraz-qr-box {

    width: 1.95cm;
    height: 1.95cm;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff;

    border:
        1px solid #d8d8d8;

    border-radius: 11px;

    overflow: hidden;

    font-size: 9px;
    font-weight: 900;

    color: #333;
}

.faraz-qr-box img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* =========================================
   LOGO CENTER
========================================= */

.faraz-label-logo {
    flex: 1;

    min-width: 0;
    min-height: 0;

    height: 60px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}


/* تصویر لوگو */

.faraz-label-logo img {
    display: block;

    width: auto;
    height: auto;

    max-width: 160px;
    max-height: 55px;

    object-fit: contain;
}
.faraz-logo-placeholder {

    width: 3.2cm;
    height: 1.25cm;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #444;

    font-size: 14px;
    font-weight: 900;

    text-align: center;
}


/* =========================================================
   HEADER LINE
========================================================= */

.faraz-header-line {

    width: 100%;
    height: 1px;

    margin-top: .38cm;
    margin-bottom: .20cm;

    background: #111;
}


/* =========================================================
   PERSON SECTION
========================================================= */

.faraz-person-section {

    width: 100%;

    border:
        1px solid #111;

    background: #fff;

    padding: 0;
}


/* =========================================================
   SECTION TITLE
========================================================= */

.faraz-section-title {
    display: none !important;
}


/* =========================================================
   INFO LINE
========================================================= */

.faraz-info-line {

    width: 100%;

    min-height: .47cm;

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 0;

    align-items: center;

    border-bottom:
        1px solid #111;
}

.faraz-info-line:last-child {
    border-bottom: 0;
}


/* =========================================================
   ADDRESS
========================================================= */
.faraz-address-line {
    width: 100%;
    display: block;
}


.faraz-address-line .faraz-full-item {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    box-sizing: border-box;
}

.faraz-address-line .faraz-value {
    flex: 1;
    min-width: 0;
    max-width: 100%;

    /* شکستن صحیح آدرس */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;

    /* حداکثر ۲ خط */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* ارتفاع مناسب برای دو خط */
    line-height: 1.45;
    max-height: 2.9em;

    box-sizing: border-box;
}

/* =========================================================
   INFO ITEM
========================================================= */

.faraz-info-item {

    width: 100%;
    min-width: 0;

    min-height: .47cm;

    display: flex;

    align-items: center;

    gap: 5px;

    padding:
        2px 7px;

    line-height: 1.3;
}


/* خط وسط */

.faraz-info-line
.faraz-info-item:first-child {

    border-left:
        1px solid #111;
}


/* آدرس خط وسط نداشته باشد */

.faraz-address-line
.faraz-info-item:first-child {

    border-left: 0;
}


/* =========================================================
   TITLES
   این بخش ثابت است و با سایز متن ها تغییر نمی کند
========================================================= */

/* =========================================================
   RECEIVER
========================================================= */

.recipient-name-value {

    font-size:
        var(
            --faraz-name-size,
            13px
        );
}

.recipient-city-value {

    font-size:
        var(
            --faraz-city-size,
            12px
        );
}

.recipient-address-value {

    font-size:
        var(
            --faraz-address-size,
            11px
        );
}

.recipient-postcode-value {

    font-size:
        var(
            --faraz-postcode-size,
            12px
        );

    direction: ltr;

    text-align: right;
}

.recipient-phone-value {

    font-size:
        var(
            --faraz-phone-size,
            12px
        );

    direction: ltr;

    text-align: right;
}


/* =========================================================
   SENDER
========================================================= */

.sender-name-value {

    font-size:
        var(
            --faraz-sender-name-size,
            12px
        );
}

.sender-address-value {

    font-size:
        var(
            --faraz-sender-address-size,
            10px
        );
}

.sender-postcode-value {

    font-size:
        var(
            --faraz-sender-postcode-size,
            11px
        );

    direction: ltr;

    text-align: right;
}

.sender-phone-value {

    font-size:
        var(
            --faraz-sender-phone-size,
            11px
        );

    direction: ltr;

    text-align: right;
}


/* =========================================================
   DIVIDER
========================================================= */

.faraz-section-divider {

    width: 100%;
    height: 7px;

    background: #fff;

    border-left:
        1px solid #111;

    border-right:
        1px solid #111;
}


/* =========================================================
   FOOTER
========================================================= */

.faraz-label-footer {

    position: absolute;

    left: .35cm;
    right: .35cm;
    bottom: .27cm;

    width:
        calc(100% - .70cm);

    display: flex;

    align-items: center;

    justify-content: space-between;

}


/* =========================================================
   FOOTER TEXT
========================================================= */

.faraz-footer-text {

    flex: 1;

    text-align: center;

    font-size: 8px;

    color: #222;

    font-weight: 500;
}


/* =========================================================
   POST ID
========================================================= */

.faraz-post-id {

    display: flex;

    align-items: center;

    gap: 5px;

    padding-right: 5px;

    direction: rtl;
}

.faraz-post-id span {

    font-size: 7px;

    color: #333;
}

.faraz-post-id strong {

    font-size: 9px;

    color: #111;

    direction: ltr;
}


/* =========================================================
   BOTTOM BORDER
========================================================= */

.faraz-bottom-border {

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;
}


/* =========================================================
   DATA PANEL
========================================================= */

.faraz-data-panel {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 16px;
}


/* =========================================================
   FORM CARD
========================================================= */

.faraz-form-card {

    width: 100%;

    padding: 20px;

    background: #fff;

    border:
        1px solid #dedede;

    border-radius: 17px;

    box-shadow:
        0 6px 22px rgba(0,0,0,.06);
}


/* =========================================================
   CARD HEADER
========================================================= */

.faraz-card-header {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 17px;

    padding-bottom: 13px;

    border-bottom:
        1px solid #ededed;
}

.faraz-card-icon {

    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #f2f2f2;

    border-radius: 12px;

    font-size: 20px;
}

.faraz-card-header h3 {

    margin:
        0 0 3px;

    font-size: 16px;

    font-weight: 900;

    color: #222;
}

.faraz-card-header p {

    margin: 0;

    font-size: 11px;

    color: #888;
}


/* =========================================================
   FIELD
========================================================= */

.faraz-field {

    width: 100%;

    margin-bottom: 13px;
}

.faraz-field:last-child {
    margin-bottom: 0;
}

.faraz-field > label {
    font-family: 'iranyekanwebboldfanum';
    display: block;

    margin-bottom: 6px;

    font-size: 15px;

    font-weight: 600;

    color: #333;
}


/* =========================================================
   INPUT + SIZE
========================================================= */

.faraz-input-with-size {

    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0,1fr)
        auto;

    gap: 8px;

    align-items: stretch;
}


/* =========================================================
   INPUT
========================================================= */

.faraz-post-label-app
input[type="text"],

.faraz-post-label-app
textarea,

.faraz-post-label-app
select {

    width: 100%;
    max-width: 100%;

    border:
        1px solid #ddd;

    background: #fafafa;

    color: #222;

    border-radius: 10px;

    outline: none;

    font-family: inherit;

    font-size: 13px;

    transition:
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}


.faraz-post-label-app
input[type="text"],

.faraz-post-label-app
select {

    height: 44px;

    padding:
        0 13px;
    font-family: 'iranyekanwebboldfanum';
}


.faraz-post-label-app
textarea {

    min-height: 78px;

    padding:
        10px 13px;

    line-height: 1.8;

    resize: vertical;
    font-family: 'iranyekanwebboldfanum';
}


.faraz-post-label-app
input[type="text"]:focus,

.faraz-post-label-app
textarea:focus,

.faraz-post-label-app
select:focus {

    border-color: #222;

    background: #fff;

    box-shadow:
        0 0 0 3px rgba(0,0,0,.04);
}


/* =========================================================
   SIZE CONTROL
========================================================= */

.faraz-size-control {

    min-width: 86px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 4px;

    padding:
        5px 7px;

    background: #f7f7f7;

    border:
        1px solid #e4e4e4;

    border-radius: 10px;
}

.faraz-size-control span {

    font-size: 9px;

    color: #777;

    white-space: nowrap;
}

.faraz-size-control input {

    width: 38px !important;

    height: 30px !important;

    padding:
        0 3px !important;

    border:
        1px solid #d5d5d5 !important;

    border-radius: 7px !important;

    background: #fff !important;

    text-align: center;

    font-size: 11px !important;

    font-family:
        Tahoma,
        Arial,
        sans-serif !important;
}

.faraz-size-control b {

    font-size: 8px;

    color: #888;
}


/* =========================================================
   HELP
========================================================= */

.faraz-help {

    display: block;

    margin-top: 5px;

    font-size: 10px;

    line-height: 1.7;

    color: #999;
}


/* =========================================================
   CUSTOM FONT
========================================================= */

#faraz-custom-font-box {

    display: none;

    margin-top: 10px;
}


/* =========================================================
   ACTIONS
========================================================= */

.faraz-action-card {

    width: 100%;

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 10px;

    padding: 13px;

    background: #fff;

    border:
        1px solid #dedede;

    border-radius: 16px;
}


.faraz-btn {

    width: 100%;

    height: 47px;

    border: 0;

    border-radius: 11px;

    cursor: pointer;

    font-family: inherit;

    font-size: 13px;

    font-weight: 900;

    transition:
        transform .2s ease,
        opacity .2s ease;
}


.faraz-btn:hover {

    transform:
        translateY(-2px);
}


.faraz-btn:disabled {

    opacity: .6;

    cursor: wait;

    transform: none;
}


.faraz-btn-save {

    background: #222;

    color: #fff;
}


.faraz-btn-print {

    background: #f2f2f2;

    color: #222;

    border:
        1px solid #ddd;
}


/* =========================================================
   FIXED POST ID
========================================================= */

.faraz-fixed-info {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        11px 15px;

    background: #fafafa;

    border:
        1px solid #e2e2e2;

    border-radius: 11px;
}


.faraz-fixed-info span {

    font-size: 11px;

    color: #777;
}


.faraz-fixed-info strong {

    font-size: 12px;

    color: #222;

    direction: ltr;
}


/* =========================================================
   LARGE TABLET
========================================================= */

@media (max-width: 1200px) {

    .faraz-post-label-app {

        padding: 20px;
    }


    .faraz-builder {

        grid-template-columns:
            minmax(0,1fr)
            minmax(360px,450px);

        gap: 20px;
    }


    .faraz-preview-stage {

        padding: 25px;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 950px) {

    .faraz-builder {

        grid-template-columns: 1fr;

        gap: 22px;
    }


    .faraz-preview-panel {

        order: 1;
    }


    .faraz-data-panel {

        order: 2;
    }


    .faraz-preview-stage {

        min-height: auto;

        justify-content: center;

        overflow-x: auto;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .faraz-post-label-app {

        padding: 8px;
    }


    .faraz-preview-title {

        padding: 0 2px;

        flex-direction: column;

        align-items: flex-start;

        gap: 3px;
    }


    .faraz-preview-title span {

        font-size: 16px;
    }


    .faraz-preview-title small {

        font-size: 10px;
    }


    .faraz-preview-stage {

        width: 100%;

        min-height: 0;

        padding:
            15px 8px;

        justify-content:
            flex-start;

        border-radius: 12px;
    }


    .faraz-postal-label {

        flex:
            0 0 13.5cm;
    }


    .faraz-form-card {

        padding: 15px;

        border-radius: 14px;
    }


    .faraz-input-with-size {

        grid-template-columns: 1fr;
    }


    .faraz-size-control {

        width: 100%;

        min-width: 0;

        justify-content:
            flex-start;
    }


    .faraz-action-card {

        grid-template-columns: 1fr;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .faraz-post-label-app {

        padding: 5px;
    }


    .faraz-preview-stage {

        padding:
            10px 5px;
    }


    .faraz-form-card {

        padding: 12px;
    }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

    html,
    body {

        width: 13.5cm !important;

        height: 9.5cm !important;

        min-width: 13.5cm !important;

        min-height: 9.5cm !important;

        max-width: 13.5cm !important;

        max-height: 9.5cm !important;

        margin: 0 !important;

        padding: 0 !important;

        overflow: hidden !important;

        background: #fff !important;
    }


    body {

        -webkit-print-color-adjust:
            exact !important;

        print-color-adjust:
            exact !important;
    }


    body * {

        visibility:
            hidden !important;
    }


    #faraz-postal-label,
    #faraz-postal-label * {

        visibility:
            visible !important;
    }


    #faraz-postal-label {

        position: absolute !important;

        left: 0 !important;

        top: 0 !important;

        width: 13.5cm !important;

        height: 9.5cm !important;

        min-width: 13.5cm !important;

        min-height: 9.5cm !important;

        max-width: 13.5cm !important;

        max-height: 9.5cm !important;

        margin: 0 !important;

        padding:
            .30cm .35cm .22cm !important;

        overflow: hidden !important;

        box-shadow: none !important;

        transform: none !important;
    }


    .faraz-post-label-app {

        width: 13.5cm !important;

        height: 9.5cm !important;

        min-height: 0 !important;

        margin: 0 !important;

        padding: 0 !important;

        background: #fff !important;
    }


    .faraz-preview-panel,
    .faraz-preview-stage {

        width: 13.5cm !important;

        height: 9.5cm !important;

        min-height: 0 !important;

        margin: 0 !important;

        padding: 0 !important;

        background: #fff !important;

        border: 0 !important;

        overflow: visible !important;
    }


    .faraz-preview-title,
    .faraz-data-panel {

        display: none !important;
    }


    @page {

        size:
            13.5cm 9.5cm;

        margin: 0 !important;
    }

}


/* =========================================================
   FARAZ POSTAL LABEL
   COMPLETE CSS
========================================================= */


/* =========================================================
   RESET - فقط داخل ابزار
========================================================= */

.faraz-post-label-app,
.faraz-post-label-app * {
    box-sizing: border-box;
}


/* =========================================================
   MAIN APP
========================================================= */

.faraz-post-label-app {
    width: 100%;

    direction: rtl;

    font-family: Tahoma, Arial, sans-serif;

    color: #1b1b1d;

    background: #f4f5f7;

    padding: 25px;

    min-height: 100vh;
}


/* =========================================================
   BUILDER
========================================================= */

.faraz-builder {
    width: 100%;
    max-width: 1450px;

    margin: 0 auto;

    display: grid;

    grid-template-columns: minmax(500px, 1fr) minmax(360px, 470px);

    gap: 25px;

    align-items: start;
}


/* =========================================================
   PREVIEW AREA
========================================================= */

.faraz-preview-area {

    min-width: 0;

    position: sticky;

    top: 20px;
}


.faraz-preview-title {

    font-size: 18px;

    font-weight: 800;

    color: #1b1b1d;

    margin-bottom: 14px;

    text-align: center;
}


/* =========================================================
   PREVIEW STAGE
========================================================= */

.faraz-preview-stage {

    width: 100%;


    padding: 35px;

    display: flex;

    align-items: flex-start;

    justify-content: center;

    overflow: auto;

    background:
        linear-gradient(
            45deg,
            #eeeeee 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #eeeeee 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #eeeeee 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #eeeeee 75%
        );

    background-size: 25px 25px;

    background-position:
        0 0,
        0 12.5px,
        12.5px -12.5px,
        -12.5px 0;

    border-radius: 18px;

    box-shadow:
        inset 0 0 0 1px #ddd;

}


/* =========================================================
   POSTAL LABEL
   EXACT SIZE: 13.5 × 9.5 CM
========================================================= */

.faraz-postal-label {

    width: 13.5cm;

    height: 9.5cm;

    min-width: 13.5cm;

    min-height: 9.5cm;

    position: relative;

    overflow: hidden;

    direction: rtl;

    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        repeating-linear-gradient(
            135deg,
            #d71920 0px,
            #d71920 8px,
            #ffffff 8px,
            #ffffff 16px,
            #174ea6 16px,
            #174ea6 24px,
            #ffffff 24px,
            #ffffff 32px
        ) border-box;

    border: 9px solid transparent;

    border-radius: 2px;

    padding: 9px 11px 7px;

    color: #1b1b1d;

    font-family:
        Tahoma,
        Arial,
        sans-serif;

    box-shadow:
        0 8px 30px rgba(0,0,0,.18);

    display: flex;

    flex-direction: column;
}


/* =========================================================
   HEADER
========================================================= */

.faraz-label-header {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;


    flex: 0 0 auto;
}

/* =========================================================
   SOCIAL IMAGE
========================================================= */

.faraz-social-icon {

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;
}


.faraz-social-icon img {

    display:flex;
    align-items:center;
    min-height:90px;
    border-bottom:1px solid #000;
    padding:0px 0px 12px 0px;
    margin-bottom:16px;

}


.social-box {
    padding: 5px;
    width: 140px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-sizing: border-box;
    margin: 0 auto;
}

.social-box1 {
    padding: 10px;
    width: 140px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-sizing: border-box;
    margin: 0 auto;
}


.social-box2 {
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-sizing: border-box;
    margin: 0 auto;
}
/* =========================================================
   SOCIAL TITLE
========================================================= */

.faraz-social-title {

    width: 100%;

    margin-top: 2px;

    font-size: 5px;

    font-weight: 600;

    color: #333;

    line-height: 1.2;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   CENTER LOGO
========================================================= */

.faraz-label-logo {

    width: 100px;

    height: 62px;

    flex: 0 0 100px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    box-sizing: border-box;
}


.faraz-label-logo img {

    width: auto !important;

    height: auto !important;

    max-width: 100px !important;

    max-height: 58px !important;

    object-fit: contain !important;

    display: block !important;

    margin: 0 !important;

    padding: 0 !important;
}


/* =========================================================
   HEADER LINE
========================================================= */

.faraz-header-line {

    width: 100%;

    height: 1.5px;

    flex: 0 0 1.5px;

    margin-top: 5px;

    margin-bottom: 5px;

    background: #1b1b1d;
}


/* =========================================================
   PERSON SECTION
========================================================= */

.faraz-person-section {

    width: 100%;

    flex: 0 0 auto;

    padding: 2px 0;
}


/* =========================================================
   SECTION TITLE
========================================================= */

.faraz-section-title {

    width: 100%;

    font-size: 8px;

    font-weight: 800;

    color: #174ea6;

    border-right: 3px solid #d71920;

    padding-right: 6px;

    margin-bottom: 4px;

    line-height: 1.5;
}


/* =========================================================
   INFO LINE
========================================================= */

.faraz-info-line {

    width: 100%;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-bottom: 3px;
}


/* =========================================================
   ADDRESS LINE
========================================================= */

.faraz-address-line {

    grid-template-columns: 1fr;
}


/* =========================================================
   INFO ITEM
========================================================= */

.faraz-info-item {

    min-width: 0;

    display: flex;

    align-items: baseline;

    gap: 4px;

    line-height: 1.5;


    padding-bottom: 2px;
}


.faraz-full-item {

    width: 100%;
}


/* =========================================================
   LABEL TITLES
   این اندازه ثابت است
========================================================= */

.faraz-title {

    font-family: 'iranyekanwebboldfanum';
    flex: 0 0 auto;

    font-size: 14px !important;

    font-weight: 800;

    color: #555;

    white-space: nowrap;
}


/* =========================================================
   VALUES
   فقط مقدار تغییر اندازه می‌دهد
========================================================= */

.faraz-value {

    min-width: 0;

    flex: 1;

    display: block;
    font-family: 'iranyekanwebboldfanum';

    font-weight: 600;

    color: #111;

    line-height: 1.5;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   RECEIVER FONT SIZES
========================================================= */

.recipient-name-value {

    font-size: var(--faraz-name-size, 13px);
}


.recipient-city-value {

    font-size: var(--faraz-city-size, 12px);
}


.recipient-address-value {

    font-size: var(--faraz-address-size, 11px);

    white-space: nowrap;
}


.recipient-postcode-value {

    font-size: var(--faraz-postcode-size, 12px);

    direction: ltr;

    text-align: right;

    unicode-bidi: plaintext;
}


.recipient-phone-value {

    font-size: var(--faraz-phone-size, 12px);

    direction: ltr;

    text-align: right;

    unicode-bidi: plaintext;
}


/* =========================================================
   SENDER FONT SIZES
========================================================= */

.sender-name-value {

    font-size: var(--faraz-sender-name-size, 12px);
}


.sender-address-value {

    font-size: var(--faraz-sender-address-size, 10px);

    white-space: nowrap;
}


.sender-postcode-value {

    font-size: var(--faraz-sender-postcode-size, 11px);

    direction: ltr;

    text-align: right;

    unicode-bidi: plaintext;
}


.sender-phone-value {

    font-size: var(--faraz-sender-phone-size, 11px);

    direction: ltr;

    text-align: right;

    unicode-bidi: plaintext;
}


/* =========================================================
   DIVIDER
========================================================= */

.faraz-section-divider {

    width: 100%;

    height: 1px;

    flex: 0 0 1px;

    margin: 3px 0;

    background:
        repeating-linear-gradient(
            to left,
            #174ea6 0,
            #174ea6 8px,
            transparent 8px,
            transparent 12px
        );
}


/* =========================================================
   FOOTER
========================================================= */

.faraz-label-footer {


    margin-top: auto;

    display: flex;

    align-items: center;

    justify-content: space-between;;
}


/* =========================================================
   FOOTER TEXT
========================================================= */

.faraz-footer-text {

    min-width: 0;

    flex: 1;

    font-size: 7px;

    font-weight: 600;

    color: #555;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


#preview-footer-text {

    display: block;
}


/* =========================================================
   POST ID
========================================================= */

.faraz-post-id {

    flex: 0 0 auto;

    display: flex;

    align-items: center;

    gap: 3px;

    direction: ltr;

    font-size: 7px;

    color: #555;

    white-space: nowrap;
}


.faraz-post-id strong {

    font-size: 8px;

    color: #111;

    font-weight: 800;
}


/* =========================================================
   BOTTOM BORDER
========================================================= */

.faraz-bottom-border {

    width: 100%;

    height: 3px;

    flex: 0 0 3px;

    margin-top: 4px;

    background:
        repeating-linear-gradient(
            135deg,
            #d71920 0px,
            #d71920 7px,
            #fff 7px,
            #fff 14px,
            #174ea6 14px,
            #174ea6 21px,
            #fff 21px,
            #fff 28px
        );
}


/* =========================================================
   DATA PANEL
========================================================= */

.faraz-data-panel {

    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 15px;
}


/* =========================================================
   FORM CARD
========================================================= */

.faraz-form-card {

    width: 100%;

    padding: 18px;

    background: #fff;

    border: 1px solid #e1e3e6;

    border-radius: 16px;

    box-shadow:
        0 5px 20px rgba(0,0,0,.06);
}


/* =========================================================
   FORM CARD TITLE
========================================================= */

.faraz-form-card-title {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 16px;

    font-weight: 800;

    color: #1b1b1d;

    padding-bottom: 12px;

    margin-bottom: 14px;

    border-bottom: 1px solid #eee;
}


.faraz-form-card-title span {

    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    background: #f1f4f8;

    font-size: 16px;
}


/* =========================================================
   INPUT ROW
========================================================= */

.faraz-input-row {

    width: 100%;

    display: grid;

    grid-template-columns: minmax(0, 1fr) 75px;

    gap: 10px;

    margin-bottom: 12px;

    align-items: end;
}


.faraz-input-row:last-child {

    margin-bottom: 0;
}


/* =========================================================
   INPUT CONTENT
========================================================= */

.faraz-input-content {

    min-width: 0;
}


.faraz-input-content label,
.faraz-custom-font-box label {

    display: block;

    font-size: 12px;

    font-weight: 700;

    color: #444;

    margin-bottom: 6px;
}


/* =========================================================
   INPUTS
========================================================= */

.faraz-input-content input,
.faraz-input-content textarea,
.faraz-setting-row input,
.faraz-setting-row select,
.faraz-custom-font-box input {

    width: 100%;

    border: 1px solid #d9dde3;

    border-radius: 9px;

    background: #fafbfc;

    color: #222;

    outline: none;

    font-family: inherit;

    font-size: 13px;

    padding: 10px 11px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}


.faraz-input-content input {

    height: 42px;
}


.faraz-input-content textarea {

    min-height: 70px;

    resize: vertical;

    line-height: 1.7;
}


.faraz-input-content input:focus,
.faraz-input-content textarea:focus,
.faraz-setting-row input:focus,
.faraz-setting-row select:focus,
.faraz-custom-font-box input:focus {

    border-color: #174ea6;

    background: #fff;

    box-shadow:
        0 0 0 3px rgba(23,78,166,.08);
}


/* =========================================================
   SMALL HELP TEXT
========================================================= */

.faraz-input-content small {

    display: block;

    margin-top: 5px;

    font-size: 10px;

    color: #888;

    line-height: 1.5;
}


/* =========================================================
   SIZE CONTROL
========================================================= */

.faraz-size-control {

    width: 75px;
}


.faraz-size-control label {

    display: block;

    font-size: 10px;

    color: #777;

    margin-bottom: 6px;

    text-align: center;
}


.faraz-size-control input {

    width: 100%;

    height: 42px;

    padding: 5px;

    border: 1px solid #d9dde3;

    border-radius: 9px;

    background: #fafbfc;

    text-align: center;

    font-family: Tahoma, Arial, sans-serif;

    font-size: 13px;

    outline: none;
}


.faraz-size-control input:focus {

    border-color: #174ea6;

    background: #fff;

    box-shadow:
        0 0 0 3px rgba(23,78,166,.08);
}


/* =========================================================
   SETTINGS
========================================================= */

.faraz-setting-row {

    width: 100%;

    margin-bottom: 12px;
}


.faraz-setting-row:last-child {

    margin-bottom: 0;
}


.faraz-setting-row label {

    display: block;

    font-size: 12px;

    font-weight: 700;

    color: #444;

    margin-bottom: 6px;
}


.faraz-setting-row select {

    height: 42px;

    cursor: pointer;
}


/* =========================================================
   CUSTOM FONT
========================================================= */

.faraz-custom-font-box {

    width: 100%;

    margin-bottom: 12px;
}


.faraz-custom-font-box input {

    height: 42px;
}


/* =========================================================
   ACTIONS
========================================================= */

.faraz-actions {

    width: 100%;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}


/* =========================================================
   BUTTON
========================================================= */

.faraz-btn {

    min-height: 48px;

    border: 0;

    border-radius: 12px;

    cursor: pointer;

    font-family: inherit;

    font-size: 14px;

    font-weight: 800;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        opacity .2s ease;
}


.faraz-btn:hover {

    transform: translateY(-2px);
}


.faraz-btn:active {

    transform: translateY(0);
}


.faraz-btn:disabled {

    opacity: .6;

    cursor: wait;

    transform: none;
}


/* ذخیره */

.faraz-btn-save {

    background: #1b1b1d;

    color: #fff;

    box-shadow:
        0 5px 15px rgba(0,0,0,.15);
}


/* چاپ */

.faraz-btn-print {

    background: #174ea6;

    color: #fff;
    font-family: 'iranyekanwebboldfanum';

    box-shadow:
        0 5px 15px rgba(23,78,166,.18);
}


/* =========================================================
   TABLE SAFETY
========================================================= */

.faraz-postal-label table {

    border-collapse: collapse;

}


/* =========================================================
   MOBILE PREVIEW SCALE
========================================================= */

@media (max-width: 950px) {

    .faraz-builder {

        grid-template-columns: 1fr;

    }


    .faraz-preview-area {

        position: static;

        order: 1;

    }


    .faraz-data-panel {

        order: 2;

    }


    .faraz-preview-stage {

        min-height: auto;

        padding: 25px;

    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 700px) {

    .faraz-post-label-app {

        padding: 12px;

    }


    .faraz-preview-stage {

        justify-content: flex-start;

        overflow-x: auto;

        padding: 20px;

    }


    .faraz-form-card {

        padding: 14px;

        border-radius: 13px;

    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .faraz-post-label-app {

        padding: 8px;

    }


    .faraz-builder {

        gap: 15px;

    }


    .faraz-preview-stage {

        padding: 15px;

        border-radius: 12px;

    }


    .faraz-input-row {

        grid-template-columns: 1fr;

        gap: 7px;

    }


    .faraz-size-control {

        width: 100%;

        display: flex;

        align-items: center;

        gap: 8px;

    }


    .faraz-size-control label {

        margin: 0;

        flex: 0 0 auto;

    }


    .faraz-size-control input {

        width: 75px;

    }


    .faraz-actions {

        grid-template-columns: 1fr;

    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .faraz-form-card {

        padding: 12px;

    }


    .faraz-form-card-title {

        font-size: 14px;

    }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

    @page {

        size: 13.5cm 9.5cm;

        margin: 0;

    }


    html,
    body {

        width: 13.5cm !important;

        height: 9.5cm !important;

        margin: 0 !important;

        padding: 0 !important;

        background: #fff !important;

    }


    body * {

        visibility: hidden;

    }


    .faraz-postal-label,
    .faraz-postal-label * {

        visibility: visible;

    }


    .faraz-postal-label {

        position: absolute !important;

        left: 0 !important;

        top: 0 !important;

        width: 13.5cm !important;

        height: 9.5cm !important;

        min-width: 13.5cm !important;

        min-height: 9.5cm !important;

        margin: 0 !important;

        box-shadow: none !important;

        border-radius: 0 !important;

        -webkit-print-color-adjust: exact !important;

        print-color-adjust: exact !important;

    }


    .faraz-post-label-app {

        padding: 0 !important;

        margin: 0 !important;

        background: #fff !important;

    }


    .faraz-builder {

        display: block !important;

        margin: 0 !important;

        padding: 0 !important;

    }


    .faraz-preview-area {

        position: static !important;

        margin: 0 !important;

        padding: 0 !important;

    }


    .faraz-preview-title,
    .faraz-data-panel {

        display: none !important;

    }


    .faraz-preview-stage {

        display: block !important;

        min-height: 0 !important;

        padding: 0 !important;

        margin: 0 !important;

        background: #fff !important;

        overflow: visible !important;

        border: 0 !important;

        box-shadow: none !important;

    }

}


/* =========================================================
   PRINT COLOR FIX
========================================================= */

@media print {

    .faraz-postal-label {

        background:
            linear-gradient(#fff, #fff) padding-box,
            repeating-linear-gradient(
                135deg,
                #d71920 0px,
                #d71920 8px,
                #fff 8px,
                #fff 16px,
                #174ea6 16px,
                #174ea6 24px,
                #fff 24px,
                #fff 32px
            ) border-box !important;

        -webkit-print-color-adjust: exact !important;

        print-color-adjust: exact !important;
    }


    .faraz-bottom-border {

        background:
            repeating-linear-gradient(
                135deg,
                #d71920 0px,
                #d71920 7px,
                #fff 7px,
                #fff 14px,
                #174ea6 14px,
                #174ea6 21px,
                #fff 21px,
                #fff 28px
            ) !important;

        -webkit-print-color-adjust: exact !important;

        print-color-adjust: exact !important;
    }

}