body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 3em clamp(1rem, 5vw, 10em);
    background-color: #fff;
}

header {
    background-color: #fff;
    color: #333;
    padding: 0;
    text-align: center;
    margin-bottom: 0; /* Remove margin to ensure no space between header and navigation */
}

header img {
    width: 100%;
    height: auto;
}

#content {
    width: 100%;
    box-sizing: border-box;
}

nav ul {
    list-style-type: none;
    padding: 0;
    background-color: #fff;
    color: #333;
    margin: 0; 
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly; /* Evenly space the items */
    align-items: stretch;          /* Makes list items stretch to fill container height */
}

nav ul li {
    flex: 1 1 120px;               /* Keeps navigation usable when it wraps on small screens */
    text-align: center;            /* Centers the text inside the full-width item */
    margin: 0;                     /* Remove margins so they touch or distribute cleanly */
}

nav ul li a {
    display: block;                
    width: 100%;
    height: 100%;
    color: #333;
    text-decoration: none;
    padding: 1em;                
    box-sizing: border-box;
    transition: background-color 0.2s ease; 
}

/* Explicitly target hover, active state, and the .active class */
nav ul li a:hover,
nav ul li a:active,
nav ul li a.active {
    background-color: #333 !important;
    color: #fff !important;
}

.nav-cart-icon {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
}

nav ul li a:hover .nav-cart-icon,
nav ul li a:active .nav-cart-icon,
nav ul li a.active .nav-cart-icon {
    filter: brightness(0) invert(1);
}

section {
    padding: 2em;
    background-color: #fff;
    margin: 20px 0;
}

.catalog {
    width: 100%;
    box-sizing: border-box;
    padding: 2rem 0 3rem;
    margin: 0;
}

.catalog-header {
    width: 100%;
    margin: 0 auto 1.5rem;
}

.catalog-header h2 {
    margin: 0 0 0.35rem;
    color: #333;
}

.catalog-header p {
    margin: 0;
    color: #666;
}

.product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    width: 100%;
    margin: 0 auto;
}

.product-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr auto;
    column-gap: 1.5rem;
    align-items: start;
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e2e2e2;
    background: #fff;
    text-align: left;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.product-carousel {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: relative;
    justify-self: center;
    align-self: start;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #fafafa;
}

.product-carousel .carousel-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.carousel-control {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #222;
    cursor: pointer;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    transform: translateY(-50%);
}

.carousel-control:hover {
    background: #fff;
}

.carousel-previous {
    left: 0.5rem;
}

.carousel-next {
    right: 0.5rem;
}

.carousel-counter {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.2rem 0.45rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
}

.product-card > img {
    grid-column: 1;
    grid-row: 1 / span 3;
    justify-self: center;
    align-self: start;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    background: #fafafa;
}

.product-info {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
}

.product-card h3 {
    margin: 0 0 0.5rem;
    color: #333;
    font-size: 1.05rem;
}

.product-card p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.product-sku {
    margin-bottom: 0.6rem !important;
    color: #777 !important;
    font-size: 0.8rem;
}

.product-description {
    margin-bottom: 0.75rem !important;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-bottom: 0.6rem;
    color: #555;
    font-size: 0.85rem;
}

.product-ingredients summary {
    color: #333;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

.product-ingredients p {
    margin-top: 0.45rem;
    font-size: 0.85rem;
}

.order-link {
    display: inline-block;
    flex: 1;
    min-width: 0;
    padding: 0.7rem 1rem;
    background: #333;
    color: #fff;
    text-align: center;
    text-decoration: none;
}

.order-link:hover {
    background: #555;
}

.product-actions {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
    align-self: end;
}

.product-cost {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: #333;
    font-weight: bold;
    text-align: center;
}

.cart-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: min(100%, 18rem);
}

.quantity-input {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.35rem;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font: inherit;
    text-align: center;
}

.add-to-cart {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.75rem;
    border: 0;
    background: #333;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.add-to-cart:hover {
    background: #555;
}

.add-to-cart.added {
    background: #287a44;
}

.empty-catalog {
    max-width: 1200px;
    margin: 0 auto;
    color: #666;
}

.cart-page {
    width: 100%;
    box-sizing: border-box;
    padding: 2rem 0 3rem;
}

.cart-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    color: #333;
}

.cart-table th,
.cart-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
    vertical-align: top;
}

.cart-table th {
    background: #f7f7f7;
}

.cart-table tfoot th,
.cart-table tfoot td {
    font-weight: bold;
}

.cart-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.decrease-cart,
.remove-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.decrease-cart {
    font-size: 1.2rem;
}

.remove-cart img {
    width: 1rem;
    height: 1rem;
}

.decrease-cart:hover,
.remove-cart:hover {
    background: #f1f1f1;
}

.cart-form {
    display: grid;
    gap: 0.55rem;
    max-width: 42rem;
    margin-top: 2rem;
}

.cart-form h3 {
    margin: 0 0 0.5rem;
}

.cart-form input,
.cart-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    border: 1px solid #ccc;
    font: inherit;
}

.cart-form textarea {
    resize: vertical;
}

.submit-cart {
    justify-self: start;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 0;
    background: #333;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.submit-cart:hover {
    background: #555;
}

.cart-status {
    min-height: 1.5em;
    margin: 0;
    color: #555;
}

.product {
    display: inline-block;
    margin: 20px;
    padding: 1em;
    border: 1px solid #ddd;
    text-align: center;
}

.product img {
    max-width: 100%;
    height: auto;
}

footer {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 1rem 3rem;
    width: 100%;
    box-sizing: border-box;
    padding: 1em;
    background-color: #fff;
    color: #333;
}

.contact {
    min-width: 0;
    text-align: left;
}

.socials {
    min-width: 0;
    text-align: left;
}

.footer-link-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.6rem 0;
}

.footer-link-row a,
.social-links a {
    color: #333;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #333;
    font-size: 1.1rem;
    line-height: 1;
}

.footer-icon[src$=".svg"] {
    color: #333;
    object-fit: contain;
}

.contact h3, .socials h3 {
    margin-bottom: 0.5em;
}

.socials ul {
    list-style-type: none;
    padding: 0;
}

.socials li {
    margin: 0.5em 0;
}

.socials a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.copyright {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1em 0;
    margin-top: 0; /* Remove margin to ensure no space between footer content and copyright */
}

.line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    margin: 5px 0; /* Adjust margin to change the thickness of the line */
}