/* ============================================================
   فوتر کامل - نسخه نهایی و تمیز
   ============================================================ */

.footer-section {
    --footer-line: rgba(255, 255, 255, 0.09);
    --footer-muted: rgba(255, 255, 255, 0.62);
    --footer-gap: clamp(28px, 5vw, 56px);

    /* رنگ‌های خوانا روی پس‌زمینه #a8b098 (کنتراست بالای 4.5:1) */
    --footer-ink: #2a3923;
    --footer-heading: #553608;

    background: var(--footer-bg-start);
    margin-top: clamp(60px, 6vw, 70px);
    position: relative;
    padding-top: 20px;
    padding-bottom: clamp(12px, 2vw, 20px);
}

.footer-section li {
    list-style-type: none;
}

/* ============================================================
   چرخ شانس - عنصر شاخص فوتر، نصف داخل نصف بیرون
   ============================================================ */

.footer-news-wrap {
    position: relative;
    margin-top: clamp(-48px, -5vw, -26px);
    margin-bottom: clamp(28px, 4vw, 48px);
    z-index: 2;
    padding: 0 clamp(10px, 2vw, 15px);
}

/* ============================================================
   باکس چرخ شانس - کارت مینیمال با گرافیک چرخ واقعی
   ============================================================ */

.spin-widget {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 26px);
    background: var(--background-color);
    border: 4px solid var(--footer-bg-start);
    border-radius: var(--radius-lg, 22px);
    padding: clamp(12px, 1.8vw, 18px) clamp(18px, 3vw, 32px);
    max-width: 75%;
    margin: 0 auto;
    transition: var(--footer-transition);
}

.spin-widget:hover {
    box-shadow: 0 18px 40px rgba(196, 154, 106, 0.28);
}

.spin-wheel-visual {
    position: relative;
    width: clamp(56px, 6vw, 72px);
    height: clamp(56px, 6vw, 72px);
    flex-shrink: 0;
}

.spin-wheel-visual::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 154, 106, 0.35), transparent 70%);
    animation: wheelGlow 2.6s ease-in-out infinite;
}

.spin-wheel-disc {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--gold-dark) 0deg,
        var(--gold-light) 180deg,
        var(--gold-dark) 360deg
    );
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spinWheelSlow 9s linear infinite;
}

.spin-wheel-disc::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(196, 154, 106, 0.18);
}

.spin-wheel-percent {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--text-secondary);
    color: var(--cream);
    font-size: clamp(14px, 1.8vw, 17px);
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spinWheelSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes wheelGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.spin-widget-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 2.6vw, 32px);
}

.spin-widget-text {
    flex: 1;
    min-width: 0;
}

.spin-widget-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.spin-widget-heading h3 {
    margin: 0;
    font-size: clamp(14px, 1.7vw, 16px);
    font-weight: 800;
    color: var(--footer-ink);
    letter-spacing: -0.01em;
}

.spin-widget-tag {
    color: var(--footer-heading);
    font-size: 11px;
    font-weight: 700;
    position: relative;
    padding-inline-start: 12px;
}

.spin-widget-tag::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--footer-heading);
}

.spin-widget-sub {
    margin: 4px 0 0;
    font-size: clamp(11.5px, 1.4vw, 12.5px);
    color: var(--footer-ink);
}

.spin-widget-form {
    flex: 0 0 auto;
    width: clamp(260px, 30vw, 450px);
}

.spin-widget-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: var(--footer-transition);
}

.spin-widget-input-group:focus-within {
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 3px rgba(196, 154, 106, 0.14);
}

.spin-widget-input {
    flex: 1;
    min-width: 0;
    padding: 0 18px;
    border: none;
    border-radius: 0 10px 10px 0 !important;
    background: transparent;
    font-size: clamp(11.5px, 1.4vw, 12.5px);
    height: 42px;
    outline: none;
    color: var(--footer-ink);
}

.spin-widget-input::placeholder {
    color: #5f6b58; /* حدود 5.6:1 روی سفید */
    opacity: 1;
    font-size: 11.5px;
}

.spin-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--text-secondary);
    color: var(--cream);
    border: none;
    padding: 0 22px;
    font-weight: 700;
    font-size: clamp(11.5px, 1.4vw, 12.5px);
    cursor: pointer;
    white-space: nowrap;
    height: 42px;
    transition: var(--footer-transition);
}

.spin-widget-btn::after {
    content: '←';
    font-size: 14px;
    transition: transform 0.2s ease;
}

.spin-widget-btn:hover::after {
    transform: translateX(-3px);
}

.spin-widget-btn:hover {
    background: var(--primary-light);
}

.spin-widget-btn:focus-visible {
    outline: 2px solid var(--gold-dark);
    outline-offset: -2px;
}

.spin-widget-btn:active {
    opacity: 0.9;
}

.spin-widget-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 991.98px) {
    .spin-widget {
        border-radius: var(--radius-md);
    }
}

@media (max-width: 767.98px) {
    .spin-widget-body {
        flex-direction: column;
        align-items: stretch;
    }
    .spin-widget-form {
        width: 100%;
    }
    .spin-widget-sub {
        margin: 4px 0 12px;
    }
}

@media (max-width: 576px) {
    .footer-news-wrap {
        margin-top: clamp(-36px, -6vw, -35px);
        padding: 0 clamp(8px, 2vw, 12px);
    }
    .spin-widget {
        flex-direction: column;
        align-items: stretch;
        text-align: start;
        padding: 12px 14px;
        gap: 10px;
        border-radius: var(--radius-md, 16px);
        max-width: 92%;
    }
    .spin-wheel-visual {
        display: none;
    }
    .spin-widget-heading h3 {
        font-size: 13px;
    }
    .spin-widget-tag {
        font-size: 10px;
    }
    .spin-widget-sub {
        font-size: 11px;
        margin: 2px 0 8px;
    }
    .spin-widget-form {
        width: 100%;
    }
    .spin-widget-input {
        height: 40px;
        padding: 0 14px;
    }
    .spin-widget-btn {
        height: 40px;
        padding: 0 16px;
    }
}

#spinResult,
#spinResultDesktop {
    width: 100%;
    margin-top: 8px;
}

.spin-loading-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.spin-loading-result .loading-emoji {
    font-size: 30px;
    animation: spin 0.8s linear infinite;
}

.spin-loading-result .loading-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 6px;
}

.spin-error-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(160, 82, 82, 0.06);
    border-radius: var(--radius-md);
    border: 1px solid var(--wood-danger);
}

.spin-error-result .error-icon {
    font-size: 28px;
}

.spin-error-result .error-message {
    font-size: 12px;
    color: var(--wood-danger);
    margin: 6px 0;
    text-align: center;
}

.spin-error-result .btn-close-error {
    background: var(--wood-danger);
    color: #fff;
    border: none;
    padding: 4px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.spin-error-result .btn-close-error:hover {
    background: #8a4444;
    transform: scale(1.05);
}

.gap-20 {
    gap: 20px;
}

.spin-loading {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================
   محتوای فوتر — گرید مینیمال
   ============================================================ */

.footer-content {
    padding: 0 clamp(20px, 4vw, 64px);
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "brand"
        "links"
        "contact"
        "map";
    gap: var(--footer-gap);
}

.footer-col-brand { grid-area: brand; }
.footer-col-links { grid-area: links; }
.footer-col-contact { grid-area: contact; }
.footer-col-map { grid-area: map; }

@media (max-width: 991.98px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "brand brand"
            "links contact"
            "map map";
        gap: clamp(20px, 4vw, 32px) clamp(16px, 4vw, 28px);
    }
    .footer-col-links {
        border-inline-end: 1px solid var(--footer-line);
        padding-inline-end: clamp(16px, 4vw, 28px);
    }
}

.footer-links {
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px clamp(12px, 2vw, 24px);
}

@media (min-width: 992px) {
    .footer-links {
        display: flex;
        flex-direction: column !important;
        gap: 2px;
    }

    .footer-grid {
        grid-template-columns: 1.1fr 0.75fr 0.95fr 1.3fr;
        grid-template-areas: "brand links contact map";
        gap: clamp(28px, 3vw, 56px);
        align-items: stretch;
    }

    .footer-col + .footer-col {
        border-inline-start: 1px solid var(--footer-line);
        padding-inline-start: clamp(28px, 3vw, 56px);
    }

    .footer-col-links,
    .footer-col-contact,
    .footer-col-map {
        display: flex;
        flex-direction: column;
    }

    .footer-col-links .footer-links,
    .footer-col-contact .footer-contact-list,
    .footer-col-map .footer-map {
        margin-top: 0;
        margin-bottom: 0;
    }

    .footer-col-links .footer-col-title,
    .footer-col-contact .footer-col-title,
    .footer-col-map .footer-col-title {
        margin-top: 17px;
    }
}

.footer-col-title {
    display: block;
    color: var(--footer-heading);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.footer-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: url(/image/bakhshandeh.webp) center / cover;
    border: 2px solid var(--footer-line);
}

.footer-brand-name {
    color: var(--footer-heading);
    font-weight: 800;
    font-size: clamp(15px, 1.8vw, 17px);
    letter-spacing: -0.01em;
}

.footer-bio {
    color: var(--footer-ink);
    font-size: 13px;
    line-height: 1.9;
    text-align: justify;
    margin: 0 0 18px;
    max-width: 52ch;
}

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: rgba(212, 168, 106, 0.1);
    transition: var(--footer-transition);
}

.footer-social a:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

.footer-links a {
    display: block;
    padding: 8px 0;
    color: var(--footer-ink);
    opacity: 1;
    text-decoration: none;
    font-size: 13px;
    transition: var(--footer-transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--footer-heading);
    text-decoration: underline;
    padding-right: 4px;
}

/* ============================================================
   نوار پایین فوتر + نشان‌های اعتماد
   ============================================================ */

.footer-bottom {
    margin-top: clamp(28px, 4vw, 44px);
    padding-top: clamp(18px, 2.5vw, 24px);
    border-top: 1px solid var(--footer-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 28px;
}

.footer-copyright {
    margin: 0;
    color: var(--footer-ink);
    font-size: 12px;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-legal a {
    color: var(--footer-ink);
    opacity: 1;
    font-size: 12px;
    text-decoration: none;
    transition: var(--footer-transition);
}

.footer-legal a:hover {
    opacity: 1;
    color: var(--footer-heading);
    text-decoration: underline;
}

.footer-trust {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-trust a {
    display: inline-flex;
    align-items: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.footer-trust a:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.footer-trust img {
    display: block;
    border-radius: 6px;
    background: var(--cream);
    padding: 4px;
    height: auto;
}

/* اینماد کمی بزرگ‌تر */
.footer-trust > a:first-child img {
    max-height: 46px;
    width: auto;
}

/* زرینپال کوچک‌تر و منظم */
#zarinpal img {
    width: auto !important;
    height: 40px !important;
    max-height: 40px;
    padding: 2px;
}

@media (max-width: 576px) {
    .footer-bottom {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 18px;
    }

    .footer-trust {
        justify-content: center;
        gap: 16px;
    }

    .footer-trust > a:first-child img {
        max-height: 42px;
    }

    #zarinpal img {
        width: auto !important;
        height: 36px !important;
    }
}

/* ============================================================
   تماس و نقشه
   ============================================================ */

.footer-contact-list {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact-list lord-icon {
    flex-shrink: 0;
}

.footer-contact-list a,
.footer-contact-list span {
    color: var(--footer-ink);
    opacity: 1;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.6;
    transition: var(--footer-transition);
    overflow-wrap: anywhere;
}

.footer-contact-list a:hover {
    opacity: 1;
    color: var(--footer-heading);
    text-decoration: underline;
}

.footer-map {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--footer-line);
    line-height: 0;
}

@media (max-width: 991.98px) {
    .footer-contact-list a,
    .footer-contact-list span {
        font-size: 12px;
    }
    .footer-contact-list li {
        align-items: flex-start;
    }
}

.footer-map iframe {
    width: 100%;
    height: clamp(180px, 22vw, 200px);
    border: 0;
    display: block;
    filter: grayscale(0.15);
}

@media (max-width: 991.98px) {
    .footer-map iframe {
        height: 190px;
    }
}

.map-placeholder {
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f3f4f1;
    border-radius: var(--radius-md);
    color: #8a8070;
    font-size: 0.9rem;
}

.map-placeholder i {
    font-size: 1.6rem;
    color: #c1a88a;
}

.map-load-btn {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f3f4f1;
    border: 2px dashed #c1a88a;
    border-radius: var(--radius-lg);
    color: #535945;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ============================================================
   مودال‌های چرخ شانس
   ============================================================ */

#spinResultModal .modal-dialog,
#spinErrorModal .modal-dialog,
#spinLoadingModal .modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 60px);
}

#spinResultModal .modal-content,
#spinErrorModal .modal-content,
#spinLoadingModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid #eaeaea;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    background: #fff;
    margin: 10px;
}

.footer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    flex-shrink: 0;
}

.footer-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.footer-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.5;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.footer-modal-close:hover {
    opacity: 1;
}

#spinResultContent {
    padding: 0;
    max-height: 75vh;
    overflow-y: auto;
}

#spinErrorContent {
    padding: 30px 25px;
    text-align: center;
    max-height: 75vh;
    overflow-y: auto;
}

#spinLoadingContent {
    padding: 40px;
    text-align: center;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-body {
    scroll-behavior: smooth;
}

.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #6f7863;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #535945;
}

@keyframes confettiFall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.win-animation {
    animation: winPulse 0.5s ease-in-out 3;
}

@media (max-width: 576px) {
    #spinResultModal .modal-dialog,
    #spinErrorModal .modal-dialog,
    #spinLoadingModal .modal-dialog {
        margin: 10px;
        min-height: calc(100vh - 20px);
    }
    #spinResultModal .modal-content,
    #spinErrorModal .modal-content,
    #spinLoadingModal .modal-content {
        max-height: 95vh;
    }
    #spinResultModal .modal-body {
        max-height: 70vh !important;
    }
}

/* ============================================================
   فیلد اختیاری شماره تلفن - داخل مودال نتیجه‌ی چرخ شانس
   ============================================================ */

.phone-optin {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-md, 8px);
}

.phone-optin-label {
    margin: 0 0 8px;
    font-size: 12px;
    color: #fff;
    opacity: 0.9;
}

.phone-optin-row {
    display: flex;
    gap: 8px;
}

.phone-optin-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm, 4px);
    background: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    height: 34px;
    outline: none;
    text-align: center;
    direction: ltr;
    color: var(--primary, #0F1F1A);
}

.phone-optin-input:focus {
    border-color: var(--gold-dark, #C49A6A);
    box-shadow: 0 0 0 3px rgba(196, 154, 106, 0.25);
}

.btn-phone-submit {
    background: var(--gold-dark, #C49A6A);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 4px);
    padding: 0 16px;
    height: 34px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-phone-submit:hover {
    background: var(--accent-hover, #B88A4A);
    transform: scale(1.03);
}

.phone-optin-msg {
    margin-top: 6px;
    font-size: 11px;
    min-height: 14px;
}

.phone-optin-msg.is-error {
    color: #ffb3b3;
}

.phone-optin-success {
    margin: 0;
    font-size: 12px;
    color: #b8f0c0;
    text-align: center;
    padding: 4px 0;
}

@media (max-width: 480px) {
    .phone-optin-row {
        flex-direction: column;
    }
    .btn-phone-submit {
        width: 100%;
    }
}

/* ============================================================
   دسترسی‌پذیری
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .spin-wheel-disc,
    .spin-loading,
    .loading-emoji,
    .win-animation {
        animation: none !important;
    }
}

.map-preview {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 180px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
}

.map-preview__illustration {
    width: 100%;
    height: 100%;
    display: block;
}

.map-preview__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(83, 89, 69, 0.15);
    color: var(--cream);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.25s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.map-preview__overlay i {
    font-size: 1.4rem;
}

.map-preview:hover .map-preview__overlay {
    background: rgba(83, 89, 69, 0.3);
}