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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

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

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
}

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

.logo h1 {
    color: white;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    list-style: none;
}

.breadcrumb li {
    margin-right: 10px;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin-left: 10px;
    color: #ccc;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Shopping Cart */
.shopping-cart-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #e74c3c;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 200;
}

.shopping-cart-overlay {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    border-left: 2px solid #ccc;
    z-index: 150;
    overflow-y: auto;
}

.shopping-cart-trigger:hover + .shopping-cart-overlay,
.shopping-cart-overlay:hover {
    right: 0;
}

.shopping-cart {
    padding: 20px;
}

.shopping-cart h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.cart-items {
    min-height: 200px;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 50px 0;
}

.cart-item {
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #e74c3c;
}

.cart-item-quantity {
    margin-top: 10px;
}

.cart-item-quantity input {
    width: 50px;
    padding: 5px;
    border: 1px solid #ccc;
}

.cart-total {
    padding: 20px 0;
    border-top: 2px solid #333;
    text-align: right;
    font-size: 18px;
}

.checkout-btn {
    width: 100%;
    background-color: #27ae60;
    color: white;
    padding: 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.checkout-btn:hover {
    background-color: #229954;
}

/* Main Content */
main {
    margin: 20px 0;
}

/* Hero Section */
.hero {
    background-color: #3498db;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Categories */
.categories {
    background-color: white;
    padding: 20px;
    margin-bottom: 30px;
}

.categories h2 {
    margin-bottom: 15px;
}

.category-nav ul {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.category-nav a {
    display: block;
    padding: 10px 20px;
    background-color: #ecf0f1;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
}

.category-nav a:hover {
    background-color: #3498db;
    color: white;
}

.category-nav a.active {
    background-color: #2c3e50;
    color: white;
}

/* Products Section */
.products {
    padding: 20px 0;
}

.products h2 {
    margin-bottom: 20px;
}

/* Product List - Flexbox */
.product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-card {
    background-color: white;
    border: 1px solid #ddd;
    flex: 1 1 calc(25% - 20px);
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
}

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

.product-name {
    padding: 15px 15px 10px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-height: 60px;
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-card a:hover .product-name {
    color: #3498db;
}

.product-price {
    padding: 0 15px 15px;
    font-size: 18px;
    color: #e74c3c;
    font-weight: bold;
}

.add-to-cart-btn {
    background-color: #3498db;
    color: white;
    padding: 10px;
    margin: 0 15px 15px;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.add-to-cart-btn:hover {
    background-color: #2980b9;
}

/* Product Detail Page */
.product-detail {
    background-color: white;
    padding: 30px;
    margin: 20px 0;
}

.product-detail-wrapper {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.product-image-section {
    flex: 1 1 400px;
}

.product-main-image {
    width: 100%;
    border: 1px solid #ddd;
}

.product-info-section {
    flex: 1 1 500px;
}

.product-title {
    font-size: 28px;
    margin-bottom: 15px;
}

.product-price-large {
    font-size: 24px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-description {
    line-height: 1.8;
}

.product-description h2 {
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.product-description h3 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.product-description ul {
    list-style: disc;
    margin-left: 30px;
    margin-bottom: 15px;
}

.product-description li {
    margin-bottom: 5px;
}

.product-actions {
    margin-top: 30px;
}

.add-to-cart-btn.large {
    padding: 15px 40px;
    font-size: 18px;
}

/* Related Products */
.related-products {
    padding: 20px 0;
}

.related-products h2 {
    margin-bottom: 20px;
}

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

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer nav ul {
    display: flex;
    gap: 20px;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-card {
        flex: 1 1 calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .product-card {
        flex: 1 1 calc(50% - 20px);
    }

    .shopping-cart-overlay {
        width: 100%;
        right: -100%;
    }

    header .container {
        flex-direction: column;
        gap: 10px;
    }

    .product-detail-wrapper {
        flex-direction: column;
    }

    footer .container {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .product-card {
        flex: 1 1 100%;
    }

    .category-nav ul {
        flex-direction: column;
    }

    .hero h2 {
        font-size: 24px;
    }
}

.empty-products-message {
    margin-top: 15px;
    color: #666;
}

.admin-panel {
    padding: 30px 0;
}

.admin-panel h2 {
    margin-bottom: 15px;
}

.status-message {
    min-height: 24px;
    margin-bottom: 20px;
    color: #1e7e34;
    font-weight: bold;
}

.status-message.error {
    color: #b52a37;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.admin-form {
    background-color: white;
    border: 1px solid #ddd;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form h3 {
    margin-bottom: 8px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
}

.admin-form button {
    margin-top: 8px;
    padding: 10px;
    border: none;
    background-color: #3498db;
    color: white;
    cursor: pointer;
}

.admin-form button:hover {
    background-color: #2980b9;
}

.danger-form button {
    background-color: #c0392b;
}

.danger-form button:hover {
    background-color: #992d22;
}

.admin-table-wrap {
    background-color: white;
    border: 1px solid #ddd;
    padding: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.admin-table th {
    background-color: #f4f4f4;
}

.admin-nav-link {
    margin-top: 16px;
}

/* Cart quantity buttons */
.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    vertical-align: middle;
}

.qty-btn:hover {
    background-color: #ddd;
}

.qty-input {
    width: 45px;
    height: 28px;
    text-align: center;
    border: 1px solid #ccc;
    vertical-align: middle;
    margin: 0 4px;
}

.cart-item-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    vertical-align: middle;
}

.cart-item-delete:hover {
    background-color: #c0392b;
}

/* User indicator in header */
.user-indicator {
    color: #ecf0f1;
    font-size: 14px;
    white-space: nowrap;
}

.user-indicator a {
    color: #ecf0f1;
    text-decoration: underline;
}

.user-indicator a:hover {
    color: white;
}
