/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
body {
    font-family: 'Tahoma', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    direction: rtl;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* First Row - Logo, Search, Login/Cart */
.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    margin-left: 2rem;
}

.logo a {
    background: linear-gradient(45deg, #dc2626, #ef4444, #b91c1c, #f87171);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    transition: all 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-bar {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
}

.search-bar:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-button {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    margin-right: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Login and Cart */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-link:hover {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    transform: translateY(-2px);
}

/* Second Row - Navigation */
.header-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin-right: 2rem;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.nav-menu a:hover::before {
    left: 100%;
}

.nav-menu a:hover {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Hamburger Menu */
.hamburger-menu {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-right: 0;
}

.hamburger-menu:hover {
    background: rgba(255,255,255,0.2);
}

.hamburger-icon {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger-menu:hover .hamburger-icon {
    background: linear-gradient(45deg, #dc2626, #ef4444);
}

/* Dropdown Categories */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 0.5rem 0;
}

.hamburger-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    transform: translateX(-5px);
}

/* Legacy support for categories-dropdown */
.categories-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.hamburger-menu:hover .categories-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.categories-list {
    list-style: none;
    padding: 0.5rem 0;
}

.categories-list li {
    border-bottom: 1px solid #f0f0f0;
}

.categories-list li:last-child {
    border-bottom: none;
}

.categories-list a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.categories-list a:hover {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    transform: translateX(-5px);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 0 0 30px 30px;
    margin-bottom: 3rem;
}

.hero-slider {
    position: relative;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 30px 30px 0 0;
    padding: 3rem 0;
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #dc2626, #ef4444, #b91c1c, #f87171);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Horizontal Product Sections */
.product-section {
    margin-bottom: 4rem;
}

.product-row {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-row::-webkit-scrollbar {
    display: none;
}

/* Horizontal Product Cards (for homepage) */
.product-row .product-card {
    min-width: 300px;
    max-width: 350px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 420px; /* Ensure enough space for content/button */
    height: auto; /* Let content determine height */
    flex-shrink: 0; /* Prevent shrinking */
    cursor: pointer; /* Make cards look clickable */
}

.product-row .product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.product-row .product-image {
    width: 100%;
    height: 220px; /* Slightly shorter for horizontal layout */
    object-fit: cover;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.product-row .product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.product-row .product-card:hover .product-image::before {
    left: 100%;
}

.product-row .product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-row .product-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-row .product-price {
    font-size: 1.4rem;
    color: #dc2626;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-row .product-stock {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-row .product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    display: none; /* Hide description in card views */
}

.product-row .product-info .btn {
    margin-top: auto;
    align-self: stretch;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.btn-outline {
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.btn-outline:hover {
    background: #dc2626;
    color: #fff;
}

.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.card-title { text-align: center; margin-bottom: 2rem; color: #333; }
.maxw-400 { max-width: 400px; margin: 0 auto; }

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #dc2626, #b91c1c);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

.btn-warning {
    background: linear-gradient(45deg, #ffa726, #ff7043);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 167, 38, 0.4);
}

/* Services Section */
.services-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    margin: 4rem 0;
    border-radius: 30px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: rgba(255,255,255,0.95);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
}

.service-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #dc2626;
}

.footer-section p, .footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: #dc2626;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* Cart Badge */
.cart-badge {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    border-radius: 50%;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Product Cards - Fixed Proportions */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 420px; /* Ensure room for button */
    height: auto;
    max-width: 350px; /* Maximum width to prevent stretching */
    margin: 0 auto; /* Center cards in their grid cells */
    cursor: pointer; /* Make cards look clickable */
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 250px; /* Fixed height for image */
    object-fit: cover; /* Maintain aspect ratio */
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    position: relative;
    overflow: hidden;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.product-card:hover .product-image::before {
    left: 100%;
}

.product-info {
    padding: 1.5rem;
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.4rem;
    color: #dc2626;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-stock {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Hide description in card views */
.product-card .product-description {
    display: none;
}

/* Make cards look clickable */
.product-card {
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Button container at bottom of card */
.product-info .btn {
    margin-top: auto;
    align-self: stretch;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .product-card {
        height: 350px;
        max-width: 320px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-row {
        gap: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: none;
}

.alert-success {
    background: linear-gradient(45deg, #dc2626, #b91c1c);
    color: white;
}

.alert-danger {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
}

.alert-warning {
    background: linear-gradient(45deg, #ffa726, #ff7043);
    color: white;
} 