/* --- 1. GENERAL RESET & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
}

h1,
h2,
h3,
p {
    margin: 0;
}

/* --- 2. HEADER & NAV (Simplified for Demo) --- */

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.hero {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    color: #8B0000;
    /* Dark red based on your screenshot */
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-style: italic;
    color: #666;
    line-height: 1.5;
}

/* --- 3. PRODUCT GRID LAYOUT (The Core Fix) --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

.menu-intro {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Product grid */
.products-grid {
    display: grid;
    /* Exactly 3 columns on large screens */
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    /* Generous space between cards */
}

/* Responsive: 2 Columns on Tablet */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 Column on Mobile */
@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 4. PRODUCT CARD STYLING --- */
.product-card {
    background-color: #8B0000;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background-color: #8B0000;
    border-radius: 8px;
}

.product-title {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    color: #ffffff;
    min-height: 40px;
    padding: 10px 10px 0;
    font-size: 1.1em;
}

.product-description {
    font-family: 'Times New Roman', serif;
    color: #ffffff;
    min-height: 80px;
    padding: 5px 10px;
    font-size: 0.9em;
    line-height: 1.4;
    flex-grow: 1;
}

.product-price {
    font-family: 'Times New Roman', serif;
    color: #FFD700;
    font-weight: bold;
    font-size: 1.2em;
    padding: 10px;
}

.product-actions {
    padding: 0 10px 15px;
}

.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.qty-btn {
    background-color: #FFD700;
    color: #8B0000;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.qty-btn:hover {
    background-color: #e6c200;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #FFD700;
    border-radius: 4px;
    background-color: #6b0000;
    color: white;
    font-size: 1em;
    padding: 4px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn {
    background-color: #FFD700;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: 'Times New Roman', serif;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #e6c200;
}

.add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .product-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .product-card {
        width: 100%;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 10px;
}

.pagination a {
    color: white;
    background-color: #a01010;
    padding: 10px 18px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-family: 'Times New Roman', serif;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    border: 1px solid transparent;
}

.pagination a:hover:not(.disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pagination a.active {
    background-color: #FFD700;
    color: #8B0000;
    font-weight: bold;
    pointer-events: none;
    border: 1px solid #8B0000;
}

.pagination a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #500000;
    pointer-events: none;
}

/* Specific styling for Previous/Next */
.pagination a.prev-btn,
.pagination a.next-btn {
    font-weight: bold;
    min-width: 100px;
    justify-content: center;
}

/* Sold Out Styles */
.product-card.sold-out-card {
    filter: grayscale(0.6);
    opacity: 0.8;
}

.product-card.sold-out-card .product-img {
    filter: brightness(0.7);
}

.sold-out-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #8B0000;
    color: #FFD700;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
    transform: rotate(-5deg);
    border: 2px solid #FFD700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 5;
    text-transform: uppercase;
    font-family: 'Times New Roman', serif;
}

.add-to-cart-btn.sold-out {
    background-color: #555 !important;
    color: #aaa !important;
    cursor: not-allowed;
    border: 1px solid #444;
}