/* --- Global Resets & Base Styles --- */
:root {
    --primary-color: #00447C; /* Example: Deep Blue */
    --secondary-color: #F37F1B; /* Example: Orange Accent */
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff; /* Or var(--light-gray) for off-white bg */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1; /* Ensures footer stays at bottom */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    margin-bottom: 0.8em;
    color: var(--primary-color);
    line-height: 1.3;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.2rem; color: #444; } /* Product titles slightly less prominent */

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn:hover {
    background-color: #d96c11; /* Darker orange */
    text-decoration: none;
    color: #fff;
}
.btn:active {
    transform: scale(0.98);
}

/* --- Header Styles --- */
.site-header {
    background-color: #fff;
    padding: 0 1rem; /* Add padding for smaller screens */
    border-bottom: 1px solid var(--border-color);
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}
/* .logo img { max-height: 50px; } */

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--secondary-color);
}

.main-nav a::after { /* Underline effect on hover/active */
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}


.header-actions {
    display: flex;
    align-items: center;
}

.header-actions input[type="search"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 15px;
    font-size: 0.9rem;
}

.cart-icon, .account-icon {
    font-size: 1.5rem; /* Adjust size as needed */
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    margin-left: 15px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    line-height: 1;
}


/* --- Shop Page Specific Styles --- */
.shop-page {
    padding: 40px 0;
}

.shop-intro {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #555;
}

.shop-controls {
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.shop-controls select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    /* Responsive grid: min 250px width, max 1fr */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; /* Space between grid items */
}

.product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    padding: 25px; /* Increased padding */
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease, background-color 0.3s ease; /* Added background transition */
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); /* Slightly stronger shadow */
    transform: translateY(-5px);
    background-color: var(--light-gray); /* Subtle background change on hover */
}

.product-link {
    text-decoration: none;
    color: inherit; /* Inherit color from parent */
}

.product-image {
    width: 100%;
    height: 200px; /* Fixed height for uniform look */
    object-fit: cover; /* Changed to cover for uniform fill */
    margin-bottom: 15px;
    background-color: #eee; /* Placeholder background */
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
    min-height: 3.3em; /* Added min-height for alignment (approx 2 lines) */
    /* Limit title lines - optional */
    /* height: 2.6em; */ /* Adjust based on font-size and line-height */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 2; */
    /* -webkit-box-orient: vertical; */
}
.product-category {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.4rem; /* Slightly larger price */
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.product-sku {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 15px;
}

.product-card .add-to-cart-btn {
    margin-top: auto; /* Pushes button to the bottom */
    width: 100%;
}


/* --- Pagination --- */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
}

.pagination a:hover,
.pagination a.current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .page-ellipsis {
    border: none;
}

/* --- Footer Styles --- */
.site-footer {
    background-color: #333; /* Dark background */
    color: #ccc;
    padding: 40px 0 20px 0;
    margin-top: 40px; /* Space above footer */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 30px; /* Space between columns */
    margin-bottom: 20px;
}

.footer-links, .footer-contact, .footer-social {
    flex: 1; /* Try to take equal space */
    min-width: 200px; /* Minimum width before wrapping */
}

.site-footer h4 {
    color: #fff;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a, .footer-contact a, .footer-social a {
    color: #ccc;
    text-decoration: none;
}

.footer-links a:hover, .footer-contact a:hover, .footer-social a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-contact p {
    margin-bottom: 10px;
}

.copyright {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #555;
    font-size: 0.9rem;
    color: #aaa;
}

/* --- Responsiveness --- */
@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap; /* Allow header items to wrap */
         justify-content: center; /* Center items when wrapped */
         padding-bottom: 10px; /* Space when wrapped */
    }
    .main-nav { order: 3; width: 100%; margin-top: 10px; } /* Nav below logo/actions */
    .main-nav ul { justify-content: center; }
    .header-actions { order: 2; } /* Actions beside logo */

    .site-header { height: auto; min-height: var(--header-height); }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .product-grid {
        /* Adjust columns for smaller screens if needed, though auto-fit helps */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .footer-content {
        flex-direction: column; /* Stack footer columns */
        text-align: center;
    }
    .footer-content > div { /* Center content within stacked columns */
        margin-bottom: 20px;
    }
    .site-footer h4 { display: block; } /* Make heading block for center align */

}

@media (max-width: 576px) {
     .header-actions input[type="search"] {
        width: 100%; /* Full width search on small screens */
        margin-bottom: 10px;
     }
     .header-actions { flex-wrap: wrap; justify-content: center; }
     .cart-icon, .account-icon { margin-left: 10px; margin-right: 10px; }

    .main-nav li { margin: 0 10px; }

    .product-grid {
         /* One column on very small screens */
        grid-template-columns: 1fr;
    }

    .shop-controls select { width: 100%; }
}