/* iOS-style Jalali birthday wheel — فقط موبایل؛ بدون خراب کردن layout */

.ob-date-row,
.date-row {
    display: flex;
    align-items: stretch;
    gap: .4rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ob-date-row .ob-date-parts,
.date-row .date-parts,
.date-row [data-birthday-parts] {
    flex: 1 1 auto;
    min-width: 0;
}

/* باکس‌های دستی تاریخ برای پنل مشتری / ثبت‌نام کلاسیک */
[data-birthday-parts] {
    display: flex;
    align-items: center;
    gap: .35rem;
    direction: ltr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

[data-birthday-parts] .date-part,
[data-birthday-parts] .ob-date-part {
    border: 1px solid #d1d5db;
    border-radius: .65rem;
    padding: .55rem .35rem;
    font-size: .875rem;
    font-family: inherit;
    text-align: center;
    background: #fff;
    color: #111827;
    min-height: 2.5rem;
    min-width: 0;
    box-shadow: none;
}

[data-birthday-parts] .date-part:focus,
[data-birthday-parts] .ob-date-part:focus {
    outline: none;
    border-color: var(--ob-primary, var(--cp-brand, #2563eb));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ob-primary, var(--cp-brand, #2563eb)) 22%, white);
}

[data-birthday-parts] .date-part.is-invalid,
[data-birthday-parts] .ob-date-part.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px color-mix(in srgb, #dc2626 18%, white);
}

.bd-birthday-error {
    margin: .35rem 0 0;
    font-size: .72rem;
    color: #dc2626;
    line-height: 1.45;
}

.bd-birthday-error[hidden] {
    display: none;
}

[data-birthday-parts] .date-year,
[data-birthday-parts] .ob-date-year { flex: 1.25 1 0; }
[data-birthday-parts] .date-month,
[data-birthday-parts] .date-day,
[data-birthday-parts] .ob-date-month,
[data-birthday-parts] .ob-date-day { flex: 0.9 1 0; }

[data-birthday-parts] .date-sep,
[data-birthday-parts] .ob-date-sep {
    color: #6b7280;
    font-weight: 700;
    flex: 0 0 auto;
    user-select: none;
}

.bd-wheel-open-btn {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.85rem;
    width: 2.85rem;
    min-height: 2.85rem;
    border: 1px solid color-mix(in srgb, var(--ob-primary, var(--cp-brand, #e11d48)) 28%, #d7dbe3);
    border-radius: .85rem;
    background: var(--ob-primary-soft, var(--cp-brand-soft, #fff1f2));
    color: var(--ob-primary, var(--cp-brand, #e11d48));
    font: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.bd-wheel-open-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

.bd-wheel-open-btn .bd-wheel-open-label {
    display: none;
}

@media (max-width: 768px) {
    .bd-wheel-open-btn {
        display: inline-flex;
    }
}

/* فقط وقتی باز است دیده شود — display:flex پیش‌فرض باعث پوشش صفحه می‌شد */
.bd-wheel-root {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10060;
    flex-direction: column;
    justify-content: flex-end;
    font-family: "shabnam", Arial, Helvetica, sans-serif;
}

.bd-wheel-root.is-open {
    display: flex;
}

.bd-wheel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    animation: bd-wheel-fade .2s ease;
}

.bd-wheel-sheet {
    position: relative;
    background: #f2f2f7;
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
    animation: bd-wheel-up .28s cubic-bezier(.22, 1, .36, 1);
    max-width: 100%;
}

.bd-wheel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    border-radius: 14px 14px 0 0;
}

.bd-wheel-toolbar button {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    padding: .35rem .5rem;
    color: var(--ob-primary, var(--cp-brand, #007aff));
}

.bd-wheel-toolbar .bd-wheel-cancel {
    color: #8e8e93;
    font-weight: 500;
}

.bd-wheel-toolbar .bd-wheel-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1c1c1e;
}

.bd-wheel-body {
    position: relative;
    height: 216px;
    margin: .35rem 0 .75rem;
    direction: ltr;
}

.bd-wheel-highlight {
    pointer-events: none;
    position: absolute;
    left: .75rem;
    right: .75rem;
    top: 50%;
    height: 36px;
    margin-top: -18px;
    border-radius: 8px;
    background: rgba(120, 120, 128, 0.16);
    z-index: 1;
}

.bd-wheel-fade-top,
.bd-wheel-fade-bottom {
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 2;
}

.bd-wheel-fade-top {
    top: 0;
    background: linear-gradient(to bottom, #f2f2f7 10%, rgba(242, 242, 247, 0));
}

.bd-wheel-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, #f2f2f7 10%, rgba(242, 242, 247, 0));
}

.bd-wheel-cols {
    position: relative;
    z-index: 0;
    display: flex;
    height: 100%;
    gap: 0;
}

.bd-wheel-col {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    text-align: center;
    scrollbar-width: none;
}

.bd-wheel-col::-webkit-scrollbar {
    display: none;
}

.bd-wheel-col[data-col="year"] {
    flex: 1.2;
}

.bd-wheel-item {
    height: 36px;
    line-height: 36px;
    scroll-snap-align: center;
    font-size: 1.05rem;
    color: #3a3a3c;
    user-select: none;
}

.bd-wheel-item.is-active {
    color: #000;
    font-weight: 700;
}

@keyframes bd-wheel-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bd-wheel-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (min-width: 769px) {
    .bd-wheel-root {
        display: none !important;
    }
}
