/* Base Styles & Typography */
body {
    background-color: lightblue; /* Changed to lightblue */
    color: black; /* Changed to black for better contrast on lightblue */
    font-family: Arial, sans-serif;
    margin: 0;
    position: relative; /* Essential for absolutely positioned elements like cart-toggle */
}

header {
    text-align: center;
    font-size: 2em;
    padding: 20px;
    color: darkblue; /* Changed header color for better contrast */
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: center; /* Centers the 'Home' link */
    align-items: center;
    padding: 10px 40px;
    background-color: #0033cc;
    position: relative; /* Establishes positioning context for its children if any */
    z-index: 10; /* Ensures nav is above other content */
}

nav a {
    color: white; /* Keep white on dark blue nav */
    text-decoration: none;
    display: flex; /* Helps center text within the anchor */
    align-items: center;
    justify-content: center;
}

nav a h3 {
    margin: 0; /* Remove default margin from h3 inside anchor */
    padding: 5px 10px; /* Add some padding for better click area */
}

/* Cart Toggle Button */
#cart-toggle {
    background-color: #ffcc00;
    color: #000;
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    left: 2in; /* 2 inches from the left */
    top: 65px; /* Adjusted to align with the Home button visually */
    z-index: 11; /* Ensures it's above other elements if overlaps */
    transition: background-color 0.3s ease;
}

#cart-toggle:hover {
    background-color: #e6b800;
}

/* Product List Grid */
#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 25%)); /* Responsive columns, aiming for ~4 items */
    gap: 20px;
    padding: 20px;
    max-width: 1200px; /* Max width for the product grid */
    margin: 0 auto; /* Centers the grid container */
    justify-content: center; /* Centers items within the grid if there's extra space */
}

/* Individual Product Card */
.product {
    background-color: white;
    color: black; /* Text inside product cards should be black */
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes buttons to the bottom */
}

.product img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.product h2 {
    font-size: 1.2em;
    margin: 10px 0;
    min-height: 2.5em; /* Ensures titles have consistent height */
}

.product p {
    font-size: 0.9em;
    margin: 0 0 15px;
    flex-grow: 1;
    line-height: 1.4em; /* Standard line height */
    height: 2.8em; /* Exactly 2 lines (2 * 1.4em) */
    overflow: hidden; /* Hide content beyond 2 lines */
}

.price {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.view-button,
.add-to-cart-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: 100%; /* Make buttons full width */
    transition: background-color 0.3s ease;
}

.view-button:hover {
    background-color: #45a049;
}

.add-to-cart-btn {
    background-color: #ff5722;
    color: white;
}

.add-to-cart-btn:hover {
    background-color: #e64a19;
}

/* Responsive Design */
@media (max-width: 900px) {
    #product-list {
        grid-template-columns: repeat(2, 1fr); /* 2 items per row */
    }
    #cart-toggle {
        position: static; /* Remove absolute positioning on smaller screens */
        margin: 10px auto; /* Center it below the nav */
        width: fit-content;
    }
    nav {
        flex-direction: column; /* Stack nav items */
        align-items: center;
    }
}

@media (max-width: 600px) {
    #product-list {
        grid-template-columns: 1fr; /* 1 item per row */
    }
    /* cart-toggle and nav handled by 900px breakpoint */
}

/* Cart Sidebar */
#cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden off-screen initially */
    width: 380px;
    height: 100%;
    background-color: #f4f4f4;
    color: #333;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

#cart-sidebar.open {
    right: 0; /* Slides into view */
}

.cart-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    background-color: #eee;
    border-bottom: 1px solid #ddd;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.close-cart:hover {
    color: #000;
}

.cart-content {
    padding: 15px;
    overflow-y: auto; /* Allows scrolling if cart items exceed height */
    flex-grow: 1;
}

.empty-cart {
    text-align: center;
    padding: 20px;
    color: #666;
}

.cart-item {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    align-items: center;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-controls button {
    padding: 2px 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #f0f0f0;
    color: #333;
}
.quantity-controls button:hover {
    background-color: #e0e0e0;
}

.cart-total {
    padding: 15px;
    border-top: 2px solid #ddd;
    text-align: right;
}

.proceed-to-checkout,
.back-to-cart {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
}

.proceed-to-checkout:hover {
    background-color: #0056b3;
}

.back-to-cart {
    background-color: #6c757d;
}

.back-to-cart:hover {
    background-color: #5a6268;
}

.checkout-instructions {
    margin: 15px 0;
    padding: 10px;
    background-color: #e9f5ff;
    border: 1px solid #b3d7ff;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;
}

/* Message Boxes (Success, Error, Warning) */
.success-message,
.error-message,
.warning-message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning-message {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Product Modal (Popup) */
#product-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
}

#product-modal.open {
    display: flex; /* Show when open */
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    height: 80vh; /* 80% of viewport height */
    border-radius: 8px;
    overflow: hidden; /* Ensure iframe stays within bounds */
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #333;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001; /* Above modal content */
}

.close-modal:hover {
    color: #000;
}

#product-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Zelle Payment Information Section */
.zelle-section {
    text-align: center;
    padding: 20px;
    margin-top: 40px; /* Space above this section */
    background-color: rgba(0, 51, 204, 0.2); /* Slightly transparent blue background */
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.zelle-section p {
    margin: 5px 0;
    font-size: 1.05em;
    line-height: 1.4;
    color: #333; /* Changed to a darker color for readability on lightblue */
}

/* Footer */
.soft {
    border-top: 1px solid #ccc;
    margin-top: 20px; /* Space above footer line */
}

marquee {
    padding: 10px 0;
    color: black; /* Changed to black for better contrast on lightblue */
}

marquee span {
    color: black; /* Ensure copyright text is black too */
}

marquee a {
    color: #007bff; /* Changed link color for better visibility on lightblue */
    text-decoration: none;
}

marquee a:hover {
    text-decoration: underline;
}