
        :root {
            --primary-color: #caaa3f;
            --secondary-color: #48133f;
        }

        [data-theme="dark"] {
            --bg-color: #1a1a1a;
            --text-color: #ffffff;
            --header-bg: #2d2d2d;
            --primary-color: #caaa3f;
            --border-color: #3d3d3d;
            --alert-bg: #2d2d2d;
            --alert-border: #3d3d3d;
            --alert-text: #caaa3f;
            --discount-price-color: #888888;
        }

        [data-theme="light"] {
            --bg-color: #ffffff;
            --text-color: #333333;
            --header-bg: #ffffff;
            --primary-color: #48133f;
            --border-color: #eaeaea;
            --alert-bg: #fff8e6;
            --alert-border: #caaa3f;
            --alert-text: #48133f;
            --discount-price-color: #6c757d;
        }

        * {
            font-family: 'Tajawal', sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: all 0.3s ease;
        }

        .categories-wrapper {
            padding: 30px 0;
            overflow-x: hidden;
        }

        .section-title {
            color: var(--primary-color);
            font-size: 2rem;
            font-weight: 700;
            text-align: center;
            margin-bottom: 40px;
        }

        .categories-grid {
            display: flex;
            justify-content: center;
            gap: 20px;
            padding: 10px 5px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

        .categories-grid::-webkit-scrollbar {
            display: none;
        }

        .category-card {
            flex: 0 0 200px;
            background: var(--header-bg);
            border-radius: 12px;
            padding: 20px 15px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            text-decoration: none;
            border: 1px solid var(--border-color);
        }

        .category-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            border-color: var(--primary-color);
        }

        .category-icon {
            font-size: 2rem;
            color: var(--primary-color);
            margin-bottom: 12px;
        }

        .category-name {
            color: var(--primary-color);
            font-size: 1.1rem;
            font-weight: 600;
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .category-type {
            display: inline-block;
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 0.9rem;
            color: white;
        }

        .category-type.retail {
            background: var(--primary-color);
        }

        .category-type.wholesale {
            background: var(--secondary-color);
        }

        .search-wrapper {
            margin-top: 20px;
            padding: 20px 0;
        }

        .search-container {
            max-width: 600px;
            margin: 0 auto;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 15px 60px;
            border-radius: 30px;
            border: 2px solid var(--border-color);
            background: var(--header-bg);
            color: var(--text-color);
            font-size: 1.1rem;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 5px rgba(202, 170, 63, 0.1);
        }

        .search-input::placeholder {
            color: #999;
        }

        .search-icon {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary-color);
            font-size: 1.3rem;
            pointer-events: none;
        }

        .clear-search {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
            font-size: 1.1rem;
            cursor: pointer;
            opacity: 0;
            transition: all 0.3s ease;
        }

        .clear-search:hover {
            color: var(--primary-color);
        }

        .clear-search.visible {
            opacity: 1;
        }

        .subcategories-wrapper {
            display: none;
            padding: 15px 0;
            margin-top: 10px;
            background: rgba(0, 0, 0, 0.02);
        }

        .subcategories-grid {
            display: flex;
            justify-content: center;
            gap: 10px;
            padding: 5px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

        .subcategories-grid::-webkit-scrollbar {
            display: none;
        }

        .subcategory-card {
            flex: 0 0 auto;
            padding: 8px 15px;
            color: var(--text-color);
            font-size: 0.95rem;
            text-decoration: none;
            border-radius: 20px;
            background: var(--header-bg);
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .subcategory-card:hover {
            color: var(--primary-color);
            border-color: var(--primary-color);
            transform: translateY(-2px);
        }

        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
            padding: 20px 0;
        }

        .product-card {
            position: relative;
            background: var(--header-bg);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
        }

        .product-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        }

        .product-image {
            width: 100%;
            height: 100%;
            aspect-ratio: 1;
            object-fit: cover;
            background: #f8f9fa;
            padding: 0;
        }

        .product-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.5);
            color: #fff;
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 0.8rem;
            backdrop-filter: blur(5px);
            z-index: 1;
        }

        .product-info {
            padding: 15px;
            flex-grow: 0;
        }

        .product-name {
            max-width: 200px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
            direction: ltr;
            text-align: center;
            unicode-bidi: plaintext;
            font-weight: 800;
            margin-bottom: 10px;
            color: var(--text-color);
        }

        .product-price {
            color: var(--primary-color);
            font-weight: 600;
            font-size: 13px;
            text-align: center;
        }

        .product-price .old-price {
            color: var(--discount-price-color);
            text-decoration: line-through;
            margin-inline-end: 0.5rem;
        }

        .alert-custom {
            background-color: var(--alert-bg);
            border-color: var(--alert-border);
            color: var(--alert-text);
        }

        .alert-custom i {
            color: var(--primary-color);
        }

        .cart-icon-wrapper {
            position: relative;
            padding: 10px;
            cursor: pointer;
            background: var(--bg-color);
            border-radius: 12px;
            border: 1.5px solid var(--border-color);
            transition: all 0.3s ease;
        }

        .cart-icon-wrapper:hover {
            border-color: var(--primary-color);
            transform: translateY(-2px);
        }

        .cart-icon {
            font-size: 22px;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .cart-count {
            position: absolute;
            top: -8px;
            right: -8px;
            background: var(--primary-color);
            color: #fff;
            border-radius: 50%;
            min-width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: bold;
            padding: 0 6px;
            border: 2px solid var(--bg-color);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* إضافة الستايلات الخاصة بصفحة المنتج */
        .product-gallery {
            display: grid;
            grid-template-columns: 65px 1fr;  /* تقليل عرض عمود الصور المصغرة */
            gap: 15px;  /* تقليل المسافة بين العمود والصورة الرئيسية */
            margin-bottom: 30px;
        }

        .thumbnail-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 315px;  /* تقليل الارتفاع الأقصى */
            overflow-y: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .thumbnail-list::-webkit-scrollbar {
            display: none;
        }

        .thumbnail {
            width: 65px;  /* تقليل عرض الصور المصغرة */
            height: 65px;  /* تقليل ارتفاع الصور المصغرة */
            border-radius: 8px;
            cursor: pointer;
            border: 2px solid var(--border-color);
            transition: all 0.3s ease;
            object-fit: cover;  /* تحسين عرض الصور */
        }

        .thumbnail.active, .thumbnail:hover {
            border-color: var(--primary-color);
        }

        .main-image {
            width: 100%;
            aspect-ratio: 1;
            object-fit: cover;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        .main-image-wrapper {
            position: relative;
        }

        .size-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background:rgb(0 0 0 / 38%);
            color: white;
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 500;
            z-index: 2;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .product-details {
            padding: 20px;
            background: var(--header-bg);
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-top: 20px;
        }

        .product-details h1 {
            text-align: initial;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 20px;
            direction: initial;  /* سيتم تحديد الاتجاه تلقائياً حسب المحتوى */
        }

        .perfume-size {
            display: inline-block;
            background: var(--primary-color);
            color: white;
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 500;
            margin-right: 10px;
            vertical-align: middle;
        }

        .quantity-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            margin: 25px auto;
            max-width: 200px;
            background: var(--bg-color);
            padding: 10px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        .quantity-input {
            width: 60px;
            text-align: center;
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--primary-color);
            border: none;
            background: transparent;
            padding: 5px;
            margin: 0;
            -moz-appearance: textfield;
        }

        .quantity-input::-webkit-outer-spin-button,
        .quantity-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .quantity-input:focus {
            outline: none;
        }

        .quantity-btn {
            width: 40px;
            height: 40px;
            border: 2px solid var(--primary-color);
            background: transparent;
            color: var(--primary-color);
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.4rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .quantity-btn:hover {
            background: var(--primary-color);
            color: white;
        }

        .add-to-cart {
            width: 100%;
            padding: 12px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .add-to-cart:hover {
            opacity: 0.9;
            transform: translateY(-2px);
        }

        .similar-products {
            margin-top: 40px;
            text-align: center;
        }

        .similar-products h3 {
            color: var(--primary-color);
            margin-bottom: 30px;
            position: relative;
            display: inline-block;
            padding-bottom: 10px;
        }

        .similar-products h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: var(--primary-color);
            border-radius: 2px;
        }

        /* إخفاء زر تغيير الثيم في صفحة المنتج */
        .theme-toggle {
            display: none;
        }

        .price-section {
            background: var(--bg-color);
            padding: 15px 20px;
            border-radius: 10px;
            border: 1px solid var(--border-color);
            margin-bottom: 25px;
            display: flex;
                flex-direction: column-reverse;
            justify-content: center;
            align-items: center;
        }

        .price-section .old-price {
            color: var(--discount-price-color);
            text-decoration: line-through;
            font-size: 1rem;
            margin-bottom: 5px;
        }

        .price-section .new-price {
            color: var(--primary-color);
            font-size: 1.8rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .price-section .discount-badge {
            background: #ff4646;
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .price-section .price {
            color: var(--primary-color);
            font-size: 1.8rem;
            font-weight: 700;
        }

        .price-section .currency {
            font-size: 1rem;
            color: var(--text-color);
            font-weight: normal;
        }

        .product-description {
            background: var(--bg-color);
            padding: 20px;
            border-radius: 10px;
            border: 1px solid var(--border-color);
            margin: 25px 0;
            line-height: 1.8;
            font-size: 1rem;
            color: var(--text-color);
            position: relative;
            max-height: 210px;
            overflow: auto;
        }

        

        .product-description:empty::before {
            display: none;
        }

        .product-description p {
            margin-bottom: 10px;
        }

        .product-description p:last-child {
            margin-bottom: 0;
        }

        /* تنسيق السكرول للصفحة بالكامل */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-color);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 10px;
            border: 2px solid var(--bg-color);
        }

        

        /* منع السكرول عند ظهور شاشة التحميل */
        body.no-scroll {
            overflow: hidden;
        }

        /* تنسيق السكرول في الموبايل */
        @media (max-width: 768px) {
            ::-webkit-scrollbar {
                width: 5px;
                height: 5px;
            }
        }

        @media (max-width: 430px) {
            .cart-icon {
                font-size: 20px;
            }

            .cart-count {
                min-width: 18px;
                height: 18px;
                font-size: 11px;
            }

            .categories-grid {
                justify-content: flex-start;
            }

            .products-grid {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            }

            .product-price {
                font-size: 12px;
            }

            .product-badge {
                font-size: 10px;
                padding: 3px 10px;
            }

            .search-input {
                padding: 8px 50px;
                font-size: 15px;
            }

            .search-icon {
                font-size: 15px;
            }
        }

        /* تعديل ستايل المنتجات المشابهة */
        .similar-products .products-grid {
            display: flex;
            overflow-x: auto;
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            scrollbar-color: var(--primary-color) var(--border-color);
        }

       

        .similar-products .products-grid::-webkit-scrollbar-track {
            background: var(--border-color);
            border-radius: 4px;
        }

        .similar-products .products-grid::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        .similar-products .product-card {
            flex: 0 0 200px;
            margin-bottom: 10px;
        }

        /* إضافة ستايلات للإشعار */
        .font-tajawal {
            font-family: 'Tajawal', sans-serif !important;
        }

        .swal2-rtl {
            font-family: 'Tajawal', sans-serif;
            direction: rtl;
        }

        .swal2-popup {
            border-radius: 15px;
        }

        /* إضافة ستايلات شاشة التحميل */
        .loader-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-color);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.5s ease-out;
        }
        
        .loader-wrapper.fade-out {
            opacity: 0;
            pointer-events: none;
        }
        
        .loader-text {
            color: var(--primary-color);
            font-size: 1.5rem;
            font-weight: 600;
            margin-bottom: 20px;
        }
        
        .loader-bar {
            width: 200px;
            height: 4px;
            background: rgba(202, 170, 63, 0.2);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }
        
        .loader-bar::after {
            content: '';
            position: absolute;
            width: 40%;
            height: 100%;
            background: var(--primary-color);
            border-radius: 4px;
            left: -40%;
            animation: loading 1.5s ease-in-out infinite;
        }
        
        @keyframes loading {
            0% { left: -40%; }
            50% { left: 100%; }
            100% { left: -40%; }
        }