.membership-deal-container {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    border: 2px #eaedf4 solid;
}

.membership-deal-container.rtl {
    direction: rtl;
}

.membership-deal-icon {
    margin-right: 15px;
}
.rtl .membership-deal-icon {
    margin-left: 15px;
    margin-right: 0;
}

.membership-deal-icon img {
    width: 40px;
    vertical-align: middle;
}

.membership-deal-text {
    padding-left: 10px;
    color: #2A2C2F;
}
.rtl .membership-deal-text {
    padding-left: 0;
    padding-right: 10px;
}
.membership-deal-text .title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    color: #2A2C2F;
}

.membership-deal-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.membership-deal-text .highlight {
    color: #3866df;
    font-weight: bold;
}
.membership-deal-text a {
    color: #3866df;
    text-decoration: underline;
    font-weight: bold;
}
.membership-deal-text input[type="checkbox"] {
    vertical-align: middle;
    margin-top: -2px;
}

/* Dumyah-puls membership popup */
#membership-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Lock page scroll when overlay is open */
body.overlay-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#membership-popup-overlay.show {
    opacity: 1;
}

/* Debug: Make overlay visible when active */
#membership-popup-overlay[style*="flex"] {
    display: flex !important;
    opacity: 1 !important;
    background-color: rgba(0,0,0,0.5) !important;
}

#membership-popup {
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 30px 20px;
    border-radius: 15px;
    width: 700px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 82vh;
    overflow-y: auto;
    z-index: 1001;
    box-sizing: border-box;
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Mobile slide-up animation */
@media (max-width: 768px) {
    #membership-popup {
        position: fixed !important;
        bottom: -100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        border-radius: 15px 15px 0 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 70vh !important;
        transition: bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        top: auto !important;
    }

    #membership-popup.show {
        bottom: 0 !important;
    }
}

/* Close button */
#membership-popup .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#membership-popup .close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

/* Dumyah-puls header */
.membership-header {
    text-align: center;
    padding: 10px 0 20px 0;
    top: 0;
    background: #fff;
    z-index: 10;
    margin-bottom: 10px;
}

.membership-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.membership-logo img {
    width: 50px;
    height: 50px;
}

/* Overlay-specific enlarged Dumyah Super styling */
#membership-popup .membership-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    max-width: 300px;
    gap: 8px;
}

#membership-popup .overlay-membership-icon {
    width: 80px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    /* Keep original icon color - no filter */
}

#membership-popup .overlay-dumyah-super-badge {
    background-color: #3866df;
    border-radius: 30px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(56, 102, 223, 0.3);
    min-width: 140px;
}

#membership-popup .overlay-dumyah-text {
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 1;
    margin: 0;
    padding: 0;
    font-family: var(--font-regular), "Cairo", sans-serif;
}

#membership-popup .overlay-super-text {
    color: white;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    font-family: var(--font-regular), "Cairo", sans-serif;
}

/* RTL support for overlay styling */
#membership-popup.rtl .membership-logo {
    flex-direction: row-reverse;
}

#membership-popup.rtl .overlay-membership-icon {
    transform: scaleX(-1);
    order: 2; /* Make icon first visually (right side in RTL) */
}

#membership-popup.rtl .overlay-dumyah-super-badge {
    align-items: center;
    order: 1; /* Make text second visually (left side in RTL) */
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #3866df;
}

.personalized-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #1a1a1a;
}

.trial-details {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Dumyah-puls benefits section */
.membership-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 5px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8f2ff;
}

.benefit-icon {
    margin-right: 10px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon svg {
    fill: white;
}

.benefit-text {
    flex: 1;
}

.benefit-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.benefit-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Plan selection section */
.plan-selection h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1a1a1a;
    padding: 0 5px;
}

.plans {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 5px;
}

.plan-option {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    position: relative;
    background: #fff;
    transition: all 0.3s ease;
}

.plan-option:hover {
    border-color: #3866df;
    box-shadow: 0 2px 8px rgba(56, 102, 223, 0.1);
}

.plan-option.active {
    border-color: #3866df;
    background: #f8f9ff;
    box-shadow: 0 0 0 1px #3866df;
}

.plan-option input[type="radio"] {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 1;
    accent-color: #3866df;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.plan-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.plan-price {
    font-size: 20px;
    font-weight: bold;
    color: #3866df;
    margin-bottom: 4px;
}

.plan-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.save-badge {
    background: #3866df;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

/* Payment method selection */
.payment-method h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1a1a1a;
    padding: 0 5px;
}

.payment-options {
    margin-bottom: 25px;
    padding: 0 5px;
}

.existing-cards {
    margin-bottom: 20px;
}

.payment-item {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-item:hover {
    border-color: #3866df;
    box-shadow: 0 2px 8px rgba(56, 102, 223, 0.1);
}

.payment-item input[type="radio"] {
    margin-right: 12px;
    accent-color: #3866df;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-type {
    font-weight: bold;
    font-size: 16px;
    color: #1a1a1a;
}

.card-name {
    font-size: 14px;
    color: #666;
}

.card-expiry {
    font-size: 12px;
    color: #999;
}

.add-payment-section {
    margin-top: 15px;
}

.add-payment-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 2px dashed #3866df;
    border-radius: 8px;
    color: #3866df;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-payment-btn:hover {
    background: #f8f9ff;
    border-style: solid;
}

#add-card-form {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e8f2ff;
}

#add-card-form .form-group {
    margin-bottom: 15px;
}

#add-card-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

#add-card-form input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#add-card-form input:focus {
    outline: none;
    border-color: #3866df;
    box-shadow: 0 0 0 2px rgba(56, 102, 223, 0.1);
}

.expiry-cvv {
    display: flex;
    gap: 15px;
}

.expiry-cvv .form-group {
    flex: 1;
}

/* Agreement section */
.agreement {
    display: flex;
    align-items: flex-start;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e8f2ff;
    margin-left: 5px;
    margin-right: 5px;
}

.agreement input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    accent-color: #3866df;
}

.agreement label {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.agreement a {
    color: #3866df;
    text-decoration: underline;
}

/* Action buttons */
.popup-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding: 0 5px;
}

.popup-buttons button {
    flex: 1;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.btn-back {
    background-color: #f0f0f0;
    color: #333;
}

.btn-back:hover {
    background-color: #e0e0e0;
}

.btn-subscribe {
    background-color: #3866df;
    color: #fff;
}

.btn-subscribe:hover {
    background-color: #2c5aa0;
}

/* Error message */
#membership-error-message {
    color: #e74c3c;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    padding: 12px;
    background: #ffeaea;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* Success popup */
#success-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
}

#success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    width: 340px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#success-popup .popup-icon {
    margin-bottom: 20px;
}

#success-popup h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1a1a1a;
}

#success-popup p {
    color: #555;
    line-height: 1.6;
    font-size: 16px;
}

#success-popup .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

#success-popup .close-btn:hover {
    color: #333;
}

/* RTL Support */
#membership-popup.rtl {
    direction: rtl;
}

#membership-popup.rtl .membership-logo {
    flex-direction: row-reverse;
}

#membership-popup.rtl .benefit-icon {
    margin-left: 15px;
    margin-right: 0;
}


#membership-popup.rtl .agreement input[type="checkbox"] {
    margin-left: 12px;
    margin-right: 0;
}

#membership-popup.rtl .payment-item input[type="radio"] {
    margin-left: 12px;
    margin-right: 0;
}

#membership-popup.rtl .plan-option input[type="radio"] {
    right: auto;
    left: 15px;
}

/* RTL button layout - blue button on the right */
#membership-popup.rtl .popup-buttons {
    flex-direction: row-reverse;
}

/* RTL responsive adjustments */
@media (max-width: 768px) {
    #membership-popup.rtl .benefit-icon {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #membership-popup {
        width: 100%;
        padding: 20px 15px;
        height: 70vh;
        border-radius: 20px 20px 0 0;
    }
    
    .membership-benefits {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 2px;
    }
    
    .benefit-item {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .benefit-icon {
        margin-right: 0;
        margin-bottom: 8px;
        align-self: center;
    }
    
    .benefit-title {
        font-size: 12px;
    }
    
    .benefit-description {
        font-size: 10px;
    }
    
    .plans {
        flex-direction: column;
        gap: 15px;
        padding: 0 2px;
    }
    
    .plan-selection h3 {
        padding: 0 2px;
    }
    
    .payment-method h3 {
        padding: 0 2px;
    }
    
    .payment-options {
        padding: 0 2px;
    }
    
    .popup-buttons {
        padding: 0 2px;
    }
    
    .agreement {
        margin-left: 2px;
        margin-right: 2px;
    }
    
    .personalized-title {
        font-size: 18px;
    }
    
    .trial-details {
        font-size: 14px;
    }
}


#membership-error-message {
    display: none;
}

#add-card-form {
    display: none;
}

#success-popup .popup-icon img {
    width: 60px;
    height: 60px;
}

/* Membership deal container */
.membership-deal-container {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 16px;
}

/* More specific override for product info context */
.product-info .right > div > .membership-deal-container {
    padding-left: 24px !important;
    padding-right: 28px !important;
}

.membership-deal-container > div {
    flex: 1;
}

.membership-deal-container .title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    text-transform: none;
}

.membership-deal-container .title img {
    width: 50px;
    height: 30px;
    flex-shrink: 0;
    
}

.membership-deal-container .description {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.4 !important;;
    margin: 0;
    font-weight: bold;
}

.membership-deal-container .description a {
    color: #3866df;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: bold;
    display: inline-block;
}

.join-now-container {
    margin-top: 12px; /* Extra space from the top */
}

.membership-deal-container .description a:hover {
    color: #2c5aa0;
    text-decoration: underline;
}

/* Membership free delivery link */
#membership-free-delivery a {
    margin-left: 6px;
    color: #3866df;
    text-decoration: underline;
    transition: color 0.2s ease;
}

#membership-free-delivery a:hover {
    color: #2c5aa0;
}

#membership-free-delivery {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    color: #000;
}

#membership-free-delivery img {
    height: 2em;
    width: auto;
    vertical-align: middle;
    margin-right: 6px;
}

.plus-members-blue {
    color: #3866df;
    font-weight: 500;
}

.membership-free-delivery-container {
    display: inline-flex;
    align-items: center;
}

/* Mobile uses same styling as desktop for membership deal container */

/* Mobile-specific membership free delivery container */
.mobile-membership-free-delivery-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border: 1px solid #d1e7ff;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(56, 102, 223, 0.1);
}

.mobile-membership-free-delivery-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-membership-free-delivery-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.mobile-membership-free-delivery-icon {
    margin-right: 16px;
}

.mobile-membership-free-delivery-icon.rtl {
    margin-left: 16px;
    margin-right: 0;
}

.mobile-membership-free-delivery-icon img {
    height: 40px;
    width: auto;
}

.mobile-membership-free-delivery-icon img.rtl {
    transform: scaleX(-1);
}

.mobile-membership-free-delivery-text {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

.mobile-membership-free-delivery-subtext {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.mobile-membership-free-delivery-button {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(56, 102, 223, 0.3);
    transition: all 0.2s ease;
}

/* Additional mobile inline CSS cleanup */
.mobile-content-padding {
    padding-top: 0 !important;
}

.mobile-product-gallery {
    margin-bottom: 3px;
}

.mobile-embedded-video {
    position: relative;
}

.mobile-youtube-thumb {
    /* Background image will be set dynamically via PHP */
    background-size: cover;
    background-position: center;
}

.mobile-rating-span {
    /* Width will be set dynamically via PHP */
    display: inline-block;
}

.mobile-heading-title {
    margin-top: 3px !important;
}

.mobile-price-container {
    margin: 3px 0px !important;
}

.mobile-points-container {
    display: flex;
    align-items: center;
}

.mobile-membership-points-img {
    width: 25px;
    height: auto;
    margin: 0 5px;
    position: relative;
    top: -2px;
}

.mobile-regular-points-img {
    width: 20px;
    height: auto;
    margin: 0 5px;
}

.mobile-free-returns {
    margin-top: 3px !important;
}

.mobile-description {
    font-size: 11px;
}

.mobile-line-height-30 {
    line-height: 30px;
}

.mobile-subscription-container {
    margin-top: 3px;
}

.mobile-subs-free-delivery-hidden {
    display: none;
}

.mobile-success-popup-img {
    width: 50px;
    height: 50px;
}

/* Additional mobile styles for remaining inline CSS */
.mobile-read-description {
    font-weight: 300;
    font-size: 13px;
    padding-bottom: 3px;
    cursor: pointer;
    color: #0000EE;
}

.mobile-favorites-container {
    border: 1px solid #E4E4E4;
    border-radius: 10px;
    padding: 7px 7px;
}

.mobile-favorites-clickable {
    cursor: pointer;
}

.mobile-favorites-span {
    margin: 0 4px;
}

.mobile-giftlist-container {
    border: 1px solid #E4E4E4;
    border-radius: 10px;
    padding: 7px 7px;
}

/* Super text styling */
.super-text-container {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.super-badge {
    background-color: #3866df;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
    margin-right: 6px;
    text-align: center;
    min-width: 60px;
    box-shadow: 0 1px 3px rgba(56, 102, 223, 0.3);
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.super-rest-text {
    color: #3866df;
    font-weight: bold;
    font-size: 14px;
}

/* RTL support for super text */
.rtl .super-text-container {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .super-badge {
    margin-right: 0;
    margin-left: 6px;
}

/* RTL icon flip - using correct RTL detection */
body:not(.lang-en) .membership-deal-container .title .membership-icon,
body:not(.lang-en) .membership-deal-container .title img[src*="super.png"],
body:not(.lang-en) .membership-deal-container img.membership-icon {
    transform: scaleX(-1) !important;
}

/* Mobile RTL support for overlay */
@media (max-width: 768px) {
    #membership-popup.rtl .membership-logo {
        flex-direction: row-reverse;
    }
    
    #membership-popup.rtl .overlay-membership-icon {
        transform: scaleX(-1);
        order: 2; /* Make icon first visually (right side in RTL) */
    }
    
    #membership-popup.rtl .overlay-dumyah-super-badge {
        order: 1; /* Make text second visually (left side in RTL) */
    }
    
    /* Mobile add card form styling to match desktop */
    #add-card-form-mobile {
        margin-top: 20px;
        padding: 20px;
        background: #f8f9ff;
        border-radius: 8px;
        border: 1px solid #e8f2ff;
    }
    
    #add-card-form-mobile .form-group {
        margin-bottom: 15px;
    }
    
    #add-card-form-mobile label {
        display: block;
        margin-bottom: 6px;
        font-size: 14px;
        color: #555;
        font-weight: 500;
    }
    
    #add-card-form-mobile input {
        width: 100%;
        padding: 12px;
        border-radius: 6px;
        border: 1px solid #ddd;
        font-size: 16px;
        box-sizing: border-box;
        transition: border-color 0.3s ease;
    }
    
    #add-card-form-mobile input:focus {
        outline: none;
        border-color: #3866df;
        box-shadow: 0 0 0 2px rgba(56, 102, 223, 0.1);
    }
    
    #add-card-form-mobile .expiry-cvv {
        display: flex;
        gap: 15px;
    }
    
    #add-card-form-mobile .expiry-cvv .form-group {
        flex: 1;
    }
    
    /* Mobile field error styling */
    #add-card-form-mobile .field-error {
        color: #e74c3c;
        font-size: 12px;
        margin-top: 4px;
        display: none;
    }
    
    /* Mobile button sizing */
    .popup-buttons button {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
}