/* MicroZon Styles */
:root {
    --primary-color: #FF9900;
    --secondary-color: #232F3E;
    --light-gray: #f2f2f2;
    --dark-gray: #333;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* Header Styles */
header {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
}

.search-bar button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--white);
    font-size: 14px;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Categories Navigation */
.categories {
    background-color: var(--dark-gray);
    padding: 10px 0;
}

.categories ul {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.categories a {
    color: var(--white);
    font-size: 14px;
    padding: 5px 10px;
}

.categories a:hover, .categories a.active {
    color: var(--primary-color);
}

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

/* Sorting Options */
.sorting-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sorting-container label {
    margin-right: 10px;
    font-weight: bold;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    background-color: var(--white);
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.product-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
}

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

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
}

.product-price {
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.product-rating {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.add-to-cart:hover {
    opacity: 0.9;
}

.add-confirmation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.add-confirmation.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Product Details */
.product-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-details-image {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-details-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-details-info {
    flex: 2;
    min-width: 300px;
}

.product-details-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.product-details-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.product-details-rating {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-details-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

.product-details-add {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.product-details-add:hover {
    opacity: 0.9;
}

/* Cart Styles */
#cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: bold;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.quantity-btn {
    background-color: var(--light-gray);
    border: none;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
}

.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid var(--light-gray);
}

.cart-item-remove {
    margin-left: 20px;
    color: #ff0000;
    cursor: pointer;
}

#cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid var(--light-gray);
}

#total-price {
    font-size: 20px;
    font-weight: bold;
}

.checkout-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.checkout-btn:hover {
    opacity: 0.9;
}

/* Checkout Success */
.checkout-success {
    text-align: center;
    padding: 30px;
}

.checkout-success i {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.checkout-success h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.checkout-success p {
    margin-bottom: 10px;
    color: var(--dark-gray);
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 20px 0;
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
        margin: 10px 0;
    }
    
    .categories ul {
        flex-wrap: wrap;
    }
    
    .product-details-container {
        flex-direction: column;
    }
}
