/* 
==================================================
   SORA LOGIN FORM — ahp-form styles
   Fix: phone input display, OTP inputs visibility
   ================================================== */

/* YekanBakh font is loaded via wp_enqueue_style (see functions.php) - @import removed for performance */

/* White background for login page */
body.page-id-1074,
body.page-id-1074 .site,
body.page-id-1074 #page,
body.page-id-1074 #content,
body.page-id-1074 .site-content,
body.page-id-1074 .elementor-section-wrap,
body.page-id-1074 .e-con,
body.page-id-1074 .elementor,
body.page-id-1074 [data-elementor-type],
body.page-id-1074 .elementor-1074 {
    background: #ffffff !important;
    background-image: none !important;
}

/* Page wrapper — center the card */
.ahp-form-container {
    direction: rtl;
    font-family: 'yekan bakh', YekanBakh, Tahoma, sans-serif;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.10);
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Logged-in box */
.ahp-form-container.logged-in-box {
    text-align: center;
    font-size: 15px;
    color: #333;
    padding: 32px 24px;
}

.ahp-form-container.logged-in-box a {
    display: inline-block;
    margin-top: 12px;
    color: #125dff;
    text-decoration: none;
    font-weight: 600;
}

/* Steps */
.ahp-step {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Description text */
.ahp-form-description {
    font-size: 14px;
    color: #555;
    text-align: center;
    margin: 0 0 8px !important;
    line-height: 1.7 !important;
}

/* Message box */
.ahp-message-box {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.ahp-message-box.success {
    background: #e8f7f6;
    color: #117a72;
    border: 1px solid rgba(24,155,145,0.25);
}

.ahp-message-box.error {
    background: #fff5f5;
    color: #c0392b;
    border: 1px solid #fecaca;
}

/* Input group */
.ahp-form-group {
    position: relative;
    display: flex;
    align-items: center;
}

.ahp-form-group .ahp-input-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca0aa;
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Phone input — fix number display */
.ahp-form-container #ahp_phone {
    width: 100% !important;
    height: 48px !important;
    padding: 0 44px 0 16px !important;
    border: 1.5px solid #e2e4e8 !important;
    border-radius: 10px !important;
    background: #f8f9fa !important;
    font-family: 'Tahoma', sans-serif !important;
    font-size: 16px !important;
    color: #1a1a1a !important;
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    letter-spacing: 1px;
}

.ahp-form-container #ahp_phone::placeholder {
    color: #c8cbd2;
    font-size: 13px;
}

.ahp-form-container #ahp_phone:focus {
    border-color: #125dff !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(18,93,255,0.12) !important;
}

.ahp-form-container .ahp-form-group.input-is-active #ahp_phone {
    border-color: #125dff !important;
    background: #fff !important;
}

/* Name input */
.ahp-form-container #ahp_user_name {
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px !important;
    border: 1.5px solid #e2e4e8 !important;
    border-radius: 10px !important;
    background: #f8f9fa !important;
    font-family: 'Tahoma', sans-serif !important;
    font-size: 15px !important;
    color: #1a1a1a !important;
    direction: rtl !important;
    text-align: right !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.ahp-form-container #ahp_user_name:focus {
    border-color: #125dff !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(18,93,255,0.12) !important;
}

/* Submit button */
#ahp-login-btn,
#ahp-save-name-btn {
    width: 100% !important;
    height: 48px !important;
    background: #125dff !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: 'Tahoma', sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

#ahp-login-btn:hover,
#ahp-save-name-btn:hover {
    background: #0044cc !important;
}

#ahp-login-btn:disabled,
#ahp-save-name-btn:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
}

/* OTP inputs — fix visibility */
#ahp-otp-inputs {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    direction: ltr !important;
    margin: 4px 0 !important;
}

.ahp-form-container .otp-digit {
    width: 52px !important;
    height: 56px !important;
    border: 1.5px solid #e2e4e8 !important;
    border-radius: 10px !important;
    background: #f8f9fa !important;
    font-family: 'Tahoma', sans-serif !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    text-align: center !important;
    direction: ltr !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ahp-form-container .otp-digit:focus {
    border-color: #125dff !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(18,93,255,0.12) !important;
}

.ahp-form-container .otp-digit.error {
    border-color: #e03e3e !important;
    background: #fff5f5 !important;
}

/* Controls row (resend / change phone) */
.ahp-controls {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 4px !important;
}

.link-btn {
    background: none !important;
    border: none !important;
    color: #125dff !important;
    font-family: 'Tahoma', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 4px 0 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.link-btn:disabled {
    color: #9ca0aa !important;
    cursor: not-allowed !important;
}

.link-btn:hover:not(:disabled) {
    color: #0044cc !important;
}

/* Mobile */
@media (max-width: 480px) {
    .ahp-form-container {
        padding: 28px 16px 22px !important;
        border-radius: 12px !important;
    }

    .ahp-form-container .otp-digit {
        width: 44px !important;
        height: 50px !important;
        font-size: 19px !important;
    }

    #ahp-otp-inputs {
        gap: 7px !important;
    }
}

/* ==================================================

/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* ================================================
   FB ACCORDION — مخفی کردن جواب تا کلیک کاربر
   ================================================ */

/* جواب فقط در آیتم باز (کلاس on) نمایش داده شود */
.fba-item:not(.on) .fba-ans-in {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* جلوگیری از overflow */
.fba-wrap,
.fba-item,
.fba-ans,
.fba-ans > div {
    overflow: hidden !important;
}

.fba-ans-in {
    box-sizing: border-box !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

/* ================================================
   BOTTOM NAV MOBILE FIX
   ================================================ */

/* فوتر کلی همیشه نمایش داده شود */
.elementor-location-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 1024px) {

    /* === bottom nav === */
    .elementor-element-e2aaa5e {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 9999 !important;
        pointer-events: auto !important;
    }

    /* === cart widget در موبایل - فقط toggle را پنهان کن (داخل bottom nav هست) === */
    .elementor-element-d17fc6c > .elementor-widget-container > .elementor-menu-cart__wrapper > .elementor-menu-cart__toggle {
        display: none !important;
    }
    /* mini-cart panel بالای bottom nav باشه */
    .elementor-element-d17fc6c .elementor-menu-cart__main {
        z-index: 99999 !important;
        bottom: 90px !important;
    }
}

/* ================================================
   RELATED PRODUCTS
   ================================================ */

.elementor-1238 .elementor-element.elementor-element-8b8a200 {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px 0 12px 0 !important;
}
.elementor-1238 .elementor-element.elementor-element-393bd16 {
    box-shadow: none !important;
    background-color: transparent !important;
    padding: 0 16px !important;
    margin-bottom: 12px !important;
}
.elementor-1238 .elementor-element.elementor-element-bde60fd {
    box-shadow: none !important;
}

/* Section wrapper - no height limit */
.elementor-1238 .elementor-element.elementor-element-90330f3 {
    --min-height: 0px !important;
    min-height: 0 !important;
    height: auto !important;
}

/* Swiper - all layers auto height */
.elementor-1238 .elementor-element.elementor-element-8962339 {
    height: auto !important;
}
.elementor-1238 .elementor-element.elementor-element-8962339 .swiper {
    height: auto !important;
}
.elementor-1238 .elementor-element.elementor-element-8962339 .swiper-wrapper {
    height: auto !important;
    align-items: stretch !important;
}
.elementor-1238 .elementor-element.elementor-element-8962339 .swiper-slide {
    height: auto !important;
    display: flex !important;
    align-items: stretch !important;
}
/* Override Elementor inline: swiper-slide > .elementor-element { height:100% } */
.elementor-1238 .elementor-element.elementor-element-8962339 .swiper-slide > .elementor-element {
    height: auto !important;
    width: 100% !important;
}

/* Card */
.elementor-4107 .elementor-element.elementor-element-deca6da {
    height: auto !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
}
.elementor-4107 .elementor-element.elementor-element-deca6da > .e-con-inner {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Image fixed height */
.elementor-4107 .elementor-element.elementor-element-5ab7fcf {
    flex-shrink: 0 !important;
    width: 100% !important;
    height: 140px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}
.elementor-4107 .elementor-element.elementor-element-5ab7fcf img {
    max-height: 125px !important;
    max-width: 85% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Price container */
.elementor-4107 .elementor-element.elementor-element-d1d8e12 {
    height: auto !important;
    min-height: unset !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

/* MOBILE */
@media (max-width: 767px) {
    .elementor-1238 .elementor-element.elementor-element-90330f3 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .elementor-1238 .elementor-element.elementor-element-8b8a200 {
        padding: 12px 0 8px 0 !important;
    }
    .elementor-1238 .elementor-element.elementor-element-393bd16 {
        padding: 0 12px !important;
        margin-bottom: 8px !important;
    }
    .elementor-1238 .elementor-element.elementor-element-bde60fd {
        padding: 8px 12px !important;
    }
    .elementor-4107 .elementor-element.elementor-element-5ab7fcf {
        height: 110px !important;
    }
    .elementor-4107 .elementor-element.elementor-element-5ab7fcf img {
        max-height: 95px !important;
    }
}

/* ============================================
   WPR Taste Recommender - Mobile Carousel
   (دیجی‌کالا style - horizontal scroll)
   ============================================ */
@media (max-width: 768px) {
    .wpr-container {
        flex-direction: row !important;
        height: auto !important;
        border-radius: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 8px 0 !important;
        gap: 0 !important;
        flex-wrap: nowrap !important;
    }
    .wpr-container::-webkit-scrollbar {
        display: none !important;
    }
    .wpr-category {
        width: 68vw !important;
        min-width: 68vw !important;
        max-width: 68vw !important;
        flex-shrink: 0 !important;
        flex-direction: column !important;
        scroll-snap-align: start !important;
        margin-bottom: 0 !important;
        padding: 6px 8px !important;
        border-bottom: none !important;
        box-sizing: border-box !important;
    }
    .wpr-category:not(:last-child) {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        border-left: 1px solid #f0f0f1 !important;
    }
    /* جداکننده‌های عمودی بین ستون‌ها پنهان */
    .wpr-container > div[style*="width: 1px"] {
        display: none !important;
    }
    .wpr-box {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: auto !important;
        gap: 4px !important;
    }
    .wpr-box::before,
    .wpr-box::after {
        display: none !important;
    }
    .wpr-box a img {
        max-width: 100% !important;
        max-height: 120px !important;
    }
}

}
.elementor-223 .elementor-element-11740976>.e-con-inner{display:contents!important;}
}
/* ================================================
   OTP INPUT COLOR FIX
   Override Elementor kit --e-global-color-text (#F1F3FF)
   which makes text invisible on white background
   ================================================ */
.elementor-kit-15 .otp-digit,
.elementor-kit-15 #ahp-otp-inputs .otp-digit,
#ahp-otp-inputs input.otp-digit,
.ahp-form-container .otp-digit {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

/* ================================================
   Archive: fix horizontal scroll on tablet (768-1024px)
   ================================================ */
@media (max-width: 1024px) {
  .elementor-283 .elementor-element.elementor-element-5daf688e {
    flex-direction: column !important;
  }
  .elementor-283 .elementor-element.elementor-element-60509080,
  .elementor-283 .elementor-element.elementor-element-410ba6ac {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }
}

body { overflow-x: hidden; }

/* ================================================
   Product page: fix white space on tablet (768-1024px)
   Elementor maps --width/--flex-direction via var()
   CSS custom props ignore !important so we override
   the real computed properties with high specificity
   ================================================ */
@media (max-width: 1024px) and (min-width: 768px) {
  /* wrapper: force column layout and full width */
  body .elementor-1238 .elementor-element.elementor-element-8f9a80e.e-con,
  body .elementor-1238 .elementor-element.elementor-element-8f9a80e {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body .elementor-1238 .elementor-element.elementor-element-8f9a80e > .e-con-inner {
    flex-direction: column !important;
    width: 100% !important;
  }
  /* image block */
  body .elementor-1238 .elementor-element.elementor-element-b2bab04.e-con,
  body .elementor-1238 .elementor-element.elementor-element-b2bab04 {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* product info block */
  body .elementor-1238 .elementor-element.elementor-element-c92eaeb.e-con,
  body .elementor-1238 .elementor-element.elementor-element-c92eaeb {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* sidebar */
  body .elementor-1238 .elementor-element.elementor-element-4f11044.e-con,
  body .elementor-1238 .elementor-element.elementor-element-4f11044 {
    width: 100% !important;
    max-width: 100% !important;
  }
}


add_filter( 'wp_speculation_rules_configuration', function ( $config ) {

  if (
    function_exists( 'is_woocommerce' ) &&
    (
      is_woocommerce() ||
      is_cart() ||
      is_checkout() ||
      is_account_page()
    )
  ) {
    return $config;
  }

  if ( is_array( $config ) ) {
    $config['mode']      = 'prerender';
    $config['eagerness'] = 'moderate';
  }

  return $config;
} );
