:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --background-color: #ecf0f1;
    --font-color: #333;
    --card-bg: #ffffff;
    --border-color: #bdc3c7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--font-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    height: 50px;
    width: auto;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #f1c40f;
}

.cart-icon-container {
    position: relative;
    cursor: pointer;
    margin-left: 20px;
}

#cart-icon {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 12px;
    line-height: 1;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 6rem 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background-image: linear-gradient(rgba(44, 62, 80, 0.6), rgba(44, 62, 80, 0.6)), url('hero-background.png');
    background-size: cover;
    background-position: center;
    color: white;
}

.hero h2 {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.4rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.products h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-card h3 {
    font-size: 1.4rem;
    margin: 1rem 0 0.5rem;
    color: var(--secondary-color);
}

.product-card .price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1rem;
}

.product-card .btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.product-card .btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.product-card .btn.added {
    background-color: #27ae60;
    cursor: default;
}

.about, .contact {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.about h2, .contact h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about p {
    max-width: 800px;
    margin: 0 auto 1rem;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    text-align: left;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.contact-info, .contact-form-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.contact-info h3, .contact-form-container h3 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.contact-form-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form-container input,
.contact-form-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.contact-form-container .btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.contact-form-container .btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.contact-form-container .btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.4s;
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-top: 0;
    text-align: center;
    margin-bottom: 1.5rem;
}

#cart-items-container {
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 1rem;
}

#cart-empty-message {
    text-align: center;
    color: #777;
    padding: 2rem 0;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-info h4 {
    margin: 0 0 5px 0;
    color: var(--secondary-color);
}

.cart-item-info p {
    margin: 0;
    color: #555;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.cart-item-quantity button {
    background: none;
    border: 1px solid var(--border-color);
    width: 25px;
    height: 25px;
    cursor: pointer;
}

.cart-item-quantity span {
    padding: 0 10px;
    font-weight: bold;
}

.cart-summary {
    text-align: right;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--primary-color);
}

.cart-summary p {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.2rem;
    background-color: #27ae60;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}