/* General Body and Container */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 15px 15px 80px 15px; /* Added bottom padding */
    background-color: #fff;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Top Navigation Links (Privacy/About/Resources) */
.top-nav-links {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0;
    padding-top: 5px;
    font-size: 0; /* Collapses whitespace between inline-block elements */
}
.top-nav-links a.nav-link {
    display: inline-block; /* Allows spacing and vertical align */
    font-size: 0.9rem; /* Resets font size from parent */
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    margin: 0 5px;
    padding: 2px 0; /* Small vertical padding for click area */
    vertical-align: middle; /* Aligns links and separators */
}
.top-nav-links a.nav-link:hover {
    color: #005b8a;
    text-decoration: underline;
}
.top-nav-links span.link-separator {
    color: #aaa;
    font-size: 0.9rem; /* Match link font size */
    margin: 0 2px;
    display: inline-block; /* Allows vertical align */
    vertical-align: middle; /* Aligns with links */
}

/* Main Heading Area Wrapper */
.main-heading-area {
    text-align: center;
    margin-bottom: 20px; /* Space before share buttons */
}

/* Heading Styles */
h1 {
    color: #333;
    font-size: 2.5em; /* Main title size */
    font-weight: bold;
    word-spacing: 0.1em;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* Google Color Classes */
.g-blue { color: #4285F4; }
.g-red { color: #DB4437; }
.g-yellow { color: #F4B400; }
.g-green { color: #0F9D58; }

h1 span { display: inline-block; } /* Prevents awkward wrapping of letters */

/* Site Subtitle Style */
.site-subtitle {
    font-size: 1.1rem;
    color: #6c757d; /* Muted grey */
    margin-top: 5px; /* Space below h1 */
    font-weight: 400; /* Normal weight */
}

/* ==== NEW H2 Styles ==== */
h2 {
    font-size: 1.7em; /* Smaller than H1, larger than subtitle/body */
    color: #333; /* Consistent with H1 */
    font-weight: bold;
    text-align: center; /* Align with H1 and form */
    margin-top: 35px; /* Space above the H2 */
    margin-bottom: 20px; /* Space below the H2 (before form/results) */
    line-height: 1.3;
}
/* ==== END NEW H2 Styles ==== */

/* Social Share Button Styles */
.social-share-container {
    text-align: center;
    margin-bottom: 25px; /* Space before the next element (now potentially H2) */
    margin-top: 15px; /* Space after the subtitle */
}
.social-share-button {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    justify-content: center;
    vertical-align: top; /* Align buttons if they wrap */
    gap: 8px; /* Space between icon and text */
    padding: 10px 15px;
    margin: 5px 8px; /* Spacing around buttons */
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    transition: opacity 0.2s ease-in-out;
    border: none; /* Remove default button border */
    cursor: pointer;
    line-height: 1.2;
    min-height: 40px; /* Ensure consistent height */
    box-sizing: border-box; /* Include padding/border in width/height */
}
.social-share-button i { /* Font Awesome icon */
    font-size: 1.1em;
    line-height: 1; /* Prevent extra vertical space */
    width: 1.1em; /* Ensure consistent width */
    text-align: center; /* Center icon if width is larger */
}
.social-share-button img.share-icon-img { /* Bluesky image icon */
    height: 18px;
    width: 18px;
    vertical-align: middle; /* Better alignment for image */
}
.social-share-button:hover {
    opacity: 0.85; /* Slight fade on hover */
}
/* Specific Button Colors */
.twitter-button { background-color: #14171A; }
.facebook-button { background-color: #1877F2; }
.bluesky-button { background-color: #DC3545; } /* Red color */


/* Search Form Styles */
#zazzle-search-form {
    display: flex;
    flex-direction: column; /* Stack input and buttons vertically */
    align-items: center; /* Center items horizontally */
    margin-bottom: 20px; /* Space after the form */
}
#zazzle-search-input {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #ccc;
    background-color: #fff;
    border-radius: 25px; /* Rounded corners */
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 580px; /* Limit input width */
    margin-bottom: 20px; /* Space between input and buttons */
    transition: border-color 0.2s ease;
    -webkit-appearance: none; /* Remove default mobile styling */
    appearance: none;
    box-sizing: border-box; /* Include padding/border in width */
}
#zazzle-search-input:focus {
    border-color: #0073aa; /* Highlight on focus */
    outline: none;
}
#zazzle-search-input::placeholder {
    color: #888;
}
.buttons {
    display: flex;
    justify-content: center;
    gap: 12px; /* Space between buttons */
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}
#zazzle-search-form button {
    padding: 10px 20px;
    font-size: 0.9rem;
    background-color: #f8f9fa; /* Light grey background */
    color: #3c4043; /* Dark grey text */
    border: 1px solid #f8f9fa; /* Match background for seamless look */
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: bold;
    margin: 0; /* Remove default button margin */
}
#zazzle-search-form button:hover {
    border-color: #dadce0; /* Subtle border on hover */
    box-shadow: 0 1px 1px rgba(0,0,0,.1); /* Slight shadow */
    background-color: #f1f3f4; /* Slightly darker grey */
    color: #202124; /* Slightly darker text */
}
#zazzle-search-form button:focus {
    border-color: #4285f4; /* Blue border on focus (accessibility) */
    outline: none;
}

/* Loading/Error Messages */
#loading-message,
#error-message {
    text-align: center;
    font-size: 1rem;
    margin: 20px 0;
    font-weight: bold;
}
#loading-message {
    color: #0073aa; /* Consistent blue */
}
#error-message {
    color: #DB4437; /* Consistent red */
}

/* Results Area Styling */
#zazzle-results-container {
    margin-top: 20px; /* Space above results (after H2) */
    margin-bottom: 20px; /* Space below results */
    min-height: 100px; /* Ensure container has height even when empty */
}
#zazzle-results-container .result-summary {
    text-align:center;
    margin-bottom: 15px;
    font-style: italic;
    color: #555;
}
#zazzle-results-container .amazon-search-link { text-align: center; margin-top: 25px; margin-bottom: 10px;}
#zazzle-results-container .amazon-search-link a { display: inline-block; padding: 10px 20px; background-color: #FF9900; color: #111; text-decoration: none; border-radius: 5px; font-weight: bold; font-size: 0.95rem; border: 1px solid #a88734; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset; transition: background-color 0.2s ease;}
#zazzle-results-container .amazon-search-link a:hover { background-color: #f39100; border-color: #9c7e31;}
#zazzle-results-container .zazzle-more-link { text-align: center; margin-top: 0; margin-bottom: 20px;}
#zazzle-results-container .zazzle-more-link a { display: inline-block; padding: 10px 20px; background-color: #0073aa; color: #fff; text-decoration: none; border-radius: 5px; font-weight: bold; font-size: 0.95rem; transition: background-color 0.2s ease;}
#zazzle-results-container .zazzle-more-link a:hover { background-color: #005b8a;}
#zazzle-results-container .zazzle-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px;}
#zazzle-results-container .zazzle-product { text-align: center; border: 1px solid #dfe1e5; border-radius: 8px; padding: 15px; background-color: #fff; transition: box-shadow 0.2s ease; display: flex; flex-direction: column;}
#zazzle-results-container .zazzle-product:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1);}
#zazzle-results-container .zazzle-product a { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex-grow: 1;}
#zazzle-results-container .zazzle-product img { max-width: 100%; height: 200px; display: block; margin: 0 auto 12px auto; object-fit: contain;}
#zazzle-results-container .image-placeholder { height: 200px; background: #eee; display: flex; align-items: center; justify-content: center; color: #aaa; margin: 0 auto 12px auto; width: 100%; border-radius: 4px;}
#zazzle-results-container .zazzle-product p { margin-top: auto; font-size: 0.9rem; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; min-height: 3.8em; /* Approx 3 lines */ margin-bottom: 12px;}
#zazzle-results-container .zazzle-product .share-icons { margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f0f0;}
#zazzle-results-container .zazzle-product .share-icons a { margin: 0 5px; display: inline-block; }
#zazzle-results-container .zazzle-product .share-icons img { vertical-align: middle; width: 20px; height: 20px; opacity: 0.7; transition: opacity 0.2s ease;}
#zazzle-results-container .zazzle-product .share-icons a:hover img { opacity: 1.0; }


/* ==== NEW FOOTER Styles ==== */
footer {
    text-align: center; /* Center the links and separator */
    margin-top: 40px; /* Space above the footer */
    padding-top: 20px; /* Space between border and links */
    border-top: 1px solid #eee; /* Subtle line separator above footer */
    font-size: 0; /* Collapse whitespace between inline-block elements */
}

footer a.footer-link { /* Targeting links specifically */
    display: inline-block; /* Needed for vertical-align & spacing with font-size:0 */
    font-size: 0.9rem; /* Reset font size (same as top nav) */
    color: #0073aa; /* Same color as top nav links */
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    margin: 0 5px; /* Horizontal spacing */
    vertical-align: middle; /* Align nicely with separator */
}

footer a.footer-link:hover {
    color: #005b8a; /* Darker blue on hover */
    text-decoration: underline;
}

/* Re-use the existing link-separator style */
/* This targets both top nav and footer */
.link-separator {
    color: #aaa;
    font-size: 0.9rem; /* Set default size */
    margin: 0 2px;
    display: inline-block; /* Needed with font-size: 0 */
    vertical-align: middle; /* Align with links */
}
/* We need to reset font-size specifically for footer separator */
/* because parent footer has font-size: 0 */
footer span.link-separator {
     font-size: 0.9rem; /* Ensure it has size */
}
/* ==== END FOOTER Styles ==== */


/* Scroll-to-Top Button */
#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 15px;
    /* Center horizontally */
    left: 50%;
    transform: translateX(-50%);
    z-index: 999; /* Ensure it's above other content */
    border: none;
    outline: none;
    background-color: rgba(0, 115, 170, 0.7); /* Semi-transparent blue */
    color: white;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 50%; /* Make it circular */
    font-size: 18px;
    line-height: 1; /* Ensure icon is centered vertically */
    /* Transition for smooth fade-in/out */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background-color 0.2s ease;
    pointer-events: none; /* Initially not clickable */
}
#scrollToTopBtn.show {
    display: inline-block; /* Make it visible */
    visibility: visible;
    opacity: 1;
    pointer-events: auto; /* Make it clickable when shown */
}
#scrollToTopBtn:hover {
    background-color: rgba(0, 91, 138, 0.9); /* Darker blue on hover */
}

/* Media Queries */
@media (max-width: 768px) {
    h1 { font-size: 2em; }
    h2 { /* Adjust H2 size */
        font-size: 1.5em;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    .site-subtitle { font-size: 1rem; }
    #zazzle-search-input { max-width: 90%; }
    #scrollToTopBtn { bottom: 12px; padding: 8px 10px; font-size: 16px; }
    .top-nav-links { margin-bottom: 10px; }
    .top-nav-links a.nav-link { font-size: 0.85rem; margin: 0 3px;}
    /* Adjust separator size for top nav */
    .top-nav-links span.link-separator { font-size: 0.85rem; margin: 0 1px;}
    /* Adjust separator size for footer (match footer link size) */
     footer span.link-separator { font-size: 0.9rem; } /* Keeps it consistent with footer link size */

}

@media (max-width: 480px) {
    body { padding-bottom: 70px; } /* Ensure space for scroll button */
    h1 { font-size: 1.8em; margin-bottom: 5px;}
     h2 { /* Adjust H2 size */
        font-size: 1.3em;
        margin-top: 25px;
        margin-bottom: 15px;
    }
    .site-subtitle { font-size: 0.95rem; margin-top: 2px; margin-bottom: 15px;}
    .social-share-button { font-size: 0.9rem; padding: 8px 12px; gap: 5px; margin: 3px;}
    .social-share-button img.share-icon-img { height: 16px; width: 16px; }
    .social-share-container { margin-bottom: 20px; margin-top: 10px; } /* Reduced top margin */
    #zazzle-search-form { align-items: stretch; } /* Stretch items */
    #zazzle-search-input { max-width: 100%; margin-bottom: 15px;}
    .buttons { gap: 10px; }
    #zazzle-search-form button { padding: 8px 15px; font-size: 0.9rem; }
    .top-nav-links { margin-top: 0; margin-bottom: 10px; }
    /* Adjust top nav link and separator size */
    .top-nav-links a.nav-link,
    .top-nav-links span.link-separator {
        font-size: 0.8rem;
        margin: 0 2px;
    }
    .top-nav-links span.link-separator { margin: 0 1px; }

    /* Footer adjustments */
    footer {
        margin-top: 30px;
        padding-top: 15px;
    }
    footer a.footer-link,
    footer span.link-separator {
        font-size: 0.85rem; /* Slightly smaller on very small screens */
    }

    /* Result Adjustments for small screens */
    #zazzle-results-container .zazzle-product p {
        font-size: 0.8rem;
        min-height: 3.2em; /* Approx 2-3 lines */
        -webkit-line-clamp: 2; /* Limit to 2 lines */
    }
    #zazzle-results-container .zazzle-product .share-icons img { width: 18px; height: 18px; }
    #zazzle-results-container .amazon-search-link a,
    #zazzle-results-container .zazzle-more-link a { padding: 8px 15px; font-size: 0.9rem; }
    #scrollToTopBtn { bottom: 10px; padding: 7px 9px; font-size: 15px; }
    #zazzle-results-container .zazzle-results {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller min width */
        gap: 12px;
    }
     #zazzle-results-container .zazzle-product img,
     #zazzle-results-container .image-placeholder {
        height: 150px; /* Smaller image height */
    }
}