﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal scrolling by default; specific elements may still enable overflow if needed */
html, body {
    overflow-x: hidden;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
}

body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
}

header {
    background-color: #333;
    padding: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header img {
    height: 50px;
    width: auto;
}

/* Force header images to identical square boxes on desktop with higher specificity
   so this rule wins over more generic selectors. Prevent flex shrinking too. */
header img.header-logo,
header img.header-goat {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

header nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

header nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

header nav ul li {
    margin: 0 15px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

main {
    padding: 2rem;
}

.landing .desc {
    text-align: center;
    margin-bottom: 2rem;
}

.landing .hero {
    text-align: center;
    margin-bottom: 2rem;
}

/* Hero images: side-by-side on wider screens, stack and scale on small screens */
.landing .hero img {
    display: inline-block;
    vertical-align: middle;
    max-width: 45%;
    width: auto;
    height: auto;
    margin: 0 0.5rem;
    /* Keep both hero images visually the same height on desktop while preserving aspect */
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
}

.landing .cta-button {
    background-color: #ff6347;
    padding: 10px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    border-radius: 5px;
}

.features {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
}

.feature {
    text-align: center;
    width: 30%;
}

/* Search container */
.search-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem auto 1rem;
    max-width: 600px;
    padding: 0 1rem;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #333;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-container input[type="text"]:focus {
    border-color: #ff6347;
}

.search-container input[type="text"]::placeholder {
    color: #999;
}

.products-page .categories {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.products-page .categories button {
    margin: 0 10px;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
}

.products-page .categories button:hover {
    background-color: #ff6347;
}

.products-page .categories button.active {
    background-color: #ff6347;
    outline: 3px solid rgba(255,99,71,0.15);
}

.products-page .categories button[data-filter="sale"] {
    background-color: #ff0000;
    color: #000;
}

.products-page .categories button[data-filter="sale"]:hover {
    background-color: #cc0000;
}

.products-page .categories button[data-filter="sale"].active {
    background-color: #ff0000;
    outline: 3px solid rgba(255,0,0,0.3);
}

/* Subcategories */
.subcategories {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subcategories button {
    margin: 0;
    padding: 8px 16px;
    background-color: #555;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
}

.subcategories button:hover {
    background-color: #ff6347;
}

.subcategories button.active {
    background-color: #ff6347;
    box-shadow: 0 0 0 2px rgba(255,99,71,0.3);
}

.product-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.product-list .product {
    background-color: #fff;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sold item styling */
.product-list .product.sold {
    background-color: #e8e8e8;
    opacity: 0.85;
}

.product-list .product img {
    width: 100%;
    border-radius: 5px;
}

/* Thumbnail styling: keep consistent aspect and clickable */
.product-list .product img.thumb {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 160px;
    height: auto;
    margin: 0 auto 10px;
    border-radius: 5px;
    cursor: pointer;
    object-fit: contain;
}


/* Lightbox overlay (explicit sizing for reliable centering) */
#lightbox-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; avoids 100vw/100vh overflow issues */
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 2147483647; /* very high to avoid stacking issues */
    max-width: 100%;
    overflow: hidden;
}
#lightbox-overlay.open {
    display: flex;
}
.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.lightbox-caption {
    margin-top: 8px;
    color: #fff;
    text-align: center;
}
.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #333;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background-color 0.2s ease;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}
.lightbox-close:hover {
    background-color: #f0f0f0;
}

.product-list .product h3 {
    margin-top: 10px;
}

.product-list .product .price {
    color: #333;
    font-weight: bold;
    margin: 8px 0 6px;
}

.product-list .product .original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.product-list .product .sale-price {
    color: #d32f2f;
    font-weight: bold;
}

.product-list .product .crossed-out {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.product-list .product .sold-label {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.1em;
}

.product-list .product .description {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.3;
    margin-bottom: 6px;
    min-height: 3.6em;
}

.product-list .product .product-id {
    font-size: 0.65rem;
    color: #090909;
    line-height: 1.3;
    margin-bottom: 6px;
    min-height: 3.6em;
}
.contact-us form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

/* Intro paragraph above contact form */
.contact-intro {
    text-align: center;
    margin: 0 auto 1rem;
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
    max-width: 720px;
}

.contact-us label {
    margin-top: 10px;
}

.contact-us input,
.contact-us textarea {
    padding: 10px;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.contact-us button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff6347;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #333;
    color: #fff;
}

/* small pig image in footer */
.footer-pig {
    height: 36px;
    width: auto;
    vertical-align: middle;
    margin-left: 10px;
    border-radius: 4px;
}

/* indicate clickable */
.footer-pig { cursor: pointer; }

/* About Us page styling */
.about-us {
    max-width: 900px;
    margin: 0 auto;
}

.about-us h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.about-us section {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.about-us h2 {
    color: #333;
    margin-bottom: 1rem;
}

/* About page hero image: centered and 25% of full size */
.about-hero-image {
    display: block;
    max-width: 25%;
    width: auto;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* ===== MOBILE RESPONSIVE MEDIA QUERIES ===== */

/* Tablets and smaller desktops (768px and below) */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    header {
        flex-wrap: wrap;
        padding: 0.75rem;
    }

    header img {
        height: 40px;
    }

    /* Tablet: scale the header icons down but keep them square and equal */
    .header-logo,
    .header-goat {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

    header nav {
        flex: 1 1 100%;
        order: 3;
    }

    header nav ul {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    /* prevent horizontal overflow on medium/small screens */
    html, body {
        overflow-x: hidden;
    }

    header nav ul li {
        margin: 0 4px;
        font-size: 0.9rem;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-list .product {
        padding: 15px;
    }

    .product-list .product img.thumb {
        max-height: 120px;
    }

    .search-container {
        padding: 0 0.75rem;
        margin: 1rem auto 0.75rem;
    }

    .search-container input[type="text"] {
        font-size: 15px;
        padding: 10px 15px;
    }

    .products-page .categories {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        justify-content: center;
    }

    .products-page .categories button {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .features {
        flex-direction: column;
    }

    .feature {
        width: 100%;
        margin-bottom: 1rem;
    }

    .about-hero-image {
        max-width: 50%;
    }

    /* Reduce hero image max-height for tablet so they scale nicely */
    .landing .hero img {
        max-height: 160px;
    }

    .lightbox-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .contact-us form {
        max-width: 100%;
    }

    footer {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }

    .footer-pig {
        height: 32px;
        margin-left: 8px;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }

    /* Prevent horizontal scrolling caused by elements slightly wider than viewport */
    html, body {
        overflow-x: hidden;
    }

    header {
        /* keep images side-by-side on mobile; place nav on its own row below */
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem;
        align-items: center;
        gap: 0.5rem;
    }

    header img {
        height: 35px;
        max-width: 90%;
    }

    /* Mobile: keep header logos visually matched but allow max-width behavior for very narrow screens */
    .header-logo,
    .header-goat {
        width: 35px;
        height: 35px;
        object-fit: contain;
        max-width: none;
    }

    /* Order images first so they appear side-by-side; place nav on full-width row below */
    header img.header-logo { order: 1; }
    header img.header-goat { order: 2; }
    header nav { order: 3; width: 100%; }

    header nav {
        width: 100%;
    }

    header nav ul {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    header nav ul li {
        margin: 0;
        font-size: 0.75rem;
    }

    header nav ul li a {
        padding: 0.35rem 0.5rem;
        display: inline-block;
    }

    .search-container {
        padding: 0 0.5rem;
        margin: 0.75rem auto 0.5rem;
        max-width: 100%;
    }

    .search-container input[type="text"] {
        font-size: 14px;
        padding: 10px 12px;
        border-width: 1px;
    }

    .product-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .product-list .product {
        padding: 10px;
    }

    .product-list .product h3 {
        font-size: 0.95rem;
        margin-top: 6px;
    }

    .product-list .product .price {
        font-size: 0.9rem;
        margin: 4px 0 3px;
    }

    .product-list .product .original-price {
        margin-right: 4px;
    }

    .product-list .product .description {
        font-size: 0.8rem;
        min-height: auto;
        margin-bottom: 3px;
        line-height: 1.3;
    }

    .product-list .product .product-id {
        font-size: 0.7rem;
    }

    .product-list .product img.thumb {
        max-height: 90px;
        margin: 0 auto 6px;
    }

    /* Two rows layout: flow by column so items fill top->bottom and form exactly two rows */
    /* 2-column responsive grid: buttons form equal-sized cells and wrap into additional rows as needed */
    .products-page .categories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        justify-items: stretch;
        align-items: stretch;
        grid-auto-rows: minmax(56px, auto);
        width: 100%;
    }

    .products-page .categories button {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.95rem;
        min-height: 56px;
        margin: 0;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        text-align: center;
        line-height: 1.15;
        box-sizing: border-box;
        min-width: 0;
    }

    /* If text still overflows, allow up to two lines and reduce font slightly */
    .products-page .categories button span {
        display: inline-block;
        max-height: 3.2em; /* ~2 lines */
        overflow: hidden;
    }

    /* Replace outline with inner box-shadow to avoid extra outside width */
    .products-page .categories button.active {
        outline: none;
        box-shadow: inset 0 0 0 2px rgba(255,99,71,0.08);
    }

    .lightbox-close {
        width: 34px;
        height: 34px;
        font-size: 18px;
        top: 3px;
        right: 3px;
    }

    .lightbox-content {
        max-width: calc(100% - 2rem);
        max-height: 98vh;
    }

    .lightbox-image {
        max-height: 85vh;
        max-width: calc(100% - 2rem);
    }

    .lightbox-video {
        max-width: calc(100% - 2rem) !important;
        max-height: 80vh !important;
    }

    center {
        padding: 0.5rem 0;
    }

    center h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    center p {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }

    .about-hero-image {
        max-width: 80%;
    }

    /* Mobile: make hero images stack and fill width with gutters */
    .landing .hero img {
        display: block;
        max-width: 90%;
        width: auto;
        height: auto;
        margin: 0.5rem auto;
        max-height: none; /* allow full height on mobile so images fill width proportionally */
    }

    .contact-us form {
        max-width: 100%;
    }

    .contact-us input,
    .contact-us textarea {
        font-size: 16px;
        padding: 10px;
    }

    .contact-us button {
        padding: 12px;
        font-size: 1rem;
        min-height: 46px;
        width: 100%;
    }

    footer {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .footer-pig {
        height: 24px;
        margin-left: 4px;
        margin-top: 0.25rem;
    }
}

/* Extra large screens (1200px and above) */
@media (min-width: 1200px) {
    .product-list {
        grid-template-columns: repeat(4, 1fr);
    }

    .about-hero-image {
        max-width: 20%;
    }
}

