/* =========================================================
   Pizza 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: pb-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: pb-scroll-nav-hint 1.2s ease-in-out infinite;
}

/* -------------------------
   Main wrapper
   Frame 1000005617
   ------------------------- */

#pizza-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
   ------------------------- */

.pb-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
   ========================================================= */

.pb-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%);
}

/* هر مرحله */

.pb-step-item {
    position: relative;

    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;

    width: 52px;
    min-height: 52px;
    padding: 0;
    gap: 10px;

    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);

    display: block;
}

/* تصویر/شماره مرحله */

.pb-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);
}

.pb-step-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.pb-step-thumb span {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    height: 100%;
}

/* عنوان مرحله در حالت عادی */

.pb-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 */

/* =========================================================
   Builder main layout
   Frame 1000005615
   ========================================================= */

.pb-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
   ========================================================= */

.pb-preview-stage {
    position: relative;

    display: block;

    /* display: flex;
    justify-content: center;
    align-items: center; */

    width: 100%;
    /* min-width: 0;
    min-height: 510px; */
}


#pizza-previews{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

/* کانتینر اصلی پیتزا */

.pb-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: 90px; */
}

/* بشقاب */

.pb-plate {
    position: absolute;
    inset: 0;
    z-index: 1;

    width: 100%;
    height: 100%;

    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

/* لایه‌های پیتزا */

.pb-layer {
    position: absolute;
    /* inset: 0; */
    z-index: 2;

    width: 100%;
    height: 100%;

    object-fit: contain;

    pointer-events: none;
    user-select: none;

    --rotate: 0deg;
    transform: rotate(var(--rotate));

    animation: pb-layer-appear 220ms ease both;
}

@keyframes pb-layer-appear {
    from {
        opacity: 0;
        transform: rotate(var(--rotate)) scale(0.94);
    }

    to {
        opacity: 1;
        transform: rotate(var(--rotate)) scale(1);
    }
}

/* =========================================================
   Radial options
   موقعیت نهایی گزینه‌ها می‌تواند توسط JS کنترل شود
   ========================================================= */

.pb-options-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    height: 260px;

    pointer-events: none;
}

.pb-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);
}

.pb-option-circle:hover {
    border-color: var(--primary);
    box-shadow:
        0 5px 15px rgba(30, 177, 166, 0.22);
    transform: translateY(-3px);
}

.pb-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);
}

.pb-option-thumb {
    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;

    user-select: none;
}

.pb-option-circle.is-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =========================================================
   Select panel
   ========================================================= */

.pb-select-panel {
    /* position: absolute; */
    right: 50%;
    bottom: -20px;
    z-index: 12;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: min(100%, 560px);
    min-width: 230px;
    min-height: 48px;
    padding: 8px 16px;
    gap: 8px;

    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);

    margin: 0 auto;

    /* transform: translateX(50%); */
}

.pb-select-hint {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.pb-panel-title {

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    gap: 8px;

    width: min(100%, 560px);
    min-height: 40px;
    direction: ltr;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    direction: rtl;
}

#amount-option-container #pizza-panel-title-text ,
#amount-option-container .pb-amount-description-label{
    color: var(--primary);
}

.pb-counter-btn {
    cursor: pointer;
    font-size: 15px;
    background: none;
    border: var(--danger) 1px solid;
    color: var(--danger);
}

.pb-counter-btn:hover,
.pb-counter-btn:focus {
    background: none;
    border: none;
    color: var(--primary);
}

.pb-counter-btn{
    background: none !important;
    border: none !important;
    color: var(--primary) !important;
    font-size: 15px !important;
}

.pb-order {
    max-width: 240px;

    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pb-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;
}

.pb-order > button{
    background: none;
    border: none;
}

.pb-order > button:hover {
    background: none;
    color: #fff;
    text-decoration: none;
}

.pb-counter-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 24px;
    color: #FFFFFF;
    text-align: center;
    flex: 0 1 auto;
    max-width: 150px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    direction: rtl;
}

.pb-panel-title-description {
    display: block;
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
    white-space: normal;
}


    
.pb-counter-btn {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 8px;
    color: var(--primary);
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.pb-counter-btn:disabled {
    color: var(--border-dark) !important;
    border-color: var(--border) !important;
    cursor: not-allowed;
}

.pb-amount-buttons {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    /* gap: 6px; */
    min-width: 0;
    direction: rtl;
}

.pb-amount-buttons > .pb-amount-btn {
    margin: 3px;
    color: var(--danger) !important;
    background: none !important;
    border-color: var(--danger) !important;
}

.pb-amount-buttons > .pb-amount-btn.active {
    color: white !important;
    background: var(--danger) !important;
    border-color: white !important;
}

.pb-amount-btn {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 5px 8px;
    color: var(--text-muted);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.pb-amount-btn.active,
.pb-amount-btn:hover:not(:disabled) {
    color: var(--primary-dark);
    background: none;
    border-color: var(--primary);
}

.pb-amount-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.pb-amount-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-amount-description-label {
    flex: 0 0 100%;
    margin: 0;
    color: var(--white);
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
    text-align: center;
}


/* -------------------------
   Stepper
   ------------------------- */

.pb-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);
}

.pb-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);
}

.pb-stepper-btn:hover:not(:disabled) {
    color: var(--white);
    background: var(--primary);
}

.pb-stepper-btn:disabled {
    color: #b9b9b9;
    cursor: not-allowed;
}

.pb-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
   ========================================================= */

.pb-controls {
    position: relative;
    z-index: 15;

    min-width: 230px;
    max-width: 100%;

    background: var(--white);
    border-radius: var(--radius);
}

#pizza-normal-controls,
.pb-final-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
}

/* =========================================================
   Step title card
   Frame 1000005607
   ========================================================= */

.pb-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);
}

.pb-step-title h2 {
    width: 100%;
    margin: 0;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.8;
    text-align: right;
}

#pizza-step-number {
    color: var(--text);
}

#pizza-step-category {
    color: var(--text);
}

.pb-required-mark {
    margin-right: 3px;
    color: var(--danger) !important;
}

.pb-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
   ========================================================= */

.pb-total-price {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

.pb-price-row,
.pb-calories-row,
.pb-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;
}

.pb-selected-items{
    font-size: 12px;
}

/*
   عنوان در ابتدای ردیف قرار می‌گیرد و
   مقدار و واحد در سمت مقابل کنار هم می‌مانند.
*/

.pb-price-row > span:first-child,
.pb-calories-row > span:first-child,
.pb-selected-items > span:first-child {
    margin-left: auto;
}

.pb-selected-items > span:first-child {
    display: none;
}

#pizza-total-price-value,
#pizza-final-price-value,
#pizza-total-calories-value,
#pizza-final-calories-value {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* برجسته‌سازی قیمت */

#pizza-total-price-value,
#pizza-final-price-value {
    color: var(--danger);
}

/* =========================================================
   Buttons
   Frame 1000005553
   ========================================================= */

.pb-button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    width: 100%;
    min-height: 40px;
    gap: 8px;

    flex-wrap: wrap;
}

.pb-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-width: 0;
    min-height: 40px;
    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);
}

.pb-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.pb-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pb-btn:focus-visible,
.pb-stepper-btn:focus-visible,
.pb-option-circle:focus-visible,
.pb-step-item:focus-visible {
    outline: 3px solid rgba(30, 177, 166, 0.28);
    outline-offset: 3px;
}

.pb-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* دکمه قبلی */

.pb-btn-prev {
    flex: 1;

    background-color: var(--white) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;

    margin-top: 8px
}

.pb-btn-prev:hover:not(:disabled) {
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

/* دکمه بعدی */

.pb-btn-next {
    flex: 1;

    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.pb-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);
}

/* افزودن به سبد خرید */

.pb-btn-cart {
    flex: 1;

    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.pb-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 */

.pb-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;
}

.pb-btn-cart-full {
    /* margin-top: 12px; */
    width: 100%
}

.pb-btn-reset {
    flex: 1;

    /* color: var(--white);
    background: var(--danger);
    border-color: var(--danger); */
    background-color: var(--white) !important;
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.pb-btn-reset:hover:not(:disabled) {
    /* background: var(--danger-dark);
    border-color: var(--danger-dark); */
    box-shadow:
        0 6px 14px rgba(255, 0, 0, 0.2);
}

.pb-btn-reset-full {
    margin-top: 12px;
}

/* =========================================================
   Final order
   ========================================================= */

.pb-final-container {
    padding: 16px;
    gap: 12px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    animation: pb-final-appear 300ms ease both;
}

@keyframes pb-final-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pb-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;
}

#pizza-final-actions {
    margin-top: 4px;
}

/* =========================================================
   Loading state - اختیاری
   در صورت افزودن کلاس loading توسط JS
   ========================================================= */

#pizza-builder-root.loading {
    pointer-events: none;
}

#pizza-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: pb-loading 700ms linear infinite;
}

@keyframes pb-loading {
    to {
        transform:
            translate(-50%, -50%)
            rotate(360deg);
    }
}

/* =========================================================
   Responsive: Laptop / Tablet
   ========================================================= */

@media (max-width: 1100px) {
    #pizza-builder-root {
        width: min(960px, calc(100% - 32px));
        min-height: auto;
    }

    .pb-builder {
        grid-template-columns:
            minmax(0, 1fr)
            250px;

        padding-right: 96px;
    }

    .pb-controls {
        width: 250px;
    }

    /* .pb-preview {
        width: clamp(270px, 38vw, 380px);
        width: 270px;
    } */
}

@media (max-width: 992px){
    #content{
        max-width: fit-content !important;
    }
}

/* =========================================================
   Responsive: Tablet
   نوار مراحل از حالت عمودی به افقی تبدیل می‌شود
   ========================================================= */

@media (max-width: 850px) {
    #pizza-builder-root {
        width: min(720px, calc(100% - 24px));
        margin: 12px auto;
        padding: 20px;
        border-radius: 20px;
    }

    .pb-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 */
    .pb-steps-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* .pb-step-item {
        flex: 0 0 52px;
    }

    .pb-step-item.active {
        flex: 0 0 220px;
        margin-right: 0;
    } */

    .pb-builder {
        display: flex;
        flex-direction: column;

        min-height: auto;
        padding-right: 0;
        gap: 28px;
    }

    .pb-preview-stage {
        order: 1;
    }

    .pb-controls {
        order: 2;
        width: 100%;
    }

    #pizza-normal-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 12px;
    }

    .pb-step-title {
        grid-row: span 2;
        min-height: 100%;
    }

    .pb-total-price {
        gap: 8px;
    }

    #pizza-normal-actions {
        grid-column: 2;
    }
}

/* =========================================================
   Responsive: Mobile
   ========================================================= */

@media (max-width: 600px) {
    body {
        background: var(--white);
    }

    #pizza-builder-root {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding: 16px;

        border-radius: 0;
        box-shadow: none;
    }

    .pb-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 */
    .pb-steps-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* .pb-step-item {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;

        border: none;
        box-shadow: none;
    } */

    .pb-step-thumb {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }

    /* .pb-step-item.active {
        flex: 0 0 180px;
        min-height: 52px;
        margin-right: 0;
        padding: 4px 5px 4px 14px;

        border: none;
        border-radius: 999px;
        box-shadow: none;
    } */

    .pb-step-label {
        font-size: 14px;
        line-height: 20px;
    }

    .pb-builder {
        gap: 18px;
    }

    /* .pb-preview-stage {
        min-height: clamp(380px, 110vw, 480px);
        height: 510px;
    } */

    /* .pb-preview {
        width: min(74vw, 330px);
    } */

    .pb-option-circle {
        width: 52px;
        height: 52px;
        padding: 4px;
    }

    .pb-select-panel {
        bottom: 2px;

        /* width: min(260px, calc(100% - 24px)); */
        min-width: 0;
        padding: 7px 10px;
    }

    .pb-panel-title {
        width: 100%;
    }


    .pb-stepper {
        width: 100%;
        min-width: 0;
    }

    #pizza-normal-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* .pb-step-title {
        min-height: 130px;
    } */

    .pb-price-row,
    .pb-calories-row {
        font-size: 14px;
    }

    .pb-button-container {
        flex-wrap: wrap;
    }

    /* .pb-btn {
        flex: 1 1 120px;
    } */

    #pizza-final-actions .pb-btn-cart {
        flex-basis: 100%;
        /* order: -1; */
    }
}

/* =========================================================
   Very small mobiles
   ========================================================= */

@media (max-width: 390px) {
    #pizza-builder-root {
        padding: 12px;
    }

    /* .pb-preview-stage {
        min-height: 430px;
        height: 510px;
    } */

    /* .pb-preview {
        width: min(72vw, 280px);
    } */

    .pb-option-circle {
        width: 46px;
        height: 46px;
    }

    .pb-step-item.active {
        /* width: 170px; */
    }

    .pb-price-row,
    .pb-calories-row {
        padding: 10px 12px;
        gap: 4px;
        font-size: 13px;
    }

    .pb-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;
    }
}

.pb-amount-description-label{
    margin-bottom: 5px;
    /* margin-top: 5px; */
    /* font-size: 12px; */
    font-weight: 700;
    /* line-height: 22px; */
}


/* ============================================================
   CSS جدید
   ============================================================ */


.pb-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;
}

.pb-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;
}

.pb-nav-arrow:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.pb-nav-arrow:not(:disabled):hover {
    transform: scale(1.12);
}

/* دکمه افزودن به سبد - همیشه نمایش */
#pizza-add-to-cart:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

/* خطای validation */
.pb-step-error {
    animation: pb-shake 0.5s ease;
    outline: 2px solid #e63946;
    border-radius: 4px;
}



@media (max-width: 1200px) {
    .pb-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;
    }
    

    .pb-steps-nav {
        position: relative;
        height: 100%;
    }

    .scroll-guid-arrows.size-1200{
        display: block;
    }

    .scroll-guid-arrows-container.size-1200{
        position: relative;
        height: 100px;
    }

    


    .pb-step-item.active .pb-step-thumb {
        background: var(--primary);
        border-color: var(--primary);
        border-width: 2px;
    }

    .pb-step-item .pb-step-label {
        display: block;
        /* flex: 1; */
        font-size: 8px;
        text-align: center;
    }

    .pb-step-item{
        display: block;
    }
}

@media (min-width: 1200px) {

    .pb-step-item.active {
        display: flex;

        width: auto;
        min-height: 68px;
        padding: 8px 8px 8px 24px;

        color: var(--white);
        background: var(--primary);

        margin-right: -8px;
    }

    .pb-step-item.active .pb-step-label {
        display: block;
        flex: 1;
    }

    .pb-step-item.active .pb-step-thumb {
        color: var(--primary);
        background: var(--white);
        border-color: var(--white);
    }

    .pb-step-item:not(.active):hover {
        transform: translateX(-3px);
    }

    .pb-step-item:not(.active):hover .pb-step-thumb {
        color: var(--white);
        background: var(--primary);
        border-color: var(--primary);
    }

    .pb-controls{
        width: 400px !important;
        /*max-width: 400px !important; */
    }

}

@keyframes pb-scroll-nav-hint {
    0%,
    100% {
        opacity: 0.35;
        transform: translateX(-50%) rotate(135deg);
    }

    50% {
        opacity: 1;
        transform: translateX(calc(-50% - 7px)) rotate(135deg);
    }
}

@keyframes pb-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    80%       { transform: translateX(-3px); }
}


/* =========================================================
   Custom Name Input
   فیلد نام سفارشی در مرحله نهایی
   ========================================================= */

#pizza-custom-name {
    width: 100%;
    min-height: 48px; /* هم‌ارتفاع با ردیف‌های قیمت و دکمه‌ها */
    padding: 12px 16px;
    margin-bottom: 8px; /* فاصله از دکمه‌های پایین */

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: right;

    transition: 
        border-color var(--transition), 
        box-shadow var(--transition),
        outline var(--transition);
}

#pizza-custom-name::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.8;
}

#pizza-custom-name:hover {
    border-color: var(--border-dark);
}

#pizza-custom-name:focus {
    border-color: var(--primary);
    /* هماهنگ با افکت فوکوس دکمه‌های شما */
    outline: 3px solid rgba(30, 177, 166, 0.28); 
    outline-offset: 0;
}
