:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --background-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--background-color);
    color: var(--text-main);
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Navbar */
.navbar-premium {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    letter-spacing: -0.025em;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: rgba(37, 99, 235, 0.05);
    color: var(--primary-color) !important;
}

.admin-link {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    color: white !important;
    padding: 0.5rem 1.25rem !important;
    box-shadow: var(--shadow-md);
}

.admin-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Hero Section */
.hero-slider {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    margin: 1.5rem 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 4rem;
    color: white;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

.btn-hero {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-hero:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* Product Grid & Cards Overhaul */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    padding: 3rem 0;
}

.product-card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    background: #f8fafc;
    overflow: hidden;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Floating Actions */
.product-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.4s ease;
    z-index: 10;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: white;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.action-btn.fav-btn:hover {
    background: #ef4444;
}

/* Badges */
.discount-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #ef4444;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
    z-index: 5;
}

.product-info {
    padding: 1.5rem;
    background: white;
    flex-grow: 1;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
}

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

.product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 1rem;
}

.price-box {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 0.9rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-bottom: -0.2rem;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.currency {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
}

.buy-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e4ed8 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .hero-slider {
        height: 400px;
        padding: 0 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: auto;
        padding: 3rem 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer Spacing Fix */
.product-grid {
    padding-bottom: 8rem !important; /* Extra padding to prevent footer overlap */
}

footer {
    background: white;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}
