/* Button & Counter */
.fcc-wrapper { 
    font-family: "iransans-x", Sans-serif; 
    display: flex;
    flex-direction: column;
    align-items: end;
}
.fcc-modal{font-family: "iransans-x", Sans-serif !important; }
.fcc-add-btn {
    background: #ffe6f0; color: #c0005a; border: none;font-size: 14px;
    border-radius: 6px; cursor: pointer; font-weight: bold; width: 104px; height: 32px;text-align-last: center !important; font-family: "iransans-x", Sans-serif;
    /* This makes the button a flex container for its content */
    display: inline-flex;
    justify-content: center;
    align-items: center;
	gap: 5px;
}
.fcc-variations-list{
	width: 100%;
}
.fcc-counter {
    display: flex; align-items: center;
	width: 104px;height: 32px;
	justify-content: space-between;
}
.fcc-var-title{
	text-align: right;
	    direction: ltr;
}
.fcc-var-info{
	padding-left: 10px;
}
.fcc-counter button {
    background: #F0F0F0; border: none; border-radius: 6px;
    width: 32px; height: 32px; cursor: pointer; font-size: 16px;color: #13141fe6;
    padding: 0.5rem;
}
.fcc-counter span { padding: 0 0; font-weight: bold; }

/* START: New Styles for Unavailable State */
.fcc-action-area {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between button and "ناموجود" text */
    min-height: 32px; /* Prevent layout shift */
}

.fcc-action-area.is-unavailable .fcc-add-btn {
    filter: grayscale(1);
    cursor: not-allowed;
    /* justify-content and align-items are already on the base button style */
}

.fcc-action-area.is-unavailable .fcc-counter {
    display: none !important;
}

.fcc-action-area.is-unavailable .fcc-outofstock-text {
    display: inline-block !important;
}

.fcc-outofstock-text {
    color: red;
    font-weight: bold;
    font-size: 14px;
}

.fcc-action-area.is-contact-only .fcc-add-btn {
    pointer-events: none;
}

/* Hide product prices in archive and loop cards when the item requires contact. */
.fcc-contact-only-card .price,
.fcc-contact-only-card .woocommerce-Price-amount,
.fcc-contact-only-card .elementor-widget-woocommerce-product-price,
.fcc-contact-only-card .wd-product-price,
.fcc-contact-only-card .product-price,
.fcc-contact-only-card .price-wrapper {
    display: none !important;
}
/* END: New Styles for Unavailable State */


/* Modal Bottom Sheet */
.fcc-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9998;
}
.fcc-modal {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; z-index: 999999; border-radius: 16px 16px 0 0;
    padding: 20px; box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out; direction: rtl; font-family: Tahoma, sans-serif;
}
.fcc-var-plus , .fcc-var-minus{
	    display: flex;
    justify-content: center;
    align-items: center;
	width: 32px;
	height: 32px;
}
.fcc-var-plus svg , .fcc-var-minus svg{
	width: 16px;
	height: 16px;
	fill: #13141fe6;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.fcc-modal-header { text-align: right; margin-bottom: 20px;    padding-bottom: 5px; }
.fcc-var-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #eee; cursor: pointer;
}
#fcc-confirm-var {
    width: 100%; background: #5a55ff; color: #fff; border: none;
    padding: 12px; border-radius: 8px; font-size: 16px; margin-top: 15px; cursor: pointer;
}
.fcc-action-area.is-unavailable {
    flex-direction: row-reverse;
}
/* --- Desktop Centering ONLY --- */
@media (min-width: 768px) {
    .fcc-modal {
        margin: 0 35%;
    }
}


/* Verification modal */
body.fcc-auth-open {
    overflow: hidden !important;
}

.fcc-requires-verification .fcc-add-btn {
    position: relative;
}

.fcc-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(24, 20, 18, .52);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .2s ease;
    direction: rtl;
    font-family: "iransans-x", Sans-serif !important;
}

.fcc-auth-overlay.is-visible {
    opacity: 1;
}

.fcc-auth-modal {
    position: relative;
    width: min(100%, 390px);
    padding: 26px 22px 18px;
    overflow: hidden;
    border: 1px solid rgba(35, 28, 25, .08);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(24, 16, 12, .26);
    text-align: right;
    transform: translateY(10px) scale(.975);
    transition: transform .24s cubic-bezier(.2, .75, .25, 1);
}

.fcc-auth-modal::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff4f91, #c0005a);
}

.fcc-auth-overlay.is-visible .fcc-auth-modal {
    transform: translateY(0) scale(1);
}

.fcc-auth-close {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border: 1px solid #eee8e5 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #756862 !important;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.fcc-auth-close:hover {
    background: #fff2f7 !important;
    color: #c0005a !important;
    transform: rotate(5deg);
}

.fcc-auth-close svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.fcc-auth-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-left: 34px;
}

.fcc-auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid #ffd7e7;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff4f8, #ffe3ee);
    color: #c0005a;
}

.fcc-auth-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.fcc-auth-content {
    min-width: 0;
    padding-top: 1px;
}

.fcc-auth-content h3 {
    margin: 0 0 7px !important;
    color: #251d1a !important;
    font-family: inherit !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    line-height: 1.65 !important;
}

.fcc-auth-content p {
    margin: 0 !important;
    color: #766963 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.95 !important;
}

.fcc-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 22px;
}

.fcc-auth-primary,
.fcc-auth-secondary {
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer;
}

.fcc-auth-primary {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    min-height: 50px;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #d6096c, #b90056) !important;
    box-shadow: 0 10px 24px rgba(192, 0, 90, .22) !important;
    color: #fff !important;
    text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.fcc-auth-primary svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.fcc-auth-primary:hover {
    filter: brightness(.96);
    box-shadow: 0 13px 28px rgba(192, 0, 90, .28) !important;
    transform: translateY(-1px);
    color: #fff !important;
}

.fcc-auth-secondary {
    width: 100% !important;
    min-height: 38px;
    padding: 4px 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #7a6d67 !important;
    text-decoration: none !important;
    transition: background .18s ease, color .18s ease;
}

.fcc-auth-secondary:hover {
    background: #faf6f7 !important;
    color: #3f3430 !important;
}

.fcc-auth-primary:focus-visible,
.fcc-auth-secondary:focus-visible,
.fcc-auth-close:focus-visible {
    outline: 3px solid rgba(214, 9, 108, .2) !important;
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .fcc-auth-overlay {
        padding: 16px;
    }

    .fcc-auth-modal {
        width: 100%;
        padding: 25px 20px 16px;
        border-radius: 20px;
    }

    .fcc-auth-header {
        gap: 12px;
        padding-left: 28px;
    }

    .fcc-auth-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 15px;
    }

    .fcc-auth-content h3 {
        font-size: 18px !important;
    }

    .fcc-auth-content p {
        font-size: 12.5px !important;
        line-height: 1.9 !important;
    }

    .fcc-auth-actions {
        margin-top: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fcc-auth-overlay,
    .fcc-auth-modal,
    .fcc-auth-close,
    .fcc-auth-primary,
    .fcc-auth-secondary {
        transition: none !important;
    }
}

/* Role details popover attached to the sticky cart bar. */
.fcc-sticky-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    direction: rtl;
    flex-wrap: wrap;
}

.fcc-role-trigger[hidden],
.fcc-role-popover[hidden] {
    display: none !important;
}

.fcc-role-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 5px 10px !important;
    border: 1px solid #ece5df !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #29231f !important;
    font-family: "iransans-x", Sans-serif !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: right;
    cursor: pointer;
}

.fcc-role-trigger:hover,
.fcc-role-trigger.is-open {
    border-color: #d9cec5 !important;
    background: #faf8f6 !important;
}

.fcc-role-trigger:focus-visible,
.fcc-role-close:focus-visible {
    outline: 3px solid rgba(80, 44, 26, .18) !important;
    outline-offset: 2px;
}

.fcc-role-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 2px solid rgba(0, 0, 0, .12);
    border-radius: 50%;
    background-color: var(--fcc-role-color, #777777);
    box-sizing: border-box;
}

.fcc-role-trigger-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: nowrap;
}

.fcc-role-trigger-caption {
    color: #82786f;
    font-size: 10px;
    font-weight: 500;
}

.fcc-role-trigger-copy strong {
    color: #29231f;
    font-size: 12px;
    font-weight: 800;
}

.fcc-role-cart-summary {
    padding-right: 9px;
    border-right: 1px solid #eee8e3;
    color: #82786f;
    white-space: nowrap;
}

.fcc-role-cart-summary strong {
    color: #29231f;
    font-weight: 700;
}

.fcc-role-chevron {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: #756b63;
    transition: transform .18s ease;
}

.fcc-role-trigger.is-open .fcc-role-chevron {
    transform: rotate(180deg);
}

.fcc-role-popover {
    position: absolute;
    right: 20px;
    bottom: calc(100% + 13px);
    z-index: 100001;
    width: min(390px, calc(100vw - 32px));
    overflow: visible;
    padding: 18px;
    border: 1px solid #eee8e3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(39, 27, 19, .17);
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    animation: fcc-role-popover-in .18s ease-out;
}

.fcc-role-popover::after {
    position: absolute;
    right: 27px;
    bottom: -7px;
    width: 13px;
    height: 13px;
    border-right: 1px solid #eee8e3;
    border-bottom: 1px solid #eee8e3;
    background: #fff;
    content: "";
    transform: rotate(45deg);
}

.fcc-role-panel-header,
.fcc-role-panel-title-wrap {
    display: flex;
    align-items: center;
}

.fcc-role-panel-header {
    justify-content: space-between;
    gap: 12px;
}

.fcc-role-panel-title-wrap {
    gap: 8px;
    min-width: 0;
}

.fcc-role-panel-title-wrap h3 {
    margin: 0 !important;
    color: #28221f !important;
    font-family: "iransans-x", Sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.6 !important;
}

.fcc-role-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    border: 1px solid #eee8e3 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #786e67 !important;
    font-size: 21px !important;
    line-height: 1 !important;
    cursor: pointer;
}

.fcc-role-panel-summary {
    margin: 11px 0 14px !important;
    color: #70665f !important;
    font-family: "iransans-x", Sans-serif !important;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.9 !important;
}

.fcc-role-divider {
    height: 1px;
    background: #eee9e5;
}

.fcc-role-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: min(45vh, 330px);
    overflow-y: auto;
    margin: 9px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overscroll-behavior: contain;
}

.fcc-role-option {
    padding: 9px 10px;
    border-radius: 9px;
    color: #332c28;
    box-sizing: border-box;
}

.fcc-role-option.is-current {
    background: #F6F1EC;
}

.fcc-role-option-main,
.fcc-role-option-identity {
    display: flex;
    align-items: center;
}

.fcc-role-option-main {
    justify-content: space-between;
    gap: 10px;
}

.fcc-role-option-identity {
    gap: 8px;
    min-width: 0;
}

.fcc-role-option-identity strong {
    overflow: hidden;
    color: #29231f;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fcc-role-option-minimum {
    color: #6e655e;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes fcc-role-popover-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
    .fcc-sticky-topline {
        align-items: flex-start;
    }

    .fcc-role-trigger {
        gap: 7px;
        min-height: 38px;
        padding: 4px 8px !important;
    }

    .fcc-role-cart-summary {
        padding-right: 7px;
        font-size: 10px;
    }

    .fcc-role-popover {
        right: 12px;
        bottom: calc(100% + 10px);
        width: calc(100vw - 24px);
        padding: 16px;
    }

    .fcc-role-popover::after {
        right: 22px;
    }

    .fcc-role-option {
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fcc-role-chevron,
    .fcc-role-popover {
        animation: none !important;
        transition: none !important;
    }
}

/* Compact sticky cart bar based on the four-level design reference. */
.fcc-sticky-bar,
.fcc-sticky-bar * {
    box-sizing: border-box;
    font-family: "iransans-x", "IranYekan", Tahoma, sans-serif;
}

.fcc-sticky-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 30%;
    left: 30%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 99999;
    width: auto;
    max-width: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 -4px 18px rgba(28, 25, 23, .08);
    direction: rtl;
}

.fcc-progress-track {
    position: relative;
    width: 94%;
    align-self: center;
    align-self: anchor-center;
    height: 3px;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: #EDE7E3;
}

.fcc-progress-track[hidden],
.fcc-sticky-minimum-fallback[hidden],
.fcc-discount-status[hidden],
.fcc-discount-status-icon[hidden],
.fcc-discount-manage-link[hidden] {
    display: none !important;
}

.fcc-progress-fill {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width .3s ease, background-color .2s ease;
}

.fcc-sticky-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 16px 12px;
    direction: rtl;
}

.fcc-sticky-summary {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    direction: rtl;
}

.fcc-sticky-summary .fcc-role-trigger,
.fcc-sticky-minimum-fallback {
    display: inline-flex !important;
    min-width: 0;
    min-height: 36px;
    flex: 0 1 auto;
    align-items: center;
    gap: 8px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #57534E !important;
    font-family: "iransans-x", "IranYekan", Tahoma, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-align: right;
    white-space: nowrap;
}

.fcc-sticky-summary .fcc-role-trigger:hover,
.fcc-sticky-summary .fcc-role-trigger.is-open {
    border: 0 !important;
    background: transparent !important;
    color: #1C1917 !important;
}

.fcc-sticky-summary .fcc-role-trigger[hidden] {
    display: none !important;
}

.fcc-sticky-summary .fcc-role-trigger:focus-visible {
    outline: 2px solid rgba(78, 42, 20, .35) !important;
    outline-offset: 3px;
}

.fcc-sticky-role-dot {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 0;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .20), 0 0 0 2px #fff, 0 0 0 3px #E7E1DC;
}

.fcc-sticky-minimum-copy {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: #57534E;
    white-space: nowrap;
}

.fcc-sticky-minimum-copy strong {
    color: #1C1917;
    font-size: 14px;
    font-weight: 800;
}

.fcc-discount-status {
    display: flex;
    min-width: 0;
    max-width: 68%;
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    color: #B0124F;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
}

.fcc-discount-status.is-reached {
    color: #166534;
}

.fcc-discount-status-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

.fcc-discount-status > span:not(.fcc-discount-status-icon) {
    min-width: 0;
}

.fcc-discount-manage-link {
    margin-right: 4px;
    color: #7E0D39 !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.fcc-sticky-checkout {
    position: relative;
    display: flex !important;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #4E2A14 !important;
    box-shadow: none !important;
    color: #fff !important;
    font-family: "iransans-x", "IranYekan", Tahoma, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    direction: rtl;
}

.fcc-sticky-checkout:hover,
.fcc-sticky-checkout:focus {
    background: #4E2A14 !important;
    color: #fff !important;
    text-decoration: none !important;
}

.fcc-checkout-text {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.fcc-checkout-total {
    margin-right: auto;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.fcc-sticky-checkout .fcc-loader {
    position: absolute;
    left: 12px;
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: fcc-sticky-rotation 1s linear infinite;
}

.fcc-role-popover {
    right: 10px;
    bottom: calc(100% + 10px);
    width: min(272px, calc(100vw - 32px));
    padding: 14px;
    border-radius: 14px;
}

.fcc-role-popover::after {
    right: 20px;
}

.fcc-role-panel-title-wrap h3 {
    font-size: 16px !important;
}

.fcc-role-panel-summary {
    font-size: 13px !important;
}

.fcc-role-option-identity strong {
    font-size: 14px;
}

.fcc-role-option-minimum {
    font-size: 13px;
}

@keyframes fcc-sticky-rotation {
    to { transform: rotate(360deg); }
}

@media (max-width: 400px) {
    .fcc-sticky-bar {
        right: 8px;
        left: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .fcc-sticky-inner {
        padding-right: 12px;
        padding-left: 12px;
    }

    .fcc-sticky-summary {
        gap: 4px;
    }

    .fcc-sticky-summary .fcc-role-trigger,
    .fcc-sticky-minimum-fallback {
        gap: 5px;
        min-height: 34px;
        font-size: 13.5px !important;
    }

    .fcc-sticky-minimum-copy strong {
        font-size: 13.5px;
    }

    .fcc-discount-status {
        max-width: 63%;
        gap: 4px;
        font-size: 13.5px;
    }

    .fcc-discount-manage-link {
        font-size: 12px;
    }

    .fcc-checkout-text {
        font-size: 15px;
    }

    .fcc-checkout-total {
        font-size: 14px;
    }

    .fcc-role-panel-summary {
        font-size: 12.5px !important;
    }

    .fcc-role-option-identity strong {
        font-size: 13px;
    }

    .fcc-role-option-minimum {
        font-size: 12px;
    }

    .fcc-role-popover {
        right: 0;
        width: min(272px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .fcc-progress-fill,
    .fcc-sticky-checkout .fcc-loader {
        transition: none !important;
        animation-duration: .01ms !important;
    }
}
