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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 a {
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    position: relative;
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3498db;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.header-actions {
    display: flex;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    margin-left: 10px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

.cart-icon {
    position: relative;
    margin-left: 20px;
    color: #333;
    font-size: 1.2rem;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

/* Hero section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 40px;
    border-radius: 8px;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Section titles */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.section-title h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: linear-gradient(to right, #3498db, #2c3e50);
    margin: 15px auto;
    border-radius: 2px;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category-description {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-top: 10px;
    font-style: italic;
}

/* Product cards */
.product-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 250px;
    width: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #eee;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 16px;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: #e74c3c;
    color: white;
}

.favorite-btn.active:hover {
    background: #c0392b;
}

.favorite-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.favorite-btn .favorite-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f4 100%);
}

.image-placeholder i {
    font-size: 3rem;
    color: #bdc3c7;
}

.product-image-large img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.product-image-preview img {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.product-image .placeholder-icon {
    font-size: 3rem;
    color: #bbb;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: #2c3e50;
}

.product-category {
    color: #3498db;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.product-info p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 0.9rem;
    flex-grow: 1;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 15px;
    margin-top: auto;
}

.btn-add-to-cart {
    width: 100%;
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-add-to-cart:hover {
    background-color: #27ae60;
}

/* Product detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.product-detail-image {
    background-color: #eee;
    border-radius: 8px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-detail-image .placeholder-icon {
    font-size: 5rem;
    color: #bbb;
}

.product-detail-info h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.product-detail-info .product-price {
    font-size: 2rem;
    margin: 20px 0;
}

.product-detail-info .product-description {
    margin: 20px 0;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.quantity-selector label {
    margin-right: 15px;
    font-weight: 500;
}

.quantity-input {
    display: flex;
    align-items: center;
}

.quantity-input button {
    width: 40px;
    height: 40px;
    background-color: #eee;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.quantity-input input {
    width: 50px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

/* Cart styles */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cart-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background-color: #eee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    background-color: #eee;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.quantity-control input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

.cart-total {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

/* Forms */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input[type="file"] {
    padding: 5px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn-large {
    padding: 12px 24px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Checkout form */
.checkout-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.checkout-form .form-group {
    margin-bottom: 20px;
}

.checkout-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.payment-details {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #dee2e6;
}

.payment-details .form-group {
    margin-bottom: 15px;
}

.order-summary {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.order-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Admin panel */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-nav {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.admin-nav ul {
    display: flex;
    list-style: none;
}

.admin-nav ul li {
    margin-right: 20px;
}

.admin-nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.admin-nav ul li a:hover,
.admin-nav ul li a.active {
    background-color: #3498db;
    color: white;
}

/* Dashboard stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #7f8c8d;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

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

/* Favorites page */
.favorites-page .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorites-page .section-title h2 {
    margin: 0;
}

.favorites-page .empty-favorites,
.empty-products {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.favorites-page .empty-favorites i,
.empty-products i {
    font-size: 5rem;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-products h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.empty-products p {
    color: #7f8c8d;
    max-width: 500px;
    margin: 0 auto;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    background-color: #2ecc71;
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.notification.message.error {
    background-color: #e74c3c;
}

.notification.message.info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Filters */
.filters {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #aab7c4;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-self: end;
    margin-bottom: 1px;
}

.filter-buttons .btn {
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.filter-buttons .btn:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        padding: 15px 0;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    nav ul {
        margin-bottom: 15px;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .header-actions {
        margin-top: 15px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-nav ul {
        flex-wrap: wrap;
    }
    
    .admin-nav ul li {
        margin-bottom: 10px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-buttons {
        align-self: stretch;
        margin-top: 10px;
    }
    
    .filter-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px;
    }
    
    .btn {
        margin: 5px;
        padding: 6px 12px;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .filters {
        padding: 20px;
    }
    
    .filter-group {
        margin-bottom: 15px;
    }
    
    .filter-group label {
        font-size: 0.9rem;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-buttons .btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}