/* =========================================================
   Burger Builder
   Figma adapted styles
   ========================================================= */

/* -------------------------
   Fonts
   مسیر فونت‌ها را متناسب با پروژه تغییر دهید
   ------------------------- */

@font-face {
    font-family: "IRANYekanXVF";
    src:
        url("../fonts/IRANYekanXVF.woff2") format("woff2"),
        url("../fonts/IRANYekanXVF.woff") format("woff");
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
}

@font-face {
    font-family: "IRANSansX";
    src:
        url("../fonts/IRANSansX.woff2") format("woff2"),
        url("../fonts/IRANSansX.woff") format("woff");
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
}

/* -------------------------
   Variables
   ------------------------- */
:root {
    --primary: #1eb1a6;
    --primary-dark: #168f87;
    --primary-light: #e9f9f7;

    --accent: #ffaf14;

    --danger: #ff0000;
    --danger-dark: #d90000;
    --danger-light: #fff0f0;

    --text: #000000;
    --text-muted: #666666;

    --border: #d9d9d9;
    --border-dark: #bdbdbd;

    --white: #ffffff;
    --page-bg: #f8f8f8;

    --radius: 16px;
    --radius-small: 12px;
    --radius-pill: 999px;

    --shadow:
        0 1px 4px rgba(0, 0, 0, 0.15);

    --shadow-large:
        0 10px 30px rgba(0, 0, 0, 0.08);

    --transition:
        180ms ease;
}

/* -------------------------
   Reset
   ------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;

    font-family:
        "IRANYekanXVF",
        "IRANSansX",
        Tahoma,
        Arial,
        sans-serif;

    color: var(--text);
    background: var(--page-bg);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
}

/*
   بسیار مهم:
   مانع نمایش المان‌هایی می‌شود که JavaScript
   ویژگی hidden را روی آن‌ها قرار داده است.
*/
[hidden] {
    display: none !important;
}

.scroll-guid-arrows{
    display: none;
    width: 100%;
    position: absolute;
    /* z-index: 20; */
    height: 24px;
    top: 30px;
}

.scroll-guid-arrows::before {
    content: "";
    position: absolute;
    bottom: 8px;
    right: -20px;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--primary);
    border-top: 2px solid var(--primary);
    /* فلش به سمت چپ: جهت اسکرول محتوا در RTL */
    transform: translateX(-50%) rotate(135deg);
    pointer-events: none;
    animation: bb-scroll-nav-hint 1.2s ease-in-out infinite;
}

.scroll-guid-arrows::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    /* فلش به سمت چپ: جهت اسکرول محتوا در RTL */
    transform: translateX(-50%) rotate(135deg);
    pointer-events: none;
    animation: bb-scroll-nav-hint 1.2s ease-in-out infinite;
}

/* -------------------------
   Main wrapper
   Frame 1000005617
   ------------------------- */

#burger-builder-root {
    position: relative;

    width: min(1236px, calc(100% - 32px));
    min-height: 648px;

    margin: 32px auto;
    padding: 32px;

    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-large);

    isolation: isolate;

    z-index: 1;
}

/* -------------------------
   Load error
   ------------------------- */

.bb-load-error {
    width: 100%;
    margin: 0 0 24px;
    padding: 14px 18px;

    color: #9d0000;
    background: #fff1f1;
    border: 1px solid #ffbaba;
    border-radius: var(--radius);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    text-align: right;
}

/* =========================================================
   Steps navigation
   Frame 1000005605
   ========================================================= */

.bb-steps-nav {
    position: absolute;
    top: 50%;
    right: 32px;
    z-index: 20;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    width: 82px;
    max-height: calc(100% - 64px);
    padding: 16px;
    gap: 16px;

    overflow: visible;

    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    transform: translateY(-50%);
}

/* هر مرحله */

.bb-step-item {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 52px;
    min-height: 52px;
    padding: 0;
    color: var(--text);
    background: transparent;
    border-radius: 40px;
    cursor: pointer;
    transition: width var(--transition), padding var(--transition), background-color var(--transition), color var(--transition), transform var(--transition);
}

/* تصویر/شماره مرحله */

.bb-step-thumb {
    position: relative;

    display: flex;
    flex: 0 0 52px;
    justify-content: center;
    align-items: center;

    width: 52px;
    height: 52px;

    overflow: hidden;

    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(30, 177, 166, 0.35);
    border-radius: 50%;

    font-size: 16px;
    font-weight: 800;
    line-height: 1;

    transition:
        color var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}

.bb-step-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.bb-step-thumb span {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    height: 100%;
}

/* عنوان مرحله در حالت عادی */

.bb-step-label {
    display: none;

    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 16px;
    font-weight: 700;
    line-height: 16px;
    text-align: right;
}

/* مرحله فعال مطابق Frame 1000005616 */

/* .bb-step-item.active {
    width: auto;
    min-height: 68px;
    padding: 8px 8px 8px 24px;

    color: var(--white);
    background: var(--primary);

    margin-right: -8px;
}

.bb-step-item.active .bb-step-label {
    display: block;
    flex: 1;
}

.bb-step-item.active .bb-step-thumb {
    color: var(--primary);
    background: var(--white);
    border-color: var(--white);
}

.bb-step-item:not(.active):hover {
    transform: translateX(-3px);
}

.bb-step-item:not(.active):hover .bb-step-thumb {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
}

/* =========================================================
   Builder main layout
   Frame 1000005615
   ========================================================= */

.bb-builder {
    display: flex;
    justify-content: flex-end;
    /* display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        314px; */

    align-items: center;

    width: 100%;
    min-height: 584px;

    padding-right: 114px;
    gap: 24px;
    /* gap: clamp(32px, 5vw, 72px); */
}

/* =========================================================
   Preview area
   ========================================================= */

.bb-preview-stage {
    position: relative;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;

    /* width: 100%; */
    min-width: 0;
    min-height: 510px;
}

/* کانتینر اصلی برگر */

.bb-preview {
    position: relative;
    z-index: 2;

    /* width: clamp(280px, 35vw, 430px); */
    width: 260px;
    aspect-ratio: 1;

    border-radius: 50%;

    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.14));

    display: flex;
    justify-content: center;
    align-items: center;

    margin-bottom: 40px;
}

/* بشقاب */

.bb-plate {
    position: absolute;
    inset: 0;
    z-index: 1;

    width: 100%;
    /* height: 100%; */

    object-fit: contain;
    pointer-events: none;
    user-select: none;
    bottom: 0;
    top: auto;
}

/* لایه‌های برگر */

.bb-layer {
    position: absolute;
    /* inset: 0; */
    z-index: 2;

    width: 100%;
    /* height: 100%; */

    object-fit: contain;

    pointer-events: none;
    user-select: none;

    animation: bb-layer-appear 220ms ease both;
}

@keyframes bb-layer-appear {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================================
   Radial options
   موقعیت نهایی گزینه‌ها می‌تواند توسط JS کنترل شود
   ========================================================= */

.bb-options-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    height: 260px;

    pointer-events: none;
}

.bb-option-circle {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 57px;
    height: 57px;
    padding: 5px;

    overflow: hidden;

    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 50%;
    box-shadow: var(--shadow);

    cursor: pointer;
    pointer-events: auto;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition),
        background-color var(--transition);
}

.bb-option-circle:hover {
    border-color: var(--primary);
    box-shadow:
        0 5px 15px rgba(30, 177, 166, 0.22);
    transform: translateY(-3px);
}

.bb-option-circle.selected {
    background: var(--danger-light);
    border-color: var(--danger);
    box-shadow:
        0 0 0 4px rgba(255, 0, 0, 0.1),
        var(--shadow);
}

.bb-option-thumb {
    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;

    user-select: none;
}

/* =========================================================
   Select panel
   ========================================================= */

.bb-select-panel {
    position: absolute;
    /* right: 50%; */
    bottom: -20px;
    z-index: 12;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    min-width: 230px;
    min-height: 48px;
    padding: 8px 16px;
    gap: 8px;

    /* -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px); */

    /* transform: translateX(50%); */
}

.bb-select-hint {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.bb-panel-title {
    max-width: 240px;

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bb-panel-title {
    display: flex;
    justify-content: center;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    gap: 8px;

    width: 280px;
    min-height: 40px;

    background: #1EB1A6;
    border-radius: 16px;

    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    max-width: unset;
}

.bb-order {
    max-width: 240px;

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bb-order {
    display: flex;
    justify-content: center;
    flex-direction: row;
    align-items: center;
    padding: 4px 16px;
    gap: 8px;

    width: 230px;
    height: 40px;

    background: #1EB1A6;
    border-radius: 16px;

    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    max-width: unset;
}

.bb-order > button {
    background: none;
    border: none;
}

.bb-order > button:hover {
    background: none;
    color: #fff;
    text-decoration: none;
}

.bb-counter-label {
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: #FFFFFF;
    text-align: center;
    flex: 1;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bb-panel-title-description {
    display: block;
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
    white-space: normal;
}

.bb-panel-title {
    background-color: var(--white) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    border: 1px solid;
    width: fit-content;
    min-width: 100%;
}

.bb-panel-title *:not(:disabled) {
    background-color: var(--white) !important;
    color: var(--primary) !important;
}

.bb-counter-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: var(--primary) !important;
    background: none !important;
}

.bb-counter-btn:disabled,
.bb-counter-btn:disabled *{
    color: var(--border-dark) !important;
    border-color: var(--border) !important;
    cursor: not-allowed;
}

.bb-counter-plus {
    font-size: 16px;
}

.bb-counter-plus:disabled {
    color: rgba(255, 255, 255, 0.5);
}

.bb-counter-minus {
    font-size: 16px;
}

.bb-counter-minus:disabled {
    color: rgba(255, 255, 255, 0.5);
}


/* -------------------------
   amount selection
   ------------------------- */

.bb-amount-selection{
    display: flex;
}

.bb-amount-selection-value{
    width: 50px;
    text-align: center;
    padding: 7px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    margin: 0 3px;
}


/* -------------------------
   Stepper
   ------------------------- */

.bb-stepper {
    display: grid;
    grid-template-columns: 36px minmax(100px, 1fr) 36px;
    align-items: center;

    min-width: 210px;
    min-height: 40px;

    overflow: hidden;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.bb-stepper-btn {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 36px;
    height: 38px;
    padding: 0;

    color: var(--primary);
    background: transparent;
    border: 0;

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
    transition:
        color var(--transition),
        background-color var(--transition);
}

.bb-stepper-btn:hover:not(:disabled) {
    color: var(--white);
    background: var(--primary);
}

.bb-stepper-btn:disabled {
    color: #b9b9b9;
    cursor: not-allowed;
}

.bb-stepper-value {
    display: flex;
    justify-content: center;
    align-items: center;

    min-width: 0;
    min-height: 38px;
    padding: 0 8px;

    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);

    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* =========================================================
   Controls
   Frame 1000005606
   ========================================================= */

.bb-controls {
    position: relative;
    z-index: 15;

    width: 314px;
    max-width: 100%;

    background: var(--white);
    border-radius: var(--radius);
}

#burger-normal-controls,
.bb-final-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
}

/* =========================================================
   Step title card
   Frame 1000005607
   ========================================================= */

.bb-step-title {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;

    width: 100%;
    /* min-height: 174px; */
    padding: 16px;
    gap: 16px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.bb-step-title h2 {
    width: 100%;
    margin: 0;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.8;
    text-align: right;
}

#burger-step-number {
    color: var(--text);
}

#burger-step-category {
    color: var(--text);
}

.bb-required-mark {
    margin-right: 3px;
    color: var(--danger) !important;
}

.bb-limit-hint {
    width: 100%;
    padding: 10px 12px;

    color: var(--text-muted);
    background: #f7f7f7;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.8;
    text-align: right;
}

/* =========================================================
   Price / calories
   Frames 1000005608 - 1000005609
   ========================================================= */

.bb-total-price {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

.bb-price-row,
.bb-calories-row,
.bb-selected-items {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    gap: 6px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
}

.bb-selected-items{
    font-size: 12px;
}

/*
   عنوان در ابتدای ردیف قرار می‌گیرد و
   مقدار و واحد در سمت مقابل کنار هم می‌مانند.
*/

.bb-price-row > span:first-child,
.bb-calories-row > span:first-child,
.bb-selected-items > span:first-child {
    margin-left: auto;
}

.bb-selected-items > span:first-child {
    display: none;
}

#burger-total-price-value,
#burger-final-price-value,
#burger-total-calories-value,
#burger-final-calories-value {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* برجسته‌سازی قیمت */

#burger-total-price-value,
#burger-final-price-value {
    color: var(--danger);
}

/* =========================================================
   Buttons
   Frame 1000005553
   ========================================================= */

.bb-button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    width: 100%;
    min-height: 40px;
    gap: 8px;

    flex-wrap: wrap;
}

.bb-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-width: 0;
    min-height: 40px;
    max-height: 48px;
    padding: 4px 16px;
    gap: 8px;

    border: 1px solid transparent;
    border-radius: var(--radius);

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    white-space: nowrap;

    cursor: pointer;
    user-select: none;

    transition:
        color var(--transition),
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition),
        opacity var(--transition);
}

.bb-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.bb-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bb-btn:focus-visible,
.bb-stepper-btn:focus-visible,
.bb-option-circle:focus-visible,
.bb-step-item:focus-visible {
    outline: 3px solid rgba(30, 177, 166, 0.28);
    outline-offset: 3px;
}

.bb-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* دکمه قبلی */

.bb-btn-prev {
    flex: 1;

    background-color: var(--white) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;

    margin-top: 8px;
}

.bb-btn-prev:hover:not(:disabled) {
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

/* دکمه بعدی */

.bb-btn-next {
    flex: 1;

    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.bb-btn-next:hover:not(:disabled) {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

/* افزودن به سبد خرید */

.bb-btn-cart {
    flex: 1;

    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.bb-btn-cart:hover:not(:disabled) {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

/* آیکون سبد خرید بدون نیاز به تغییر HTML */

.bb-btn-cart::before {
    content: "";

    width: 16px;
    height: 16px;
    flex: 0 0 16px;

    background-color: currentColor;

    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8h12l1 13H5L6 8Z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E")
        center / contain no-repeat;

    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8h12l1 13H5L6 8Z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

.bb-btn-cart-full {
    margin-top: 12px;
}

.bb-btn-reset {
    flex: 1;

    background-color: var(--white) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.bb-btn-reset:hover:not(:disabled) {
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

.bb-btn-reset-full {
    margin-top: 12px;
}

/* =========================================================
   Final order
   ========================================================= */

.bb-final-container {
    padding: 16px;
    gap: 12px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    animation: bb-final-appear 300ms ease both;
}

@keyframes bb-final-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bb-final-title {
    width: 100%;
    padding: 16px;

    color: var(--primary-dark);
    background: var(--primary-light);
    border: 1px solid rgba(30, 177, 166, 0.25);
    border-radius: var(--radius);

    font-size: 18px;
    font-weight: 800;
    line-height: 1.8;
    text-align: center;
}

#burger-final-actions {
    margin-top: 4px;
}

/* =========================================================
   Loading state - اختیاری
   در صورت افزودن کلاس loading توسط JS
   ========================================================= */

#burger-builder-root.loading {
    pointer-events: none;
}

#burger-builder-root.loading::after {
    content: "";

    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 100;

    width: 42px;
    height: 42px;

    border: 4px solid rgba(30, 177, 166, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;

    transform: translate(-50%, -50%);
    animation: bb-loading 700ms linear infinite;
}

@keyframes bb-loading {
    to {
        transform:
            translate(-50%, -50%)
            rotate(360deg);
    }
}

/* =========================================================
   Responsive: Laptop / Tablet
   ========================================================= */

@media (max-width: 1100px) {
    #burger-builder-root {
        width: min(960px, calc(100% - 32px));
        min-height: auto;
    }

    .bb-builder {
        grid-template-columns:
            minmax(0, 1fr)
            250px;

        padding-right: 96px;
    }

    .bb-controls {
        width: 250px;
    }

    /* .bb-preview {
        width: clamp(270px, 38vw, 380px);
        width: 270px;
    } */
}

@media (min-width: 900px){
    .bb-builder{
        gap: 100px !important;
    }
}

/* =========================================================
   Responsive: Tablet
   نوار مراحل از حالت عمودی به افقی تبدیل می‌شود
   ========================================================= */

@media (max-width: 850px) {
    #burger-builder-root {
        width: min(720px, calc(100% - 24px));
        margin: 12px auto;
        padding: 20px;
        border-radius: 20px;
    }

    .bb-steps-nav {
        position: relative;
        top: auto;
        right: auto;

        display: flex;
        flex-direction: row;
        align-items: center;

        width: 100%;
        max-height: none;
        margin-bottom: 24px;
        padding: 10px;
        gap: 10px;

        overflow-x: auto;
        overflow-y: hidden;

        background: var(--primary-light);
        border: 1px solid rgba(30, 177, 166, 0.2);
        border-radius: 18px;
        box-shadow: none;

        transform: none;

        /* اسکرول نرم در موبایل و تبلت */
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;

        /* مخفی‌کردن اسکرول‌بار Firefox */
        scrollbar-width: none;
    }

    /* مخفی‌کردن اسکرول‌بار Chrome / Safari / Edge */
    .bb-steps-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .bb-step-item {
        flex: 0 0 52px;
    }

    .bb-builder {
        display: flex;
        flex-direction: column;

        min-height: auto;
        padding-right: 0;
        gap: 28px;
    }

    .bb-preview-stage {
        order: 1;
    }

    .bb-controls {
        order: 2;
        width: 100%;
    }

    #burger-normal-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 12px;
    }

    .bb-step-title {
        grid-row: span 2;
        min-height: 100%;
    }

    .bb-total-price {
        gap: 8px;
    }

    #burger-normal-actions {
        grid-column: 2;
    }
}

/* =========================================================
   Responsive: Mobile
   ========================================================= */

/* @media (max-width: 600px) {
    body {
        background: var(--white);
    }

    #burger-builder-root {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding: 16px;

        border-radius: 0;
        box-shadow: none;
    }

    .bb-steps-nav {
        width: calc(100% + 32px);
        margin-right: -16px;
        margin-bottom: 16px;
        padding: 4px 16px 10px;
        gap: 8px;

        overflow-x: auto;
        overflow-y: hidden;

        حذف ظاهر کانتینر در موبایل
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;

        پنهان‌کردن اسکرول‌بار Firefox
        scrollbar-width: none;

        تجربه بهتر اسکرول لمسی
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    پنهان‌کردن اسکرول‌بار Chrome / Safari / Edge
    .bb-steps-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .bb-step-item {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;

        border: none;
        box-shadow: none;
    }

    .bb-step-thumb {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }

    .bb-step-item.active {
        flex: 0 0 180px;
        width: 180px;
        min-height: 52px;
        margin-right: 0;
        padding: 4px 5px 4px 14px;

        border: none;
        border-radius: 999px;
        box-shadow: none;
    }

    .bb-step-label {
        font-size: 14px;
        line-height: 20px;
    }

    .bb-builder {
        gap: 18px;
    }

    .bb-preview-stage {
        min-height: clamp(380px, 110vw, 460px);
    }

    .bb-preview {
        width: min(74vw, 330px);
    }

    .bb-option-circle {
        width: 52px;
        height: 52px;
        padding: 4px;
    }

    .bb-select-panel {
        bottom: 2px;

        width: min(260px, calc(100% - 24px));
        min-width: 0;
        padding: 7px 10px;
    }

    .bb-panel-title {
        width: 100%;
    }

    .bb-stepper {
        width: 100%;
        min-width: 0;
    }

    #burger-normal-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .bb-step-title {
        min-height: 130px;
    }

    .bb-price-row,
    .bb-calories-row {
        font-size: 14px;
    }

    .bb-button-container {
        flex-wrap: wrap;
    }

    .bb-btn {
        flex: 1 1 120px;
    }

    #burger-final-actions .bb-btn-cart {
        flex-basis: 100%;
        order: -1;
    }
} */

/* =========================================================
   Responsive: Mobile (اصلاح بخش گزینه‌ها و پنل)
   ========================================================= */

@media (max-width: 600px) {
    body {
        background: var(--white);
    }

    #burger-builder-root {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding: 16px;
        border-radius: 0;
        box-shadow: none;
    }

    .bb-steps-nav {
        width: calc(100% + 32px);
        margin-right: -16px;
        margin-bottom: 16px;
        padding: 4px 16px 10px;
        gap: 8px;

        overflow-x: auto;
        overflow-y: hidden;

        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;

        scrollbar-width: none;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .bb-steps-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* .bb-step-item {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        border: none;
        box-shadow: none;
    }

    .bb-step-item.active {
        width: auto;
        min-height: 52px;
        margin-right: 0;
        padding: 4px 5px 4px 14px;
        border: none;
        border-radius: 999px;
        box-shadow: none;
    } */

    /* .bb-step-label {
        font-size: 14px;
        line-height: 20px;
    } */

    .bb-builder {
        gap: 18px;
    }

    .bb-preview-stage {
        min-height: 400px;
        padding-bottom: 30px; /* ایجاد فضا برای نوار آپشن‌ها و پنل پایین */
        width: 100%;
    }

    .bb-preview {
        margin-bottom: 20px;
        height: 350px;
    }

    /* --------------------------------------------------
       Options around burger در حالت موبایل:
       تبدیل به نوار افقی اسکرول‌دار در بالای Step panel
       -------------------------------------------------- */
    .bb-options-container {
        position: absolute;
        top: auto;
        left: 0;
        right: 0;
        height: auto;
        z-index: 10;

        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;

        width: 100%;
        padding: 8px 16px;
        gap: 12px;

        overflow-x: auto;
        overflow-y: hidden;
        pointer-events: auto;

        /* اسکرول نرم لمسی و حذف اسکرول‌بار */
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    /* بازنشانی استایل‌های مختصات دایره‌ها */
    .bb-option-circle {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;

        flex: 0 0 54px;
        width: 54px;
        height: 54px;
        padding: 4px;
    }

    .bb-option-circle:hover {
        transform: none;
    }

    .bb-option-circle.selected {
        transform: scale(1.06) !important;
    }

    /* پنل کنترل مرحله پایین صفحه */
    .bb-select-panel {
        bottom: 10px;
        /* right: 50%; */
        width: min(320px, calc(100% - 32px));
        min-width: 0;
        padding: 0;
        /* transform: translateX(50%); */
    }

    .bb-panel-title {
        width: 100%;
    }

    .bb-stepper {
        width: 100%;
        min-width: 0;
    }

    #burger-normal-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .bb-price-row,
    .bb-calories-row {
        font-size: 14px;
    }

    .bb-button-container {
        flex-wrap: wrap;
    }

    .bb-btn {
        flex: 1 1 120px;
    }

    #burger-final-actions .bb-btn-cart {
        flex-basis: 100%;
        /* order: -1; */
    }

    .bb-preview-stage {
        min-height: 420px;
        padding-bottom: 140px; /* ایجاد فضای کافی برای گزینه‌ها و پنل پایین */
    }

    /* --------------------------------------------------
       Options around burger در حالت موبایل
       مشابه استایل کانتینر Steps navigation
       -------------------------------------------------- */
    .bb-options-container {
        position: relative;
        top: auto;
        left: 0;
        right: 0;
        height: 100%;
        z-index: 10;

        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;

        width: 100%;
        padding: 8px 12px;
        gap: 10px;

        /* ظاهر کاملاً مشابه کانتینر Steps Navigation */
        background: var(--primary-light);
        border: 1px solid rgba(30, 177, 166, 0.25);
        border-radius: 18px;
        box-shadow: none;

        /* اسکرول لمسی نرم و مخفی کردن اسکرول‌بار */
        overflow-x: auto;
        overflow-y: hidden;
        pointer-events: auto;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .bb-options-container::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .scroll-guid-arrows.size-600{
        display: block;
    }

    .scroll-guid-arrows-container.size-600{
        position: relative;
        width: 100%;
        height: 80px;
        /* bottom: 64px; */

        margin-bottom: 8px;
    }

    /* --------------------------------------------------
       آیتم‌های گزینه برگر
       مشابه bb-step-thumb در Steps Navigation
       -------------------------------------------------- */
    .bb-option-circle {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;

        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        padding: 3px;

        /* استایل دقیق bb-step-thumb */
        background: var(--white);
        border: 1.5px solid rgba(30, 177, 166, 0.35);
        border-radius: 50%;
        box-shadow: none;

        cursor: pointer;
        transition:
            background-color var(--transition),
            border-color var(--transition),
            transform var(--transition),
            box-shadow var(--transition);
    }

    .bb-option-circle .bb-option-thumb {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    /* حالت Hover */
    .bb-option-circle:hover {
        border-color: var(--primary);
        background: var(--primary-light);
        transform: translateY(-2px) !important;
    }

    /* حالت انتخاب‌شده (Active / Selected)
       مشابه تم مرحله فعال با رنگ سازمانی primary */
    .bb-option-circle.selected {
        background: var(--primary);
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(30, 177, 166, 0.25);
        transform: scale(1.08) !important;
    }

    .bb-option-circle.selected .bb-option-thumb {
        /* در صورت نیاز به حاشیه سفید تمیز دور تصویر لایه در حالت انتخاب */
        outline: 2px solid var(--white);
    }

    /* --------------------------------------------------
       پنل انتخاب مرحله (در زیر گزینه‌ها)
       -------------------------------------------------- */
    .bb-select-panel {
        bottom: 8px;
        /* right: 50%; */
        /* transform: translateX(50%); */
        width: min(320px, calc(100% - 24px));
        min-width: 0;
        padding: 0;
    }
    
    #amount-option-container{
        width: calc(100% - 104px);
    }

    #amount-option-container > span{
        text-wrap: auto;
    }

    .bb-step-thumb{
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }
}

@media (min-width: 1200px) {
    .bb-step-item.active {
        display: flex;
        width: auto;
        min-height: 68px;
        padding: 8px 8px 8px 24px;
        color: var(--white);
        background: var(--primary);
        margin-right: -8px;
        gap: 10px;
    }

    .bb-step-item.active .bb-step-label {
        display: block;
        flex: 1;
    }

    .bb-step-item.active .bb-step-thumb {
        color: var(--primary);
        background: var(--white);
        border-color: var(--white);
    }
}


/* =========================================================
   Very small mobiles
   ========================================================= */

@media (max-width: 390px) {
    #burger-builder-root {
        padding: 12px;
    }

    .bb-preview-stage {
        min-height: 360px;
    }

    /* .bb-preview {
        width: min(72vw, 280px);
    } */

    .bb-option-circle {
        width: 46px;
        height: 46px;
    }

    .bb-step-item.active {
        /* width: 170px; */
    }

    .bb-price-row,
    .bb-calories-row {
        padding: 10px 12px;
        gap: 4px;
        font-size: 13px;
    }

    .bb-final-container {
        padding: 12px;
    }
}

/* =========================================================
   Accessibility
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


.bb-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.bb-amount-btn {
    padding: 6px 12px;
    border: 2px solid #ccc;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.bb-amount-btn.active {
    border-color: var(--primary, #e63946);
    background: var(--primary, #e63946);
    color: #fff;
}

.bb-amount-btn.is-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.bb-option-circle.is-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.bb-option-circle.is-unavailable:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
    background: var(--white);
}


/* ============================================================
   CSS جدید
   ============================================================ */


.bb-nav-arrows {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.bb-nav-arrow {
    pointer-events: all;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.15s;
}

.bb-nav-arrow:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.bb-nav-arrow:not(:disabled):hover {
    transform: scale(1.12);
}

/* دکمه افزودن به سبد - همیشه نمایش */
#burger-add-to-cart:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

/* خطای validation */
.bb-step-error {
    animation: bb-shake 0.5s ease;
    outline: 2px solid #e63946;
    border-radius: 4px;
}

@media (max-width: 1200px) {
.bb-steps-nav {
        position: relative;
        top: auto;
        right: auto;

        display: flex;
        flex-direction: row;
        align-items: center;

        width: 100%;
        max-height: none;
        margin-bottom: 24px;
        padding: 10px;
        gap: 10px;

        overflow-x: auto;
        overflow-y: hidden;

        background: var(--primary-light);
        border: 1px solid rgba(30, 177, 166, 0.2);
        border-radius: 18px;
        box-shadow: none;

        transform: none;

        /* اسکرول نرم در موبایل و تبلت */
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;

        /* مخفی‌کردن اسکرول‌بار Firefox */
        scrollbar-width: none;

        margin-right: auto;
        margin-left: auto;
    }

    .bb-steps-nav {
        position: relative;
        height: 100%;
    }

    .scroll-guid-arrows.size-1200{
        display: block;
    }

    .scroll-guid-arrows-container.size-1200{
        position: relative;
        height: 80px;
    }

    .bb-step-item{
        flex-wrap: wrap;
    }

    .bb-step-item > .bb-step-label{
        display: block;
        font-size: 8px;
    }

    .bb-step-item.active .bb-step-thumb {
        background: var(--primary);
        border-color: var(--primary);
        border-width: 2px;
    }
}

@keyframes bb-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    80%       { transform: translateX(-3px); }
}

@keyframes bb-scroll-nav-hint {
    0%,
    100% {
        opacity: 0.35;
        transform: translateX(-50%) rotate(135deg);
    }

    50% {
        opacity: 1;
        transform: translateX(calc(-50% - 7px)) rotate(135deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-steps-nav::after {
        animation: none;
    }
}

