/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a4a4a;
    --secondary-color: #f5f5dc;
    --text-color: #333;
    --border-radius: 8px;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: var(--shadow);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

header h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 600;
}

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

.product-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin: 1rem 0;
}

.product-card h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-card .description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background: #333;
}

/* Product Details Page */
.product-details {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.product-gallery {
    display: grid;
    gap: 1rem;
}

.main-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.image-grid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.image-grid img:hover {
    opacity: 0.8;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.delivery-options {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background-color: var(--secondary-color);
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
}

select#wilaya {
    background-color: white;
    font-size: 14px;
}

select#wilaya option {
    padding: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    height: 120px;
    resize: vertical;
}

/* Admin Panel */
.admin-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-nav {
    background: var(--primary-color);
    padding: 1rem 0;
}

.admin-nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
}

.admin-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Messages */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .admin-nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .product-card img {
        height: 200px;
    }
}
