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

body {
    font-family: Arial, sans-serif;
    color: 333333;
    background: #f7f7f7;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #2c3e50;
    colour: white;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 8px;
    flex-grow: 2;
    margin: 0 24px;
}

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

.cart-link {
    color: white;
    text-decoration: none;
    position: relative;
}

.cart-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 4px;
}

.container {
    max-width: 1100px;
    margin: 24px 0;
    padding: 0 16px;
}

.filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.category-list a {
    margin-right: 12px;
    text-decoration: none;
    color: #333;
    padding: 6px 10px;
    border-radius: 4px;
}

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

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8 rgba(0,0,0,0.1);
    text-align: center;
}

.product-image-wrap {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
}

.product-title {
    font-size: 16px;
    margin: 8px 0 4px;
    color: rebeccapurpleee;
}

.product-price {
    font-weight: bold;
    color: #27ae60;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 6px;
}

.in-stock {
    background: #d4f7dc;
    color: #1e7e34;
}

.out-of-stock {
    background: #f8d7da;
    color: #a71d2a;
}

.product-detail {
    display: flex;
    gap: 32px;
    background: white;
    padding: 24px;
    border-radius: 8px;
}

.product-detail-image img {
    width: 300px;
    height: 300px;
}

.product-detail-info .price {
    font-size: 24px;
    color: #27ae60;
    font-weight: 900px;
}

.add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.add-to-cart-form input {
    width: 60px;
    padding: 6px;
}

.btn-primary {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #2c3e50;
}

.wishlist-btn {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}

.reviews-section {
    margin-top: 24px;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.review-list li {
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cart-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

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

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 40%;
}

.remove-link {
    color: #e74c3c;
    text-decoration: none;
}

.cart-summary {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: right;
}

.shipping-note {
    color: #e67e22;
    font-size: 14px;
}

.checkout-summary, .checkout-form, .confirmation {
    background: white;
    padding: 24px;
    border-radius: 8px;
}

.checkout-form label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
}

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

.grand-total {
    font-size: 20px;
    font-weight: bold;
    margin-top: 12px;
}

.contact-form {
    background: white;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-msg {
    color: #a71d2a;
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
}

.success-msg {
    color: #1e7e34;
    background: #d4f7dc;
    padding: 10px;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #999;
}

.not-found {
    text-align: center;
    padding: 80px 20px;
}


.cat-count {
    color: #f7f7f7;
    font-size: 12px;
}

.savings-badge {
    background: #ffecec;
    color: #e74c3c;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge.low-stock {
    background: #fff3cd;
    color: #856404;
    position: relative;
    top: -20px;
}

.stars {
    color: #f39c12;
    font-size: 18px;
    letter-spacing: -4px;
}

.low-stock-warning {
    color: #e67e22;
    font-weight: bold;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.page-link {
    color: #2c3e50;
    text-decoration: none;
}

.recently-viewed {
    margin-top: 32px;
}

.recently-viewed-strip {
    display: flex;
    gap: 20px;
}

.rv-item {
    text-align: center;
    text-decoration: none;
    color: #333;
    width: 100px;
}

.rv-item img {
    width: 80px;
    height: 80px;
}

.coupon-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.coupon-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.coupon-applied {
    color: #1e7e34;
    margin-top: 8px;
}

.gift-banner {
    background: #d4f7dc;
    color: #1e7e34;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    text-align: center;
    font-weight: bold;
}

.clear-cart-link {
    color: #999;
    margin-right: 16px;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-right: 12px;
}

/* Dark mode variables - scoped to <html>, not <body> (see the JS bug that toggles the wrong element) */
html.dark-mode {
    background: #1a1a1a;
}
html.dark-mode body {
    background: #1a1a1a;
    color: #eee;
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    cursor: pointer;
    display: block;
}

.newsletter-form {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.newsletter-form input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.newsletter-result {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.badge.bestseller {
    background: #2c3e50;
    color: #333;
}
