/* --- GLOBAL STYLES & VARIABLES --- */
:root {
    --bg-color: #FDFBF5;
    --text-color: #333333;
    --accent-color: #2E4C3C;
    --accent-hover: #1E3126;
    --card-bg: #FFFFFF;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.07);
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Lato', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 700;
    color: var(--text-color);
}

.page-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color: 0.3s ease;
}

.btn:hover {
    background-color: var(--accent-hover);
}

/* --- HEADER & NAVIGATION --- */
.main-header {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    height: 80px;
    width: auto;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 35px;
}
        
.main-nav a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.main-nav a:hover {
    color: var(--text-color);
}

.main-nav a.active {
    color: var(--text-color);
    border-bottom-color: var(--accent-color);
}

/* --- FOOTER --- */
.main-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #777;
}
.main-footer p {
    margin: 5px 0;
}

/* --- HOME PAGE --- */
.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.pexels.com/photos/2252584/pexels-photo-2252584.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 100px 20px;
    text-align: center;
}

.hero-section h1,
.hero-section p {
    color: #fff;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin: 0 0 1rem 0;
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto 30px auto;
}

.featured-products {
    padding: 60px 0;
}

.featured-products h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

/* --- PRODUCTS PAGE --- */
.catalog-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

#search-bar {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

#category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 10px 18px;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.filter-btn.active {
    background-color: var(--accent-color);
    color: white;
}

#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
        
.product-card h3 {
    font-size: 1.3rem;
    margin: 10px 0;
    flex-grow: 1;
}

.product-card .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 15px 0 0 0;
}

.no-results {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    font-size: 1.2rem;
}

/* --- CONTACT PAGE --- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    margin-top: 40px;
}

.contact-info ul {
    list-style: none;
    padding: 0;
}
.contact-info li {
    margin-bottom: 15px;
}

.contact-form-container .form-group {
    margin-bottom: 20px;
}

.contact-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.contact-form-container input,
.contact-form-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
    box-sizing: border-box;
}

/* --- ORDER PAGE STYLES --- */
.order-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.product-search-container {
    position: relative;
}

#product-search {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 999;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
}

.search-result-item:hover {
    background-color: #f4f4f4;
}

#order-list {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    min-height: 200px;
    background-color: var(--card-bg);
}

.empty-order {
    color: #888;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.order-item:last-child {
    border-bottom: none;
}

.quantity-input {
    width: 50px;
    padding: 5px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    cursor: pointer;
    font-weight: bold;
}

/* --- ENHANCED ORDER FORM STYLES --- */
/* This rule applies the 'card' style to both columns */
.order-builder,
.customer-details {
    background-color: var(--card-bg);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow-color);
    /* The flex properties for vertical centering have been removed for a top-aligned layout */
}

/* Styles the headings in both columns */
.order-builder h3,
.customer-details h3 {
    margin-top: 0;
    font-size: 1.8rem;
    color: var(--text-color);
}

/* Styles unique to the right-side customer details form */
.customer-details .form-group label {
    font-size: 1rem;
    margin-bottom: 8px;
}

.customer-details .form-group input,
.customer-details .form-group textarea {
    font-size: 1.1rem;
    padding: 15px;
}

.customer-details .btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    margin-top: 10px;
}

.order-item-details {
    flex-grow: 1;
    padding-right: 15px;
}

.order-item-name {
    display: block;
    font-weight: bold;
}

.order-item-price {
    font-size: 0.9rem;
    color: #555;
}

.order-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-subtotal {
    width: 70px;
    text-align: right;
    font-weight: bold;
}

.order-total {
    text-align: right;
    margin-top: 20px;
    font-size: 1.5rem;
    font-family: var(--heading-font);
    font-weight: 700;
}

#total-price {
    color: var(--accent-color);
    margin-left: 15px;
}

/* --- MOBILE FRIENDLY (RESPONSIVE) STYLES --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .page-title, .featured-products h2 { font-size: 2.2rem; }

    .main-header .container {
        flex-direction: column;
        gap: 20px;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    .main-nav li {
        width: 100%;
        text-align: center;
    }
    .main-nav a {
        padding: 10px;
        display: block;
        border-bottom: 1px solid var(--border-color);
    }
    .main-nav a.active {
        border-bottom-color: var(--accent-color);
    }

    .catalog-controls {
        flex-direction: column;
    }

    .contact-layout,
    .order-layout {
        grid-template-columns: 1fr;
    }
}