/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Use a more modern font stack */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    /* Slightly textured light background */
    background-color: #f8f9fa; /* Even lighter grey */
    /* background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23dcdcdc' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E"); Optional subtle pattern */
    color: #34495e;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Remove the optional container for full-width header/footer */
/* .container { ... } */

header {
    /* Subtle gradient background */
    background: linear-gradient(to right, #34495e, #2c3e50);
    color: #ecf0f1;
    padding: 1rem 25px; /* Slightly more horizontal padding */
    border-bottom: #1abc9c 4px solid;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15); /* Slightly stronger shadow */
}

header a {
    color: #ecf0f1;
    text-decoration: none;
    text-transform: uppercase;
    /* Add transition for smooth hover */
    transition: color 0.3s ease;
}

header h1 {
    float: left;
    /* Remove extra padding if not using container */
    /* padding-left: 20px; */
    font-size: 1.8em; /* Slightly larger title */
}
header h1 a:hover {
    color: #ffffff; /* Make title slightly brighter on hover */
}


header nav {
    float: right;
    /* Align nav items vertically better */
    margin-top: 12px; /* Adjust based on h1 size */
    /* padding-right: 20px; */
}

header ul {
    list-style: none;
}

header li {
    display: inline;
    padding: 0 18px; /* Increase spacing between nav items */
}

header nav a:hover {
    /* Use the accent color for hover */
    color: #1abc9c;
}

main {
    padding: 35px; /* More padding */
    flex-grow: 1;
    background-color: #ffffff;
    width: 88%; /* Adjust width */
    max-width: 1280px; /* Adjust max-width */
    margin: 35px auto; /* More margin */
    box-shadow: 0 6px 18px rgba(44, 62, 80, 0.1); /* Refined shadow */
    border-radius: 10px; /* Slightly more rounded */
}

footer {
    /* Match header gradient direction */
    background: linear-gradient(to right, #34495e, #2c3e50);
    color: #bdc3c7;
    text-align: center;
    padding: 1.8rem 0; /* More padding */
    margin-top: auto;
}

/* Basic Form Styling */
form div {
    margin-bottom: 15px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form textarea,
form select {
    width: 100%;
    padding: 12px; /* Increase padding */
    border: 1px solid #bdc3c7; /* Softer border */
    border-radius: 5px; /* Slightly more rounded */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Add transitions */
}

/* Add focus style for form inputs */
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="number"]:focus,
form textarea:focus,
form select:focus {
    border-color: #1abc9c; /* Highlight with accent color */
    box-shadow: 0 0 5px rgba(26, 188, 156, 0.5); /* Add glow effect */
    outline: none; /* Remove default outline */
}


form button,
.button {
    display: inline-block;
    /* Slightly softer teal */
    background: #1abc9c;
    /* Add a subtle gradient */
    background-image: linear-gradient(to bottom, #1dd2af, #1abc9c);
    color: #fff;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 6px; /* Slightly more rounded */
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    /* Refined transition */
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Add subtle shadow to buttons */
}

form button:hover,
.button:hover {
    /* Darken button on hover */
    background: #16a085;
    background-image: none; /* Remove gradient on hover for flatter look */
    /* Enhance lift effect */
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Increase shadow on hover */
}

.button-danger {
    /* Use a modern red */
    background: #e74c3c;
}
.button-danger:hover {
    /* Darken danger button on hover */
    background: #c0392b;
    transform: translateY(-2px); /* Add lift effect */
}

/* Hero Section Styles */
.hero {
    /* Replace with your image path */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('path/to/your/hero-image.jpg');
    background-color: #34495e; /* Fallback color */
    background-size: cover;
    background-position: center;
    color: #ffffff;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px; /* Space below hero */
    position: relative; /* For potential overlays or animations */
    border-radius: 0 0 10px 10px; /* Optional: round bottom corners */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    /* Simple fade-in animation */
    opacity: 0;
    animation: fadeInHero 1s ease-out forwards;
    animation-delay: 0.3s;
}

.hero h2 {
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 600;
    color: #ffffff; /* Ensure white text */
}

.hero p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #ecf0f1; /* Lighter text */
}

/* Style the hero button specifically if needed */
.hero .button-primary {
    background: #1abc9c; /* Teal */
    background-image: linear-gradient(to bottom, #1dd2af, #1abc9c);
    padding: 15px 35px;
    font-size: 1.1em;
}
.hero .button-primary:hover {
    background: #16a085;
    background-image: none;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}


/* Keyframes for animations */
@keyframes fadeInHero {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUpProduct {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Product Listings */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* Slightly larger min size */
    gap: 35px; /* Increase gap */
}

.product-item {
    border: none; /* Remove border, rely on shadow */
    padding: 20px;
    text-align: center;
    background-color: #ffffff;
    border-radius: 10px; /* Match main content rounding */
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.08); /* Refined card shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Add overflow hidden for image rounding */
    overflow: hidden;
}

.product-item:hover {
    transform: translateY(-6px); /* Increase lift */
    box-shadow: 0 10px 25px rgba(44, 62, 80, 0.15); /* Increase shadow */
}


.product-item img {
    max-width: 100%;
    height: 190px; /* Adjust height */
    object-fit: contain;
    margin-bottom: 18px; /* Adjust spacing */
    border-radius: 6px; /* Match button rounding */
    /* Ensure image doesn't overflow the rounded corners of the card */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.product-item h3 {
    margin-bottom: 10px;
    font-size: 1.15em;
    color: #2c3e50; /* Darker color for title */
}
/* Style product title link */
.product-item h3 a {
    text-decoration: none;
    color: inherit; /* Inherit color from h3 */
    transition: color 0.3s ease;
}
.product-item h3 a:hover {
    color: #1abc9c; /* Accent color on hover */
}


.product-item .price {
    font-weight: 600; /* Slightly less bold */
    color: #16a085;
    margin-bottom: 18px; /* Adjust spacing */
    font-size: 1.25em; /* Adjust size */
}

/* Style buttons within product item */
.product-item .button {
    margin: 5px;
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Style the 'Add to Cart' button (assuming it's the submit button in the form) */
.product-item form button[type="submit"] {
    background: #1abc9c; /* Primary Teal */
    background-image: linear-gradient(to bottom, #1dd2af, #1abc9c);
    color: #fff;
}
.product-item form button[type="submit"]:hover {
    background: #16a085;
    background-image: none;
}

/* Style the 'View Details' button (assuming it's the <a> tag with class 'button') */
.product-item a.button {
    background: #95a5a6; /* Secondary Grey */
    background-image: linear-gradient(to bottom, #bdc3c7, #95a5a6);
    color: #fff;
}
.product-item a.button:hover {
    background: #7f8c8d;
    background-image: none;
}


/* Cart Table */
table.cart {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table.cart th, table.cart td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

table.cart th {
    background-color: #f2f2f2;
}

table.cart input[type="number"] {
    width: 60px;
    padding: 5px;
}

.cart-total {
    margin-top: 20px;
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
}

/* Utility */
.error {
    color: red;
    font-weight: bold;
    margin-bottom: 10px;
    border: 1px solid red;
    padding: 10px;
    background-color: #ffebeb;
}

.success {
    color: green;
    font-weight: bold;
    margin-bottom: 10px;
    border: 1px solid green;
    padding: 10px;
    background-color: #e6ffec;
}

/* Clearfix for floated elements like header nav */
header::after {
    content: "";
    display: table;
    clear: both;
}


/* ============================ */
/* ===== MEDIA QUERIES ======== */
/* ============================ */

/* Medium screens (Tablets, smaller laptops) */
@media (max-width: 992px) {
    header h1 {
        font-size: 1.6em; /* Slightly smaller title */
    }
    header li {
        padding: 0 12px; /* Reduce nav spacing */
    }
    main {
        width: 95%; /* Use more width */
        padding: 25px;
    }
    .hero {
        padding: 60px 15px;
    }
    .hero h2 {
        font-size: 2.4em;
    }
    .hero p {
        font-size: 1.1em;
    }
    .products {
        /* Adjust grid for potentially 2 columns */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }
}

/* Small screens (Phones) */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 15px;
    }
    header h1 {
        float: none; /* Stack title */
        text-align: center;
        margin-bottom: 10px;
    }
    header nav {
        float: none; /* Stack nav */
        text-align: center;
        margin-top: 0;
    }
    header ul {
        padding-left: 0; /* Remove default ul padding */
    }
    header li {
        padding: 0 10px; /* Further reduce nav spacing */
        font-size: 0.9em; /* Slightly smaller nav text */
    }
    /* Ensure clearfix doesn't interfere when stacked */
    header::after {
        display: none;
    }

    main {
        width: 100%; /* Full width */
        margin: 20px 0; /* Adjust margin */
        padding: 20px;
        border-radius: 0; /* Remove rounding on mobile */
        box-shadow: none; /* Remove shadow on mobile */
    }
    .hero {
        padding: 50px 10px;
        margin-bottom: 30px;
        border-radius: 0; /* Remove rounding */
    }
    .hero h2 {
        font-size: 2em;
    }
    .hero p {
        font-size: 1em;
    }
    .hero .button-primary {
        padding: 12px 25px;
        font-size: 1em;
    }

    .products {
        /* Force 1 or 2 columns */
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Adjust min size */
        gap: 15px;
    }
    .product-item {
        padding: 15px;
    }
    .product-item img {
        height: 150px; /* Adjust image height */
    }
    .product-item .price {
        font-size: 1.15em;
    }
    .product-item .button {
        padding: 7px 12px;
        font-size: 0.85em;
    }

    /* Adjust cart table font size if needed */
    table.cart th, table.cart td {
        padding: 8px;
        font-size: 0.9em;
    }
    table.cart input[type="number"] {
        width: 50px;
        padding: 4px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .products {
        /* Ensure single column */
        grid-template-columns: 1fr;
    }
     header li {
        padding: 0 8px; /* Even less space */
    }
}