/* --- Section Titles Color Override --- */
/* Override all Salla platform section titles to brand color #75141c */
.s-slider-block__title-right h2,
.s-block__title h2,
.s-block__title .right-side h2 {
    color: #75141c !important;
}

/* Performance: Skip rendering off-screen content */
.custom-features-section,
.custom-reviews-section,
.custom-social-section {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
    /* Approximate height to prevent scrollbar jumping */
}

/* Utility Class */
.hidden {
    display: none !important;
}

/* ما يميزنا Section Styles */
.custom-features-section {
    padding: 60px 0;
    background-color: #fcfcfc;
    direction: rtl;
}

.custom-features-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.custom-features-header {
    text-align: center;
    margin-bottom: 50px;
}

.custom-features-header h2 {
    font-size: 2.5rem;
    color: #75141c;
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.custom-features-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #75141c;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: #75141c;
    padding: 20px;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: right;
    will-change: transform;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.feature-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.feature-icon-wrapper {
    width: 45px;
    height: 45px;
    background-color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper {
    background-color: rgba(255, 255, 255, 0.9);
}

.feature-icon-wrapper i {
    font-size: 22px;
    color: #75141c;
    transition: color 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper i {
    color: #75141c;
}

.feature-card h3 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.feature-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
    text-align: justify;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .custom-features-header h2 {
        font-size: 1.8rem;
    }

    .feature-card {
        padding: 15px;
    }
}

/* Social Media Section Styles */
.custom-social-section {
    padding: 40px 0 60px 0;
    background-color: #fcfcfc;
    direction: rtl;
}

.social-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.social-link-card {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    will-change: transform;
}

.social-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(117, 20, 28, 0.08);
    border-color: rgba(117, 20, 28, 0.1);
}

.social-link-card .social-icon-wrapper {
    width: 40px;
    height: 40px;
    background-color: rgba(117, 20, 28, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.social-link-card:hover .social-icon-wrapper {
    background-color: #75141c;
}

.social-link-card .social-icon-wrapper i {
    font-size: 20px;
    color: #75141c;
    transition: color 0.3s ease;
}

.social-link-card:hover .social-icon-wrapper i {
    color: #fff;
}

.social-link-card span {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

/* Mobile Responsive For Social Grid */
@media (max-width: 992px) {
    .social-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .social-links-grid {
        gap: 10px;
    }

    .social-link-card {
        padding: 12px;
    }
}

/* --- Product Filter Sidebar --- */
.filters-sidebar {
    width: 280px;
    padding: 24px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-left: 25px;
    position: sticky;
    top: 100px;
    height: fit-content;
    direction: rtl;
    z-index: 40;
    transition: transform 0.3s ease;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #f2f2f2;
    padding-bottom: 20px;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-title i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #4a4a4a;
    transition: color 0.2s ease;
}

.filter-item:hover {
    color: var(--color-primary);
}

.filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
    border: 1.5px solid #d1d1d1;
    border-radius: 4px;
}

.price-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-row label {
    font-size: 0.85rem;
    color: #777;
    min-width: 30px;
}

.price-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.price-row input:focus {
    border-color: var(--color-primary);
}

.apply-filter-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.apply-filter-btn:hover {
    background-color: var(--color-primary-dark);
}

/* Mobile Filter Toggle */
.filter-mobile-toggle {
    display: none;
    width: 100%;
    padding: 14px;
    background: #fff;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: 12px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.filter-mobile-toggle:active {
    background: var(--color-primary);
    color: #fff;
}

@media (max-width: 768px) {
    .filters-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        /* Optimized Animation */
        width: 300px;
        max-width: 85%;
        height: 100%;
        margin-left: 0;
        border-radius: 0;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        will-change: transform;
    }

    .filters-sidebar.active {
        transform: translateX(0);
        /* Active state */
    }

    .filter-mobile-toggle {
        display: flex;
    }

    .filters-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 35;
        backdrop-filter: blur(2px);
    }

    .filters-overlay.active {
        display: block;
    }

    .close-filters {
        display: flex !important;
        position: absolute;
        top: 20px;
        left: 20px;
        width: 35px;
        height: 35px;
        background: #f5f5f5;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #333;
        cursor: pointer;
    }
}

.close-filters {
    display: none;
}

/* --- Discount Popup --- */
.discount-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    direction: rtl;
}

.discount-popup-overlay.active {
    display: flex;
    animation: fadeInPopup 0.3s ease;
}

.discount-popup-content {
    background: #fff;
    width: 100%;
    max-width: 450px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.discount-popup-overlay.active .discount-popup-content {
    transform: translateY(0);
}

.discount-popup-header {
    background: linear-gradient(135deg, #75141c, #a21c27);
    padding: 40px 20px;
    text-align: center;
    color: #fff;
    position: relative;
}

.discount-popup-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
    color: #fff !important;
}

.discount-popup-header p {
    font-size: 16px;
    opacity: 0.9;
    color: #fff;
}

.discount-popup-body {
    padding: 30px;
    text-align: center;
}

.coupon-container {
    background: #f8f8f8;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coupon-code {
    font-family: 'Cairo', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #75141c;
    letter-spacing: 2px;
}

.copy-btn {
    background: #75141c;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.copy-btn:hover {
    background: #5a0f15;
}

.copy-btn.copied {
    background: #27ae60;
}

.close-popup-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.close-popup-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes fadeInPopup {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .discount-popup-content {
        margin: 10px;
    }

    .discount-popup-header {
        padding: 30px 15px;
    }
}

/* --- Top Announcement Bar Optimized --- */
.custom-announcement-bar {
    background-color: #75141c;
    color: #fff;
    padding: 10px 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Avoid CLS by pre-optimizing body if JS adds this class */
body.announcement-active {
    padding-top: 40px !important;
}

.announcement-ticker {
    display: flex;
    white-space: nowrap;
    animation: announcement-marquee 20s linear infinite;
    width: max-content;
    will-change: transform;
}

.announcement-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-right: 100vw;
}

[dir="rtl"] .announcement-item {
    padding-right: 0;
    padding-left: 100vw;
}

@keyframes announcement-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* RTL Adjustment */
[dir="rtl"] .announcement-ticker {
    animation: announcement-marquee-rtl 15s linear infinite;
}

@keyframes announcement-marquee-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

/* --- Fix Store Sections Mobile Visibility --- */
@media (max-width: 768px) {
    .banner-entry.has-overlay::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1;
        pointer-events: none;
        border-radius: inherit;
    }

    .banner-entry.has-overlay h3,
    .banner-entry.has-overlay .text-with-border {
        z-index: 2 !important;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
    }

    .banner-entry.has-overlay h3 span {
        color: #fff !important;
        font-weight: 700 !important;
    }
}

/* Packages Section Title Styles */
.custom-packages-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.custom-packages-header h2 {
    font-size: 2.5rem;
    color: #75141c;
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.custom-packages-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #75141c;
    border-radius: 2px;
}

@media (max-width: 640px) {
    .custom-packages-header h2 {
        font-size: 1.8rem;
    }
}

/* Gift Notice Styles */
.custom-gift-notice {
    width: 100%;
    margin-top: 20px;
    padding: 0 15px;
    text-align: center;
}

.custom-gift-notice {
    display: none;
}

#best-offers-3-slider .custom-gift-notice {
    display: block;
}

.gift-notice-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(117, 20, 28, 0.05);
    color: #75141c;
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px dashed #75141c;
    font-size: 1rem;
    font-weight: 600;
}

.gift-notice-content i {
    font-size: 1.2rem;
}

@media (max-width: 640px) {
    .gift-notice-content {
        font-size: 0.85rem;
        padding: 10px 15px;
        width: 100%;
        justify-content: center;
    }
}

/* --- Product Card Optimization --- */
.s-product-card-entry {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    will-change: transform;
}

.s-product-card-image {
    background-color: #ffffff !important;
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.s-product-card-image a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.s-product-card-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.5s ease !important;
    will-change: transform;
}

.s-product-card-content {
    padding: 12px !important;
    background: #fff !important;
}

.s-product-card-entry:hover .s-product-card-image img {
    transform: scale(1.03);
}

@media (max-width: 640px) {
    .s-product-card-image {
        height: auto !important;
    }
}

/* Custom Reviews Section Styles */
.custom-reviews-section {
    padding: 60px 0;
    background-color: #ffffff;
    direction: rtl;
}

.custom-reviews-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.review-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #f0f0f0;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    will-change: transform;
}

.review-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(117, 20, 28, 0.1);
    border-color: rgba(117, 20, 28, 0.15);
}

.review-quote {
    margin-bottom: 20px;
    color: rgba(117, 20, 28, 0.1);
}

.review-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    font-style: italic;
    margin-bottom: 25px;
    text-align: justify;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #f5f5f5;
    padding-top: 20px;
    margin-top: auto;
}

.review-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.review-rating {
    display: flex;
    gap: 3px;
}

.review-rating i {
    font-size: 14px;
    color: #ddd;
}

.review-rating i.active {
    color: #f1c40f;
}

.review-date {
    font-size: 0.8rem;
    color: #999;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .custom-reviews-section {
        padding: 40px 0;
    }
}

@media (max-width: 640px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .review-card {
        padding: 25px;
    }

    .review-content p {
        font-size: 0.95rem;
    }
}