/* --- Public Site Styles --- */
:root {
    --theme-color: #28a745;
    --theme-color-dark: #218838;
    --text-color: #333;
    --grey-text: #555;
    --bg-color: #ffffff;
    --light-bg: #f4f7f6;
    --danger-color: #dc3545;
    --secondary-color: #6c757d;
}

body.public-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
}

.public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Global Button Styles --- */
.btn-primary {
    background-color: var(--theme-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover {
    background-color: var(--theme-color-dark);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}
.btn-delete {
    background-color: var(--danger-color);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}
.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}
.btn-outline:hover {
    background-color: #f8f9fa;
    border-color: #aaa;
}

/* --- Header --- */
.public-header {
    background-color: var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex; /* Aligns items side-by-side */
    align-items: center; /* Vertically centers them */
    gap: 10px; /* Adds space between logo and text */
    text-decoration: none;
    color: var(--theme-color);
    font-size: 24px;
    font-weight: 700;
}
.logo img {
    height: 40px; /* You can change this height */
    width: auto;
    display: block;
}
.logo span {
    display: block; /* Ensures clean alignment */
}
.public-nav {
    display: flex;
    gap: 20px;
}
.public-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}
.cart-button {
    background-color: var(--theme-color);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}
.cart-button:hover {
    background-color: var(--theme-color-dark);
}

/* --- Hero Section --- */
.hero-section {
    background-color: var(--theme-color);
    color: white;
    padding: 40px 30px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}
.hero-section p {
    font-size: 1.05em;
    line-height: 1.7;
}

.section-title {
    text-align: center;
    font-size: 28px;
    color: #004d40;
    margin: 40px 0 30px 0;
}

/* --- Homepage Intro Grid --- */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-first: 1 column */
    gap: 20px;
    margin-bottom: 40px;
    align-items: start; /* Align tops of cards */
}

/* --- Showcase Image Style --- */
.showcase-image-container {
    margin-bottom: 20px; /* For mobile stacking */
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}
.showcase-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.showcase-caption {
    text-align: center;
    margin: 15px 0 5px 0;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--dark-green);
}

/* --- Homepage About Section --- */
.homepage-about-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border-top: 4px solid var(--theme-color);
    height: 100%; /* Makes cards same height */
    box-sizing: border-box; /* Includes padding in height */
}
.homepage-about-section h2 {
    text-align: center;
    color: var(--dark-green);
    margin-top: 0;
}
.homepage-about-section h3 {
    color: var(--theme-color);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
    margin-top: 25px;
}
.homepage-about-section p {
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--grey-text, #555);
    text-align: left;
}

/* --- Product Grid --- */
#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px); /* Use auto-fit and a fixed width */
    gap: 20px;
    justify-content: center; /* This will center the cards */
}
.product-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}
.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-name {
    font-size: 20px;
    margin: 0 0 10px 0;
}
.product-desc {
    flex-grow: 1;
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}
.product-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 15px;
}
.add-to-cart-form {
    display: flex;
    gap: 10px;
}
.add-to-cart-form .product-qty-input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.add-to-cart-form .btn-primary {
    flex-grow: 1;
    padding: 10px;
}

/* --- Homepage Cart Button Styles --- */
.cart-button-area {
    margin-bottom: 20px;
}
#view-cart-button {
    max-width: 250px;
    margin: 0 auto; /* Center the button */
    text-align: center;
}

/* --- Cart Page --- */
#cart-page-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.cart-item-row {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap; /* Allow wrapping on mobile */
}
.cart-item-row img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}
.cart-item-info {
    flex-grow: 1;
}
.cart-item-actions {
    width: 100%;
}
.update-cart-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.update-cart-form label {
    font-weight: 600;
    font-size: 0.9em;
}
.update-cart-form .btn-delete {
    margin-left: auto;
}
.cart-item-total {
    width: 100%;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-weight: 600;
    text-align: right;
    font-size: 1.1em;
    color: var(--theme-color);
}
.checkout-form-container {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}
.checkout-form-container .admin-form label { font-weight: 600; margin-bottom: 5px; display: block; }
.checkout-form-container .admin-form input, 
.checkout-form-container .admin-form textarea { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
    margin-bottom: 15px; 
}
.checkout-form-container .admin-form .btn-primary {
    width: 100%;
    box-sizing: border-box;
}

/* Message boxes */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* --- Footer --- */
.public-footer {
    background-color: #004d40;
    color: #e0e0e0;
    padding: 40px 0 20px 0;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.footer-col h4 {
    color: white;
    margin-bottom: 15px;
}
.footer-col p, .footer-col a {
    color: #e0e0e0;
    text-decoration: none;
    line-height: 1.8;
}
.footer-col a:hover {
    color: white;
}
.social-icons a {
    margin-right: 10px;
    font-size: 16px;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid #336b5f;
    padding-top: 20px;
    font-size: 14px;
}

/* --- Dealer Page Styles --- */
.dealer-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px auto 40px auto;
    max-width: 600px;
    justify-content: center;
}
.dealer-search-form select {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}
.dealer-search-form .btn-primary,
.dealer-search-form .btn-secondary {
    padding-left: 20px;
    padding-right: 20px;
}

.dealer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.dealer-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.dealer-card h3 {
    margin: 0 0 5px 0;
    color: var(--theme-color);
}
.dealer-card .dealer-district {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}
.dealer-card .dealer-info {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin: 5px 0;
}
.dealer-card .dealer-info:last-child {
    margin-top: auto; /* Pushes phone number to the bottom */
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-weight: 600;
}

/* --- Mobile Hamburger Menu --- */
.mobile-menu-button {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    font-size: 28px;
    color: var(--theme-color);
    cursor: pointer;
}
.mobile-menu-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ================================================================
   MERGED RESPONSIVE (MOBILE) STYLES
================================================================
*/

/* Desktop-specific styles */
@media (min-width: 992px) {
    .intro-grid {
        /* 40% for image, 60% for text */
        grid-template-columns: 2fr 3fr; 
        gap: 30px;
    }
    .showcase-image-container {
        margin-bottom: 0; /* Remove extra space on desktop */
    }
}

/* Tablet and Mobile styles */
@media (max-width: 768px) {
    /* --- Public Header --- */
    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .logo {
        flex-grow: 1;
    }
    .logo span {
        font-size: 20px; /* Smaller font on mobile */
    }
    .mobile-menu-button {
        display: block; /* Show hamburger */
    }
    .mobile-menu-container {
        display: none; /* Hide the menu by default */
        flex-direction: column;
        width: 100%;
        order: 4; /* Put it at the bottom */
        background-color: #fdfdfd;
        margin-top: 15px;
        border-top: 1px solid #f0f0f0;
    }
    .mobile-menu-container.is-active {
        display: flex; /* Show the menu when active */
    }
    .public-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .public-nav a {
        padding: 15px;
        width: 100%;
        text-align: left;
        box-sizing: border-box;
        border-bottom: 1px solid #f0f0f0;
    }
    .public-nav a:first-child {
        border-top: none;
    }
    .cart-button {
        margin: 15px; /* Add space around the cart button */
        width: calc(100% - 30px);
        text-align: center;
    }

    /* --- Public Cart Page --- */
    #cart-page-layout {
        grid-template-columns: 1fr;
    }
    .cart-items-list {
        order: 1;
    }
    .checkout-form-container {
        order: 2; 
    }
    .cart-item-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .cart-item-info {
        margin-top: 10px;
    }
    .cart-item-actions .product-qty-input {
        width: 70px !important; /* Force Qty box to be small */
        padding: 8px;
    }
    .checkout-form-container .btn-primary {
        width: 100%; /* Make "Place Order" button full-width */
        box-sizing: border-box;
    }
}

/* --- NEW: Contact Page Card Styles --- */
.contact-link-p {
    text-align: left; /* Override default p style */
    margin: 5px 0 15px 0;
}
.contact-link-p a {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--theme-color);
    text-decoration: none;
}
.contact-link-p a:hover {
    text-decoration: underline;
}

/* --- NEW: Contact Page Card Styles --- */
.contact-link-p {
    text-align: left;
    margin: 5px 0 15px 0;
    /* Match the font style of other paragraphs in the card */
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--grey-text, #555); /* Default text color */
}
.contact-link-p a {
    /* Make the link look like normal text */
    color: var(--grey-text, #555);
    font-weight: 400; /* This makes it non-bold */
    text-decoration: none; /* Removes underline */
}
.contact-link-p a:hover {
    /* Add a subtle hover effect */
    text-decoration: underline;
    color: var(--theme-color); /* Optional: turn green on hover */
}

/* --- NEW: Showcase Instruction Text --- */
.showcase-instructions {
    text-align: center;
    font-size: 1.1em;
    color: var(--grey-text, #555);
    margin: 10px 0 5px 0;
}