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

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav ul li {
    display: inline;
    margin-bottom: 10px;
}

nav ul li a {
    text-decoration: none;
    color: white;
    background-color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    white-space: nowrap;
}

#categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#categories button {
    padding: 20px 30px;
    background-color: #333;
    font-size: 1.1rem;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

#search {
    text-align: center;
    margin-bottom: 40px;
}

#search input {
    padding: 10px;
    width: 50%;
    margin-right: 10px;
}

#search button {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

section h2 {
    margin-bottom: 10px;
    text-align: center;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    justify-items: center;
}

.product-card {
    width: 300px;
    padding: 15px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card img {
    width: 80%;
    height: 200px;
    object-fit: contain;
    margin: 0 auto 10px;
}

.product-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: bold;
    min-height: 44px;
}

.product-card p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

.product-card button {
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

footer {
    background-color: #333;
    color: white;
    padding: 40px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    text-align: left;
}

.footer-container .footer-info, 
.footer-container .footer-menu {
    flex: 1;
    min-width: 250px;
}

.footer-container a {
    color: #fff;
    text-decoration: none;
}
.footer-container a:hover {
    text-decoration: underline;
}

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

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

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    font-weight: bold;
}

/* Cart Menu */
.cart-menu {
    height: 100%;
    width: 0;
    position: fixed;
    top: 0;
    right: 0;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    overflow-x: hidden;
    transition: 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 20px;
    background-color: #333;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart-button {
    font-size: 36px;
    cursor: pointer;
}

.cart-items {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-item {
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.cart-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ccc;
    background-color: #f4f4f4;
}

#cart-total {
    font-size: 1.2rem;
    font-weight: bold;
}

.checkout-button {
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px;
    background-image: url('https://imgur.com/1ICNP9Z.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
}

.hero-section .hero-content {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
}

/* Free Shipping Banner */
#free-shipping-banner {
    position: relative;
    overflow: hidden;
    background-color: #db108d;
    padding: 15px 0;
    color: #ffffff;
    white-space: nowrap;
}

#free-shipping-banner span {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    animation: scroll-banner 23s linear infinite;
}

@keyframes scroll-banner {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- NEW STYLES --- */

/* Pagination Controls */
#pagination-controls {
    text-align: center;
    margin-top: 30px;
}

#pagination-controls button {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 5px;
    transition: background-color 0.2s;
}

#pagination-controls button:hover {
    background-color: #555;
}

#pagination-controls span {
    vertical-align: middle;
    font-weight: bold;
}

/* Processing Message */
#processing-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.87);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 1.5rem;
    z-index: 10001;
    text-align: center;
}

.modal-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.modal-navigation button {
    margin: 0 10px;
    padding: 10px;
    border: none;
    background-color: #333;
    color: white;
    cursor: pointer;
    border-radius: 5px;
}

.image-count {
    margin: 10px;
    font-weight: bold;
}

/* --- OUT OF STOCK STYLING --- */

.product-card.out-of-stock {
    opacity: 0.6;
    border: 2px solid #dc3545;
    background-color: #fff5f5;
}

.product-card.out-of-stock img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.out-of-stock-badge {
    display: inline-block;
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1em;
    margin: 10px 0;
    text-align: center;
    width: 100%;
}

.low-stock-badge {
    display: inline-block;
    background-color: #ff9800;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.95em;
    margin: 10px 0;
    animation: pulse-warning 1.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        background-color: #ff9800;
    }
    50% {
        background-color: #ffb74d;
    }
}

.out-of-stock-btn {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    color: #666 !important;
}

.out-of-stock-btn:hover {
    background-color: #ccc !important;
}