/* ==========================================================================
   SEDAAR STORE - PREMIUM BLUE BRAND POPUP & AUTH MODAL STYLES
   ========================================================================== */

:root {
    --sedaar-primary: #0070f3;
    --sedaar-primary-hover: #005bb5;
    --sedaar-primary-gradient: linear-gradient(135deg, #0070f3 0%, #0051ba 100%);
    --sedaar-primary-glow: rgba(0, 112, 243, 0.35);
    --sedaar-accent-ring: rgba(0, 112, 243, 0.18);
    --sedaar-bg-soft: #f0f7ff;
    --sedaar-border: #dbeafe;
    --sedaar-dark: #0f172a;
    --sedaar-gray: #64748b;
}

/* Cart Page Button (Blue Brand) */
.sedaar-blue-btn,
.sedaar-pink-btn,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout button.checkout-button,
.woocommerce-cart .cart-collaterals .checkout-button,
.woocommerce-cart .checkout-button,
#sedaar-open-auth-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 52px !important;
    background: var(--sedaar-primary-gradient) !important;
    background-color: var(--sedaar-primary) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 6px 20px var(--sedaar-primary-glow) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    margin-top: 15px !important;
    line-height: 1.5 !important;
    letter-spacing: -0.2px !important;
}

.sedaar-blue-btn span,
.sedaar-blue-btn .btn-text,
#sedaar-open-auth-btn span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.sedaar-blue-btn:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout button.checkout-button:hover,
.woocommerce-cart .checkout-button:hover,
#sedaar-open-auth-btn:hover {
    background: linear-gradient(135deg, #0062d2 0%, #00449e 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 28px rgba(0, 112, 243, 0.5) !important;
}

/* Modal Backdrop */
.sedaar-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 999999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.sedaar-modal-backdrop.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix Woodmart override on Sedaar close buttons */
button.sedaar-modal-close,
.sedaar-modal-close,
#sedaar-auth-close-x,
#sedaar-cart-close-x {
    position: absolute !important;
    top: 18px !important;
    left: 18px !important;
    right: auto !important;
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #64748b !important;
    box-shadow: none !important;
    transition: all 0.25s ease !important;
    z-index: 100 !important;
    line-height: 1 !important;
}

button.sedaar-modal-close:hover,
.sedaar-modal-close:hover,
#sedaar-auth-close-x:hover,
#sedaar-cart-close-x:hover {
    background: #fee2e2 !important;
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #ef4444 !important;
    transform: rotate(90deg) !important;
}

button.sedaar-modal-close svg,
.sedaar-modal-close svg,
#sedaar-auth-close-x svg,
#sedaar-cart-close-x svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    display: block !important;
    stroke: currentColor !important;
    margin: 0 auto !important;
}

/* 1. Add to Cart Success Popup */
.sedaar-cart-modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 28px;
    width: 100%;
    max-width: 440px;
    padding: 40px 30px 32px 30px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 112, 243, 0.1);
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    direction: rtl;
    font-family: inherit;
    z-index: 100;
}

.sedaar-modal-backdrop.active .sedaar-cart-modal-box,
.sedaar-modal-backdrop.active .sedaar-auth-modal-box {
    transform: scale(1) !important;
}

.sedaar-cart-icon-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 22px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sedaar-cart-icon-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px dashed rgba(0, 112, 243, 0.35);
}

.sedaar-cart-icon-ring.ring-1 {
    width: 88px;
    height: 88px;
    animation: sedaar-spin 20s linear infinite;
}

.sedaar-cart-icon-ring.ring-2 {
    width: 70px;
    height: 70px;
    border: 1.5px dotted rgba(0, 112, 243, 0.5);
    animation: sedaar-spin-rev 14s linear infinite;
}

.sedaar-cart-icon-circle {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #bfdbfe;
    box-shadow: 0 4px 15px rgba(0, 112, 243, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes sedaar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sedaar-spin-rev {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.sedaar-cart-modal-title {
    font-size: 21px;
    font-weight: 800;
    color: var(--sedaar-dark);
    margin: 0 0 10px 0;
    letter-spacing: -0.3px;
}

.sedaar-cart-modal-desc {
    font-size: 15px;
    color: var(--sedaar-gray);
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.sedaar-cart-modal-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
}

.sedaar-btn-secondary {
    flex: 1;
    height: 48px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    color: #475569;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sedaar-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.sedaar-btn-primary {
    flex: 1;
    height: 48px;
    background: var(--sedaar-primary-gradient);
    border: none;
    border-radius: 14px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 5px 18px var(--sedaar-primary-glow);
    transition: all 0.25s;
}

.sedaar-btn-primary span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.sedaar-btn-primary:hover {
    background: linear-gradient(135deg, #0062d2 0%, #00449e 100%);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(0, 112, 243, 0.5);
    transform: translateY(-1px);
}

/* 2. OTP Auth Modal */
.sedaar-auth-modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    padding: 38px 32px 34px 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 112, 243, 0.1);
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    direction: rtl;
    font-family: inherit;
    z-index: 100;
}

.sedaar-auth-header {
    margin-bottom: 22px;
    position: relative;
}

/* Logo container & image clean reset */
.sedaar-logo-container,
.sedaar-auth-header .sedaar-logo-container {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 14px auto !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    position: relative !important;
}

.sedaar-auth-header::before,
.sedaar-auth-header::after,
.sedaar-logo-container::before,
.sedaar-logo-container::after,
.sedaar-logo-img::before,
.sedaar-logo-img::after {
    display: none !important;
    content: none !important;
}

.sedaar-logo-img,
.sedaar-auth-header img.sedaar-logo-img {
    height: 54px !important;
    width: auto !important;
    max-width: 190px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
}

.sedaar-auth-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--sedaar-dark);
    margin: 0 0 6px 0;
}

.sedaar-auth-subtitle {
    font-size: 14px;
    color: var(--sedaar-gray);
    margin: 0;
    line-height: 1.5;
}

.sedaar-step-container {
    animation: sedaar-fadeIn 0.25s ease;
}

@keyframes sedaar-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.sedaar-input-group {
    text-align: right;
    margin-bottom: 18px;
}

.sedaar-input-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.sedaar-input-field {
    width: 100%;
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 16px;
    font-size: 15px;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sedaar-input-field:focus {
    border-color: var(--sedaar-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 112, 243, 0.12);
}

.sedaar-otp-input {
    letter-spacing: 12px;
    font-size: 22px;
    text-align: center;
    font-weight: 800;
    color: var(--sedaar-primary);
}

.sedaar-phone-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 6px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    color: #1e3a8a;
    font-weight: 600;
}

.sedaar-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--sedaar-primary);
    transition: opacity 0.2s;
}

.sedaar-edit-btn:hover {
    opacity: 0.7;
}

.sedaar-timer-row {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 18px;
    text-align: center;
}

.sedaar-link-btn {
    background: none;
    border: none;
    color: var(--sedaar-primary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 0;
}

.sedaar-link-btn:hover {
    color: var(--sedaar-primary-hover);
}

.sedaar-error-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: #dc2626;
    margin-bottom: 16px;
    text-align: right;
    line-height: 1.4;
}

/* Submit Buttons - Pure White Text Enforcement */
.sedaar-btn-submit,
button.sedaar-btn-submit,
.woocommerce-cart .sedaar-btn-submit,
#sedaar-phone-submit,
#sedaar-name-submit,
#sedaar-otp-submit {
    width: 100% !important;
    height: 50px !important;
    background: var(--sedaar-primary-gradient) !important;
    background-color: var(--sedaar-primary) !important;
    border: none !important;
    border-radius: 14px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 5px 18px var(--sedaar-primary-glow) !important;
    transition: all 0.25s ease !important;
    font-family: inherit !important;
}

.sedaar-btn-submit span,
.sedaar-btn-submit .btn-text,
#sedaar-phone-submit span,
#sedaar-name-submit span,
#sedaar-otp-submit span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
}

.sedaar-btn-submit:hover,
#sedaar-phone-submit:hover,
#sedaar-name-submit:hover,
#sedaar-otp-submit:hover {
    background: linear-gradient(135deg, #0062d2 0%, #00449e 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(0, 112, 243, 0.5) !important;
    transform: translateY(-1px);
}

.sedaar-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: sedaar-spin 0.8s linear infinite;
    display: inline-block;
}

/* Responsive */
@media (max-width: 480px) {
    .sedaar-cart-modal-box,
    .sedaar-auth-modal-box {
        padding: 30px 20px 24px 20px;
        border-radius: 22px;
    }
    .sedaar-cart-modal-title,
    .sedaar-auth-title {
        font-size: 18px;
    }
    .sedaar-cart-icon-wrapper {
        width: 76px;
        height: 76px;
        margin-bottom: 16px;
    }
    .sedaar-cart-icon-ring.ring-1 {
        width: 76px;
        height: 76px;
    }
    .sedaar-cart-icon-ring.ring-2 {
        width: 60px;
        height: 60px;
    }
    .sedaar-cart-icon-circle {
        width: 46px;
        height: 46px;
    }
}

/* ==========================================================================
   CART TOTALS HIDING & PROCEED BUTTON STYLING
   ========================================================================== */
.woocommerce-cart .cart_totals > h2,
.woocommerce-cart .cart_totals .cart-totals-inner > h2,
.woocommerce-cart .cart_totals table.shop_table,
.woocommerce-cart .wd-cart-totals h2,
.woocommerce-cart .wd-cart-totals table.shop_table,
.woocommerce-cart .elementor-element-4e3ba00 .elementor-widget-wd_title,
.woocommerce-cart .elementor-element-29eff2f {
    display: none !important;
}

.woocommerce-cart .elementor-element-4e3ba00 {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.woocommerce-cart .cart_totals,
.woocommerce-cart .cart_totals .cart-totals-inner,
.woocommerce-cart .wd-cart-totals,
.woocommerce-cart .wd-cart-totals .cart-totals-inner {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.woocommerce-cart .wc-proceed-to-checkout {
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout button,
.woocommerce-cart #sedaar-open-auth-btn {
    margin: 0 !important;
    width: 100% !important;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button span,
.woocommerce-cart .wc-proceed-to-checkout #sedaar-open-auth-btn span {
    display: none !important;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
.woocommerce-cart .wc-proceed-to-checkout #sedaar-open-auth-btn::after {
    content: "ادامه خرید" !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    display: inline-block !important;
}

/* Desktop Cart: Reorder FAQ above Proceed to Checkout (ادامه خرید) button */
@media (min-width: 769px) {
    .woocommerce-cart .elementor-element-1e4837f > .elementor-widget-wrap,
    .woocommerce-cart .elementor-col-33 > .elementor-widget-wrap {
        display: flex !important;
        flex-direction: column !important;
    }

    .woocommerce-cart .elementor-element-662a872 {
        order: 1 !important;
        margin-bottom: 20px !important;
    }

    .woocommerce-cart .elementor-element-4e3ba00 {
        order: 2 !important;
        margin-top: 0 !important;
    }
}

/* Mobile Cart View: Remove extra scroll & make "ادامه خرید" immediately visible without scrolling */
@media (max-width: 768px) {
    /* 1. Hide Cross-sells (محصولات پیشنهادی) */
    .elementor-element-328a99e,
    .woocommerce-cart .cross-sells {
        display: none !important;
    }

    /* 2. Hide FAQ (سوالات متداول) on Mobile */
    .elementor-element-662a872,
    .elementor-element-096f446,
    .elementor-element-59f433d {
        display: none !important;
    }

    /* 3. Sticky Bottom Action Bar for "ادامه خرید" */
    .woocommerce-cart .elementor-element-4e3ba00 {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        padding: 12px 16px max(12px, env(safe-area-inset-bottom, 12px)) 16px !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
        border-top: 1px solid #f1f5f9 !important;
        z-index: 99999 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        order: unset !important;
    }

    .woocommerce-cart .elementor-element-4e3ba00 .wc-proceed-to-checkout {
        margin: 0 !important;
        padding: 0 !important;
    }

    .woocommerce-cart .elementor-element-4e3ba00 a.checkout-button,
    .woocommerce-cart .elementor-element-4e3ba00 button.checkout-button {
        margin: 0 !important;
        height: 50px !important;
        min-height: 50px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        box-shadow: 0 4px 14px rgba(0, 112, 243, 0.4) !important;
    }

    /* Ensure bottom content is not covered by sticky bar */
    .woocommerce-cart .elementor-element-5dd9ffe,
    .woocommerce-cart .cart-collaterals,
    .woocommerce-cart .woocommerce {
        padding-bottom: 90px !important;
    }

    /* Hide default Woodmart bottom toolbar on cart page to avoid overlap */
    .woocommerce-cart .wd-toolbar {
        display: none !important;
    }
}


