:root {
            --primary-color: #2c3e50;
            --secondary-color: #9900ff;
            --light-color: #f5e6ff;
            --dark-color: #191919;
            --gray-color: #bf00ff;
            --success-color: #27ae60;
            --danger-color: #e74c3c;
            --warning-color: #f39c12;
            --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        * {
            margin: 0; padding: 0; box-sizing: border-box;
            font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        body {
            color: #333; line-height: 1.8;
            padding: 0; margin: 0;
            overflow-x: hidden;
            text-align: right;
            letter-spacing: 0;
        }

        img {
            -webkit-user-drag: none;
            -moz-user-drag: none;
            -ms-user-drag: none;
            user-drag: none;
            pointer-events: none;
        }

        .product-container {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            flex-wrap: wrap;
            background: white;
            padding: 0;
            min-height: 100vh;
            width: 100%;
            box-sizing: border-box;
        }

        .product-gallery {
            flex: 1;
            min-width: 0;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            border-radius: 12px;
            margin-bottom: 10px;
            padding: 0;
            overflow: hidden;
        }

        .product-details {
            flex: 1;
            min-width: 0;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            padding: 0 0 70px 0;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .main-slide {
            position: relative;
            margin-bottom: 16px;
            padding: 0;
            overflow: hidden;
            height: 50%;
            width: 100%;
            box-sizing: border-box;
        }

        .slide {
            position: absolute; top: 0; left: 0;
            width: 100%; height: 100%;
            opacity: 0;
            transition: opacity 0.5s ease;
            display: flex;
            align-items: center; justify-content: center;
        }

        .slide.active { opacity: 1; }

        .slide img {
            max-width: 100%; max-height: 100%;
            object-fit: contain; display: block;
        }

        .slide video {
            max-width: 100%; max-height: 100%;
            object-fit: contain; display: block;
            background: #000; outline: none;
        }

        .thumbnail-wrapper {
            position: relative;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            overflow: hidden;
            margin-top: 10px;
            padding: 0 6px;
        }

        .thumbnail-container {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 10px 4px;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            scroll-behavior: smooth;
            scrollbar-width: thin;
            -webkit-overflow-scrolling: touch;
            flex-wrap: nowrap;
            min-height: 90px;
        }

        .thumbnail-container::before,
        .thumbnail-container::after {
            content: '';
            flex: 0 0 0;
            margin: auto;
            pointer-events: none;
        }

        .thumbnail-container:empty::before,
        .thumbnail-container:empty::after {
            display: none;
        }

        .thumbnail-container::-webkit-scrollbar { height: 6px; }
        .thumbnail-container::-webkit-scrollbar-track {
            background: #f1f5f9; border-radius: 3px;
        }
        .thumbnail-container::-webkit-scrollbar-thumb {
            background: var(--secondary-color); border-radius: 3px;
        }
        .thumbnail-container::-webkit-scrollbar-thumb:hover {
            background: #aa33ff;
        }

        .thumbnail {
            width: 80px; height: 70px;
            cursor: pointer;
            border: 2px solid transparent;
            border-radius: 8px;
            overflow: hidden;
            transition: var(--transition);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            flex-shrink: 0;
            background: #f5f5f5;
        }

        .thumbnail.active {
            border-color: var(--secondary-color);
            transform: translateY(-3px);
            box-shadow: 0 5px 12px rgba(153, 0, 255, 0.2);
        }

        .thumbnail img {
            width: 100%; height: 100%; object-fit: cover;
        }

        .thumbnail video {
            width: 100%; height: 100%;
            object-fit: cover; pointer-events: none;
        }

        .thumbnail.is-video::after {
            content: '\f04b';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute; inset: 0;
            background: rgba(0, 0, 0, 0.4);
            color: white;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.2rem; pointer-events: none;
        }

        .thumb-nav {
            position: absolute; top: 50%;
            transform: translateY(-50%);
            width: 34px; height: 34px;
            border-radius: 50%;
            background: white;
            border: 1px solid #e5e7eb;
            color: var(--secondary-color);
            cursor: pointer;
            display: none;
            align-items: center; justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            z-index: 5;
            transition: var(--transition);
            font-size: 0.9rem;
        }
        .thumb-nav:hover {
            background: var(--secondary-color);
            color: white;
            transform: translateY(-50%) scale(1.1);
        }
        .thumb-nav:disabled {
            opacity: 0.35;
            cursor: not-allowed;
            transform: translateY(-50%);
        }
        .thumb-nav.prev { right: 0; }
        .thumb-nav.next { left: 0; }

        @media (min-width: 769px) {
            .thumb-nav { display: flex; }
            .thumbnail-container { padding: 10px 44px; }
        }

        .product-title {
            font-size: 2.2rem;
            margin-bottom: 16px;
            padding: 0 16px;
            color: var(--dark-color);
            font-weight: 700;
            line-height: 1.4;
        }

        .product-price {
            font-size: 2.4rem;
            font-weight: 800;
            padding: 8px 16px;
            color: var(--secondary-color);
            background: #f9f9f9;
            border-radius: 8px;
            margin-bottom: 24px;
            display: flex; align-items: center; gap: 5px;
        }

        .product-price span {
            font-size: 1.5rem;
            font-weight: 600;
            color: #666;
        }

        .variants-section {
            padding: 0 16px; margin-bottom: 20px;
        }

        .variants-label {
            font-size: 1rem; font-weight: 700;
            color: #555; margin-bottom: 10px;
            display: flex; align-items: center; gap: 8px;
        }

        .variants-label i {
            color: var(--secondary-color);
            font-size: 0.95rem;
        }

        .variants-label .chosen-value {
            color: var(--secondary-color);
            font-weight: 700;
            margin-right: auto;
            font-size: 0.9rem;
        }

        .color-picker-row {
            display: flex; flex-wrap: wrap; gap: 12px;
        }

        .color-dot {
            width: 48px; height: 48px;
            border-radius: 50%;
            border: 3px solid #e5e5e5;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            padding: 0;
            display: flex; align-items: center; justify-content: center;
            background-clip: padding-box;
            background-size: cover;
            background-position: center;
        }

        .color-dot:hover {
            transform: scale(1.1);
            border-color: #ccc;
        }

        .color-dot.selected {
            border-color: var(--secondary-color);
            box-shadow: 0 0 0 4px rgba(153, 0, 255, 0.15);
        }

        .color-dot.selected::after {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            color: white;
            font-size: 1.15rem;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
        }

        .size-picker-row {
            display: flex; flex-wrap: wrap; gap: 10px;
        }

        .size-chip {
            padding: 10px 22px;
            background: white;
            border: 2px solid #e5e5e5;
            border-radius: 10px;
            font-weight: 700;
            font-size: 0.95rem;
            color: #333;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
            min-width: 56px;
            text-align: center;
            position: relative;
        }

        .size-chip:hover:not(:disabled) {
            border-color: var(--secondary-color);
            color: black;
            transform: translateY(-2px);
        }

        .size-chip.selected {
            background: var(--secondary-color);
            border-color: var(--secondary-color);
            color: white;
            box-shadow: 0 4px 12px rgba(153, 0, 255, 0.3);
        }

        .size-chip:disabled,
        .size-chip.unavailable {
            background: #f5f5f5;
            border-color: #ddd;
            color: #bbb;
            cursor: not-allowed;
            opacity: 0.6;
            position: relative;
        }
        .size-chip.unavailable::after {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(to bottom right, transparent 45%, #ccc 47%, #ccc 53%, transparent 55%);
            border-radius: 8px;
            pointer-events: none;
        }

        .size-dimensions-info {
            display: none; margin-top: 10px;
            padding: 10px 14px;
            background: #f0f5ff;
            border: 1px solid #c7d2fe;
            border-radius: 10px;
            font-size: 0.9rem;
            color: #1e40af;
        }
        .size-dimensions-info.show { display: block; }
        .size-dimensions-info strong { color: var(--secondary-color); }

        .specs-section {
            padding: 0 16px; margin-bottom: 24px;
        }

        .specs-title {
            font-size: 1.1rem; font-weight: 700;
            color: #333; margin-bottom: 12px;
            display: flex; align-items: center; gap: 8px;
        }
        .specs-title i { color: var(--secondary-color); }

        .specs-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            background: white;
            border: 1px solid #e5e5e5;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        }
        .specs-table tr { transition: var(--transition); }
        .specs-table tr:nth-child(even) { background: #fafbfc; }
        .specs-table tr:hover { background: #f0f5ff; }
        .specs-table td {
            padding: 12px 16px;
            border-bottom: 1px solid #f0f0f0;
            font-size: 0.95rem;
            vertical-align: top;
        }
        .specs-table tr:last-child td { border-bottom: none; }
        .specs-table td:first-child {
            width: 40%; font-weight: 700;
            color: #555;
            border-left: 1px solid #f0f0f0;
        }
        .specs-table td:last-child {
            color: #222; font-weight: 500;
        }

        .product-description {
            margin-bottom: 32px;
            padding: 0 16px 0 32px;
            color: #555;
            line-height: 1.9;
            font-size: 1.05rem;
            flex: 1;
            text-align: justify;
        }
        .product-description p { margin-bottom: 15px; }
        .product-description ul { padding-right: 20px; margin-bottom: 15px; }
        .product-description li { margin-bottom: 10px; position: relative; }

        .product-actions {
            margin-top: 30px;
            padding: 16px;
            background: #f9f9f9;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
        }

        .quantity-label {
            display: block; margin-bottom: 10px;
            font-weight: 600; color: #555;
        }

        .quantity-selector {
            display: flex; align-items: center;
            margin-bottom: 25px;
            max-width: 200px;
            background: white;
            border-radius: 12px;
            padding: 5px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
            border: 2px solid #e8e8e8;
            transition: var(--transition);
        }

        .quantity-selector:focus-within {
            border-color: var(--secondary-color);
            box-shadow: 0 5px 15px rgba(153, 0, 255, 0.15);
        }

        .quantity-btn {
            width: 46px; height: 46px;
            border-radius: 10px;
            background: white;
            border: 2px solid;
            font-size: 1.3rem;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: var(--transition);
            font-weight: bold;
        }

        .quantity-btn.minus { border-color: var(--danger-color); color: var(--danger-color); }
        .quantity-btn.minus:hover { background: var(--danger-color); color: white; transform: scale(1.05); }
        .quantity-btn.plus { border-color: var(--success-color); color: var(--success-color); }
        .quantity-btn.plus:hover { background: var(--success-color); color: white; transform: scale(1.05); }
        .quantity-btn:active { transform: scale(0.95); }

        .quantity-input {
            width: 80px; height: 46px;
            text-align: center;
            border: none; margin: 0 5px;
            font-size: 1.2rem; font-weight: 700;
            border-radius: 8px;
            -moz-appearance: textfield;
            transition: var(--transition);
            background: transparent;
            color: var(--dark-color);
            direction: ltr;
        }

        .quantity-input:focus { outline: none; background: var(--light-color); }
        .quantity-input::-webkit-outer-spin-button,
        .quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

        .action-buttons { display: flex; gap: 15px; }

        .add-to-cart {
            flex: 1;
            padding: 15px 20px;
            background: var(--secondary-color);
            color: white; border: none;
            border-radius: 10px;
            font-size: 1.1rem; font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex; align-items: center; justify-content: center;
            gap: 10px;
            box-shadow: 0 4px 10px rgba(153, 0, 255, 0.3);
            font-family: inherit;
        }

        .add-to-cart:hover {
            background: #aa33ff;
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(153, 0, 255, 0.4);
        }
        .add-to-cart:active { transform: translateY(0); }

        .wishlist-btn {
            width: 60px;
            border-radius: 10px;
            background: white;
            border: 2px solid #e0e0e0;
            color: #888;
            font-size: 1.3rem;
            cursor: pointer;
            transition: var(--transition);
            display: flex; align-items: center; justify-content: center;
        }

        .wishlist-btn:hover, .wishlist-btn.active {
            color: var(--secondary-color);
            border-color: var(--secondary-color);
            background: var(--light-color);
            transform: scale(1.05);
        }

        .desktop-sticky-actions {
            display: none;
            position: sticky; bottom: 0; right: 0; left: 0;
            background: white; padding: 16px;
            margin-left: -32px; z-index: 10;
        }
        .desktop-sticky-actions .action-buttons { width: calc(100% + 32px); }

        .mobile-bottom-bar {
            display: none;
            position: fixed; bottom: 0; left: 0; right: 0;
            background: white; padding: 15px;
            box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            border-top-left-radius: 16px;
            border-top-right-radius: 16px;
        }

        .mobile-bottom-actions {
            display: flex; gap: 12px;
            max-width: 1200px; margin: 0 auto;
        }

        .mobile-bottom-actions .add-to-cart {
            flex: 1; padding: 16px;
            background: var(--secondary-color);
            color: white; border: none;
            border-radius: 12px;
            font-size: 1.1rem; font-weight: 600;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            gap: 10px;
            box-shadow: 0 4px 10px rgba(153, 0, 255, 0.3);
            transition: var(--transition);
            font-family: inherit;
        }

        .mobile-bottom-actions .wishlist-btn {
            width: 70px;
            border-radius: 12px;
            background: white;
            border: 2px solid #e0e0e0;
            color: #888;
            font-size: 1.3rem;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            flex-direction: column; gap: 4px;
            transition: var(--transition);
        }
        .mobile-bottom-actions .wishlist-btn span { font-size: 0.75rem; font-weight: 600; }

        @media (max-width: 768px) {
            .product-container {
                flex-direction: column;
                gap: 0; padding: 0; margin: 0;
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

            .product-gallery,
            .product-details {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

            .thumbnail-wrapper {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
                overflow: hidden;
            }

            .thumbnail-container {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
                overflow-x: auto;
            }

            .main-slide { 
                height: 350px; 
                width: 100%;
                max-width: 100%;
            }
            .product-title { font-size: 1.8rem; }
            .product-price { font-size: 2rem; }
            .quantity-selector { max-width: 180px; }

            .product-actions .action-buttons { display: none; }

            body { 
                padding-bottom: 90px;
                overflow-x: hidden;
            }
            .mobile-bottom-bar { display: block; }
        }

        @media (min-width: 769px) {
            .product-container {
                flex-direction: row;
                gap: 16px; align-items: stretch;
                min-height: 100vh;
            }

            .product-gallery {
                flex: 1; min-width: 0;
                min-height: 100vh;
                display: flex; flex-direction: column;
                justify-content: center;
                padding: 0;
                position: sticky; top: 0;
            }

            .product-details {
                flex: 1; min-width: 0;
                min-height: 100vh;
                overflow-y: auto;
                padding: 32px 0 0 32px;
                max-height: 100vh;
            }

            .main-slide { height: 60vh; max-height: 550px; }

            .desktop-sticky-actions { display: flex; }

            .product-actions .action-buttons { display: none; }
        }

        @media (min-width: 1200px) {
            .product-gallery { padding: 0; }
            .main-slide { height: 65vh; max-height: 650px; }
        }

        .slider-indicators {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .slider-indicator {
            width: 10px; height: 10px;
            border-radius: 50%;
            background: #ddd;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            padding: 0;
        }

        .slider-indicator.active {
            background: var(--secondary-color);
            transform: scale(1.2);
        }

        .modal {
            display: none;
            position: fixed; z-index: 10000;
            left: 0; top: 0;
            width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background-color: #fff;
            margin: auto;
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            padding: 40px 30px 30px;
            border-radius: 20px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
            width: 90%; max-width: 420px;
            text-align: center;
            animation: modalFadeIn 0.4s ease;
        }

        @keyframes modalFadeIn {
            from { opacity: 0; transform: translate(-50%, -60%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }

        .close-btn {
            position: absolute;
            top: -15px; right: -15px;
            width: 40px; height: 40px;
            border-radius: 50%;
            background: white;
            border: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: var(--transition);
            z-index: 10;
        }

        .close-btn:hover { background: #f5f5f5; transform: rotate(90deg); }
        .close-btn svg { width: 18px; height: 18px; fill: #666; }

        .modal-content h2 {
            color: var(--dark-color);
            margin-bottom: 20px;
            font-size: 1.6rem; font-weight: 700;
            line-height: 1.4;
        }

        .modal-content p {
            color: #666;
            margin-bottom: 32px;
            line-height: 1.8;
            font-size: 1.05rem;
            text-align: justify;
        }

        .modal-buttons {
            display: flex; flex-direction: column; gap: 10px;
        }

        .modal-buttons .btn {
            padding: 16px 20px;
            border-radius: 12px;
            font-size: 1.1rem; font-weight: 600;
            text-decoration: none;
            transition: var(--transition);
            display: block; text-align: center;
        }

        .modal-buttons .login-btn {
            background: var(--secondary-color);
            color: white;
            box-shadow: 0 4px 12px rgba(153, 0, 255, 0.25);
        }
        .modal-buttons .login-btn:hover { background: #aa33ff; transform: translateY(-2px); }

        .modal-buttons .register-btn {
            background: white;
            color: var(--secondary-color);
            border: 2px solid var(--secondary-color);
        }
        .modal-buttons .register-btn:hover { background: var(--light-color); transform: translateY(-2px); }

        @media (max-width: 480px) {
            .modal-content { padding: 35px 25px 25px; max-width: 90%; }
            .modal-content h2 { font-size: 1.4rem; }
            .modal-content p { font-size: 1rem; }
            .modal-buttons .btn { padding: 14px 18px; font-size: 1rem; }
        }

        .empty {
            text-align: center; padding: 40px 20px;
            background: white; border-radius: 16px;
            box-shadow: var(--box-shadow);
            margin: 20px auto; max-width: 600px;
        }
        .empty p { font-size: 1.2rem; color: #666; }

        .sk-shimmer {
            background: linear-gradient(90deg, #eef2f6 25%, #e2e8f0 50%, #eef2f6 75%);
            background-size: 200% 100%;
            animation: sk-shimmer-anim 1.4s infinite ease-in-out;
        }
        @keyframes sk-shimmer-anim {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        #qvSkeleton .sk-gallery { aspect-ratio: 1/1; max-height: 600px; border-radius: 12px; }
        #qvSkeleton .sk-thumb-row {
            display: flex; gap: 10px; margin-top: 15px;
        }
        #qvSkeleton .sk-thumb { width: 80px; height: 70px; border-radius: 8px; flex-shrink: 0; }
        #qvSkeleton .sk-title { height: 32px; width: 70%; border-radius: 8px; margin: 0 0 20px 0; }
        #qvSkeleton .sk-price { height: 50px; width: 40%; border-radius: 10px; margin-bottom: 25px; }
        #qvSkeleton .sk-text { height: 16px; border-radius: 6px; margin-bottom: 10px; }
        #qvSkeleton .sk-text.w-95 { width: 95%; }
        #qvSkeleton .sk-text.w-85 { width: 85%; }
        #qvSkeleton .sk-text.w-75 { width: 75%; }
        #qvSkeleton .sk-actions { height: 56px; border-radius: 10px; margin-top: 24px; }

        .qv-real { display: none; }
        .qv-real.ready { display: block; animation: skFadeIn 0.4s ease; }
        @keyframes skFadeIn {
            from { opacity: 0; }
            to   { opacity: 1; }
        }
