/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px 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: 20px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Navigation Menu - Hierarchical */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    padding: 5px 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #4A90E2;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a {
    color: #4A90E2;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #357ABD;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
    margin: 0 5px;
}

.breadcrumb-current {
    color: #666;
}

/* Cart Icon and Sidebar */
.cart-icon {
    cursor: pointer;
    padding: 10px 15px;
    background-color: #4A90E2;
    color: #fff;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.cart-icon:hover {
    background-color: #357ABD;
}

/* Cart Overlay */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.cart-overlay.active {
    display: block;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 90vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.15);
    z-index: 999;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    font-size: 20px;
    margin: 0;
}

.cart-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.3s;
}

.cart-close:hover {
    color: #333;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.cart-item-price {
    color: #4A90E2;
    font-weight: 600;
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-controls label {
    font-size: 14px;
    color: #666;
}

.cart-item-controls input[type="number"] {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    text-decoration: underline;
}

.cart-item-remove:hover {
    color: #c0392b;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding: 20px;
}

.cart-total {
    margin-bottom: 15px;
    font-size: 20px;
    text-align: right;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background-color: #50C878;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-checkout:hover {
    background-color: #45B369;
}

.cart-empty {
    color: #999;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
}

/* Main Content with Sidebar */
main {
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

.main-content {
    display: flex;
    gap: 30px;
}

/* Category Filter Sidebar */
.category-filter {
    width: 220px;
    flex-shrink: 0;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.category-filter h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.category-radio:hover {
    background-color: #f8f9fa;
}

.category-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-radio span {
    font-size: 15px;
    color: #555;
}

/* Products Section */
.products-section {
    flex: 1;
}

.products-section h2 {
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

/* Product Grid - Responsive Flexbox */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: stretch;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    flex: 1 1 280px;
    max-width: 360px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-card.hidden {
    display: none;
}

.product-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.product-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 20px 0;
    color: #333;
    transition: color 0.3s;
}

.product-link:hover .product-name {
    color: #4A90E2;
}

.product-info {
    padding: 0 20px 20px;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #4A90E2;
    margin-bottom: 15px;
}

.btn-add-cart {
    display: inline-block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    background-color: #4A90E2;
    color: #fff;
}

.btn-add-cart:hover {
    background-color: #357ABD;
}

/* Product Detail Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-image-large {
    width: 600px;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-detail-info h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.product-price-large {
    font-size: 32px;
    font-weight: 700;
    color: #4A90E2;
    margin-bottom: 30px;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.product-description p {
    line-height: 1.8;
    color: #666;
}

.btn-add-cart-large {
    width: 100%;
    padding: 15px;
    background-color: #4A90E2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 15px;
}

.btn-add-cart-large:hover {
    background-color: #357ABD;
}

.btn-back {
    display: inline-block;
    color: #4A90E2;
    text-decoration: none;
    font-weight: 500;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-grid {
        gap: 25px;
    }

    .product-card {
        flex-basis: 250px;
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        flex-direction: column;
    }

    .category-filter {
        width: 100%;
        position: static;
    }

    .product-grid {
        gap: 20px;
    }

    .product-card {
        flex-basis: 220px;
        max-width: none;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: #50C878;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-show {
    animation: slideIn 0.3s ease-out;
}

.notification-hide {
    animation: slideOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .product-grid {
        gap: 20px;
    }
    
    .product-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}
