:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #1e1b4b;
    --text-muted: #64748b;
    --bg-light: #faf9fc;
    --bg-card: #ffffff;
    --border-color: #ede8f5;
    --font-heading: 'Cairo', sans-serif;
    --font-sans: 'Cairo', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide number input spinner arrows across all browsers */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-old {
    font-size: 14px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.add-to-cart-btn {
    background-color: var(--primary-color, #8b5cf6) !important;
    color: #ffffff !important;
    border: 1px solid var(--primary-color, #8b5cf6) !important;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-hover, #7c3aed) !important;
    border-color: var(--primary-hover, #7c3aed) !important;
    color: #ffffff !important;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-block;
    height: 85px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 600;
    position: relative;
    padding: 8px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-trigger {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    list-style: none;
    padding: 8px 0;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding-right: 25px;
}

.dropdown-menu li a::after {
    display: none;
}

/* Top Left Actions */
.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.lang-toggle-btn:hover {
    background-color: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.contact-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

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

.cart-icon-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    position: relative;
    color: var(--text-main);
    transition: var(--transition);
}

.cart-icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -5px;
    left: -8px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    padding: 100px 24px;
    background: linear-gradient(135deg, #fdfcff 0%, #f4f0fa 50%, #eae3f7 100%);
    position: relative;
    overflow: hidden;
}

.dark .hero {
    background: linear-gradient(135deg, #070c17 0%, #0b1220 50%, #0f182a 100%) !important;
    border-bottom: 1px solid #1c273e !important;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.hero-content {
    flex: 1.2;
    max-width: 600px;
}

.hero-subtitle {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    color: #5B6BF9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 6px;
}

.hero-subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #5B6BF9;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.3;
    color: #111827;
    margin-bottom: 24px;
    font-weight: 800;
}

.hero-desc {
    font-size: 18px;
    color: #4B5563;
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #5B6BF9;
    color: #fff;
    padding: 14px 44px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(91, 107, 249, 0.3);
}

.hero-btn:hover {
    background-color: #4756df;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(91, 107, 249, 0.4);
}

.hero-title, .hero-desc, .hero-subtitle, .hero-btn {
    font-family: 'Cairo', sans-serif !important;
}

html[dir="rtl"] .hero-content {
    text-align: right;
}

html[dir="rtl"] .hero-subtitle::after {
    left: auto;
    right: 0;
}

.hero-image-container {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
    background: linear-gradient(135deg, #5B6BF9, #ffd075, #5B6BF9, #ff8da1);
    background-size: 300% 300%;
    animation: morph 8s ease-in-out infinite, border-flow 6s ease infinite;
    padding: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    border: 6px solid #fff;
    transition: transform 0.4s ease;
}

.hero-img-wrapper:hover img {
    transform: scale(1.05);
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
    }
    50% {
        border-radius: 50% 50% 40% 60% / 40% 60% 40% 60%;
    }
    100% {
        border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
    }
}

@keyframes border-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Category Filter Section */
.category-section {
    padding: 60px 24px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-size: 32px;
    color: var(--text-main);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
    margin-bottom: 30px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--primary-color);
}

/* Products Display Grid */
.products-section {
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 24px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 30px;
}

/* Product Card Styling */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.product-card-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #fcfcfc;
}

.product-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-card-img-wrapper img {
    transform: scale(1.06);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    letter-spacing: 1px;
}

.product-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    font-family: var(--font-sans);
}

.product-price-row {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-old {
    font-size: 14px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.add-to-cart-btn {
    background-color: var(--text-main);
    color: #fff;
    border: 1px solid var(--text-main);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Slide-out Shopping Cart Drawer */
.cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 250;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.cart-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 260;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    pointer-events: none;
}

.cart-drawer.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

html[dir="rtl"] .cart-drawer {
    right: auto;
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
}

html[dir="rtl"] .cart-drawer.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h3 {
    font-size: 20px;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.close-cart-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Cart Item Card */
.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
}

.cart-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

.qty-val {
    width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.remove-item-btn {
    background: none;
    border: none;
    color: red;
    font-size: 12px;
    cursor: pointer;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    background-color: var(--text-main);
    color: #fff;
    border: 1px solid var(--text-main);
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Footer Section */
footer {
    background-color: #ffffff;
    color: #4b5563;
    padding: 80px 24px 40px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif !important;
    border-top: 1px solid #ede8f5;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 25% 65%, rgba(139, 92, 246, 0.08), transparent 50%),
                radial-gradient(circle at 75% 35%, rgba(99, 102, 241, 0.08), transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.05), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(ellipse at 80% 90%, rgba(99, 102, 241, 0.06), transparent 60%),
                radial-gradient(ellipse at 20% 10%, rgba(147, 51, 234, 0.04), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.footer-container, .footer-bottom {
    position: relative;
    z-index: 2;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-about {
    flex: 1 1 350px;
    max-width: 420px;
}

.footer-links {
    flex: 1 1 180px;
    max-width: 220px;
}

.footer-about h3, .footer-links h3 {
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    font-family: 'Cairo', sans-serif !important;
}

.footer-about p {
    line-height: 1.8;
    font-size: 15px;
    color: #4B5563;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 14px;
    font-size: 15px;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    padding-right: 8px;
}

.footer-social-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #1e2330;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.social-icon-svg {
    font-size: 20px !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.08);
    background-color: #2c3345;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    font-size: 12px;
    color: #4B5563;
}

/* Responsive Layout & Mobile Optimization */
@media (max-width: 1023px) {
    .nav-links {
        display: none;
    }
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
    .hero-content {
        max-width: 100%;
    }
    html[dir="rtl"] .hero-content {
        text-align: center;
    }
    .wa-floating-btn-container {
        bottom: 76px !important;
        width: 46px !important;
        height: 46px !important;
    }
    .wa-floating-btn-circle {
        width: 46px !important;
        height: 46px !important;
    }
    .wa-floating-btn-circle svg {
        width: 24px !important;
        height: 24px !important;
    }
}

@media (max-width: 639px) {
    /* Header on Mobile */
    .nav-container {
        padding: 8px 12px;
    }
    .logo {
        height: 48px;
    }
    .nav-left {
        gap: 8px;
    }
    .lang-toggle-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    .cart-icon-btn {
        font-size: 19px;
    }
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: -4px;
        left: -6px;
    }

    /* Hero Section on Mobile */
    .hero {
        padding: 24px 16px 36px !important;
    }
    .hero-container {
        gap: 20px;
    }
    .hero-subtitle {
        font-size: 13px;
        margin-bottom: 12px;
        padding-bottom: 4px;
    }
    .hero-title {
        font-size: clamp(22px, 6.5vw, 32px) !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    .hero-desc {
        font-size: 13px !important;
        line-height: 1.65 !important;
        margin-bottom: 20px !important;
    }
    .hero-btn {
        padding: 10px 28px !important;
        font-size: 14px !important;
    }
    .hero-img-wrapper {
        width: 220px !important;
        height: 220px !important;
        max-width: 75vw !important;
        max-height: 75vw !important;
        margin: 0 auto;
    }

    /* Category Filter Section on Mobile */
    .category-section {
        padding: 28px 12px 10px !important;
    }
    .section-title {
        font-size: 22px !important;
        margin-bottom: 20px !important;
        padding-bottom: 8px !important;
    }
    .category-filter-bar {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        padding: 4px 4px 14px !important;
        margin-bottom: 20px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .category-filter-bar::-webkit-scrollbar {
        display: none !important;
    }
    .filter-btn {
        padding: 7px 16px !important;
        font-size: 12px !important;
        border-radius: 9999px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* Products Grid - 2 columns on Mobile */
    .products-section {
        padding: 0 10px !important;
        margin-bottom: 50px !important;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .product-card {
        border-radius: 12px !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    }
    .product-card-body {
        padding: 10px 8px !important;
    }
    .product-title {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin-bottom: 6px !important;
        height: 2.7em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .product-price-row {
        margin-bottom: 8px !important;
        gap: 6px !important;
    }
    .product-price {
        font-size: 14px !important;
        font-weight: 800 !important;
    }
    .product-price-old {
        font-size: 11px !important;
    }
    .add-to-cart-btn {
        padding: 8px 6px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        gap: 4px !important;
        width: 100% !important;
    }
    .product-badge-discount, .product-badge {
        top: 8px !important;
        right: 8px !important;
        font-size: 9px !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
    }

    /* Cart Drawer on Mobile */
    .cart-drawer {
        width: 100% !important;
        max-width: 100vw !important;
    }
    .cart-header {
        padding: 16px !important;
    }
    .cart-items-container {
        padding: 16px !important;
    }
    .cart-footer {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    }

    /* Footer on Mobile */
    footer {
        padding: 40px 16px 100px !important;
    }
    .footer-container {
        gap: 28px !important;
        margin-bottom: 30px !important;
    }
    .footer-about h3, .footer-links h3 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    .footer-about p {
        font-size: 13px !important;
        line-height: 1.7 !important;
    }
    .footer-links ul li {
        margin-bottom: 10px !important;
        font-size: 13px !important;
    }
    .footer-social-links {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
    }
    .social-btn {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        min-width: 0 !important;
        padding: 0 !important;
    }
    .social-icon-svg {
        font-size: 18px !important;
    }
}
