/* Improved UX/UI Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Karla', sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Enhanced Header */
.integrated-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border-radius: 0 0 20px 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.header-logo:hover .header-logo-icon {
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.header-logo-text h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #333;
    margin: 0;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    direction: rtl;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-search input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.header-search .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.header-cart {
    position: relative;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 18px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.header-cart:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.cart-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

/* Enhanced Layout */
.main-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    direction: rtl;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
}

/* Enhanced Sidebar */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 2.5rem 2rem;
    position: sticky;
    top: 120px;
    height: fit-content;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sidebar:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.category-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    border-radius: 18px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: right;
    width: 100%;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: right 0.6s;
}

.category-btn:hover::before {
    right: 100%;
}

.category-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateX(-8px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateX(-5px);
}

.category-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Enhanced Products Container */
.products-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    flex: 1;
}

.products-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

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

/* Enhanced Product Cards */
.product-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1) rotate(2deg);
}

.wishlist-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    z-index: 2;
}

.product-card:hover .wishlist-btn {
    opacity: 1;
    transform: scale(1);
}

.wishlist-btn:hover {
    background: #ff4757;
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
    z-index: 2;
    position: relative;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #28a8b8;
    margin-bottom: 1rem;
}

.product-actions {
    padding: 0 1.5rem 1.5rem;
    z-index: 2;
    position: relative;
}

.add-to-cart-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.add-to-cart-btn:hover::before {
    left: 100%;
}

.add-to-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Product View Enhancements */
.product-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 0;
}

.main-product-image {
    width: 100%;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-product-image:hover img {
    transform: scale(1.05);
}

.product-details-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-view .product-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #333;
    line-height: 1.2;
    margin: 0;
}

.product-description p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.highlights {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.highlight {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.product-view .product-price {
    font-size: 2.5rem;
    font-weight: 900;
    color: #28a8b8;
    margin: 1.5rem 0;
    text-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.color-selection h3,
.quantity-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.color-options {
    display: flex;
    gap: 1rem;
}

.color-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-btn:hover,
.color-btn.active {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.color-btn.active::after {
    opacity: 1;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

#quantity {
    width: 100px;
    height: 50px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
}

.add-to-cart-main {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, #28a8b8, #20c997);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.add-to-cart-main:hover {
    background: linear-gradient(135deg, #28a8b8, #1ea080);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.payment-method i {
    color: #28a8b8;
    font-size: 1.2rem;
}

.copy-link-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.copy-link-btn:hover {
    background: linear-gradient(135deg, #138496, #1ea080);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.3);
}

.policy-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.policy-btn {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.policy-btn:hover {
    border-color: rgba(102, 126, 234, 0.5);
    color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(-5px);
}

.policy-btn i {
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem auto;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        padding: 1.5rem;
    }
    
    .category-buttons {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .category-btn {
        min-width: fit-content;
        padding: 1rem 1.25rem;
        flex-shrink: 0;
    }
    
    .products-container {
        padding: 2rem 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-view {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .main-product-image {
        height: 300px;
    }
    
    .product-view .product-title {
        font-size: 1.6rem;
    }
    
    .product-view .product-price {
        font-size: 2rem;
    }
    
    .header-search {
        display: none;
    }
    
    .integrated-header {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .category-btn span {
        display: none;
    }
    
    .category-btn {
        min-width: 60px;
        justify-content: center;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }