/*
Theme Name: Pixl
Theme URI: https://wordpress.com/theme/pixl/
Author: Automattic
Author URI: https://automattic.com/
Description: Pixl is a simple yet opinionated blogging theme inspired by websites of the nineties.
Requires at least: 6.0
Tested up to: 6.0
Requires PHP: 5.7
Version: 1.0.8
License: GNU General Public License v2 or later
License URI: https://raw.githubusercontent.com/Automattic/themes/trunk/LICENSE
Template:
Text Domain: pixl
Tags: custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, one-column, rtl-language-support, theme-options, threaded-comments, translation-ready, wide-blocks, style-variations
*/

/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */

:root {
    --wp--preset--color--primary: #000000;
    --wp--preset--color--foreground: #000000;
    --wp--preset--color--background: #7bdcb5;

    --wp--preset--spacing--20: 1rem;
    --wp--preset--spacing--30: 1.5rem;
    --wp--preset--spacing--40: 2rem;

    --wp--custom--shadow: 4px 4px 0 var(--wp--preset--color--primary);
}


/* ============================================================
   2. GLOBAL BASE STYLES
   ============================================================ */

body {
    background: var(--wp--preset--color--background);
}

html, body {
    font-family: "Courier New", Courier, "IBM Plex Mono", "Source Code Pro", monospace;
    font-size: 16px;
    line-height: 1.5;
}

a:where(:not(.wp-element-button)) {
    text-underline-offset: .3em;
}

.pixl-shadow {
    box-shadow: var(--wp--custom--shadow);
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
    text-align: left;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title,
.site-title,
.site-title a {
    font-family: inherit;
    font-weight: bold;
}

h1, .entry-title, .page-title { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 1rem; }


/* ============================================================
   4. FORMS
   ============================================================ */

:is(textarea, input:not([type="submit"])) {
    color: var(--wp--preset--color--foreground);
    background-color: var(--wp--preset--color--background);
    border: 2px solid var(--wp--preset--color--primary) !important;
    outline: none;
    font-size: 0.875rem;
    font-family: inherit;
}

:is(textarea, input:not([type="submit"]))::placeholder {
    color: var(--wp--preset--color--foreground);
    font-weight: 300;
}

input[type="checkbox"] {
    appearance: none;
    min-width: 0.75rem;
    height: 0.75rem;
    position: relative;
}

input[type="checkbox"]:checked::after {
    background-color: var(--wp--preset--color--foreground);
    content: "";
    position: absolute;
    width: 75%;
    height: 75%;
    inset: 0;
    margin: auto;
}


/* ============================================================
   5. NAVIGATION & HEADER
   ============================================================ */

.site-header {
    background: var(--wp--preset--color--background);
    padding: 0.25rem;
    border: 2px solid var(--wp--preset--color--primary);
    box-shadow: var(--wp--custom--shadow);
}

.site-header-inner {
    padding: 0.1rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    height: 30px;
    border: 2px solid var(--wp--preset--color--primary);
}

.site-nav { position: relative; }

.nav-menu {
    display: flex;
    gap: var(--wp--preset--spacing--30);
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.nav-menu a,
.submenu-label {
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.nav-menu a:hover,
.submenu-label:hover {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
    transition: 0.15s ease;
}

/* Submenu container */
.has-submenu {
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

/* Toggle button */
.submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

/* Submenu panel (desktop) */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    border: 2px solid var(--wp--preset--color--primary);
    background: var(--wp--preset--color--background);
    padding: var(--wp--preset--spacing--20);
    list-style: none;
    width: max-content;
    z-index: 999;
}

/* Submenu links */
.submenu a {
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
}

.submenu a:hover {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
}

/* Desktop hover */
.has-submenu:hover > .submenu {
    display: block;
}

/* JS toggle */
.submenu.open {
    display: block;
}

/* Space between the two dropdowns */
.has-submenu .submenu + .submenu {
    margin-top: 10px;
}

/* MOBILE NAVIGATION */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--wp--preset--color--primary);
    padding: 0.25rem 0.5rem;
}

@media (max-width: 768px) {

    .nav-toggle { display: block; }

    .nav-menu {
        display: none;
        flex-direction: column;
        background: var(--wp--preset--color--background);
        padding: 1rem;
        border: 2px solid var(--wp--preset--color--primary);
        position: absolute;
        top: 100%;
        right: 0;
        width: 220px;
        z-index: 1000;
    }

    .nav-menu.open { display: flex; }

    /* Mobile submenu behavior */
    .submenu {
        position: static;
        border: none;
        padding-left: 1rem;
        margin-top: 0;
        width: 100%;
    }

    .submenu.open { display: block; }

    /* Disable hover on mobile */
    .has-submenu:hover .submenu { display: none; }
}


/* ============================================================
   6. COMPONENTS (FILTERS)
   ============================================================ */

select {
    font-family: inherit;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
    border: 2px solid black;
    border-radius: 8px;
    background: #f7f7f7;
    box-shadow: 4px 4px 0px black;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

select:hover {
    background: #eaeaea;
    box-shadow: 6px 6px 0px black;
    transform: translate(-2px, -2px);
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto;
}

.filter-container select {
    min-width: 120px;
    max-width: 160px;
    height: 40px;
    font-size: 0.7rem;
}

@media (max-width: 500px) {
    .filter-container { flex-wrap: wrap; }
    .filter-container select {
        flex: 1 1 45%;
        font-size: 0.75rem;
    }
}

/* FOOTER */
.site-footer {
    text-align: center;
}

.footer-inner {
    max-width: 900px;   /* optional: keeps it nicely contained */
    margin: 0 auto;     /* centers the footer block itself */
    padding: 1.5rem 1rem;
}



/* ============================================================
   7. CART SYSTEM
   ============================================================ */

.cart-container {
    padding: 20px;
    max-width: 700px;
    margin: auto;
}

.cart-item {
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    background: #fafafa;
}

.cart-remove {
    background: #d9534f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
}

.cart-remove:hover { background: #c9302c; }

.floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0275d8;
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 9999;
}

.floating-cart:hover { background: #025aa5; }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d9534f;
    color: white;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 50%;
}


/* ============================================================
   8. MOBILE CARD LAYOUT
   ============================================================ */

@media (max-width: 600px) {
    .results-row {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
    }
}


/* ============================================================
   9. PHOTO GALLERY (MERGED + CLEANED)
   ============================================================ */

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 2rem;
}

.photo-card { text-align: center; }

.photo-card img {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
}

.caption {
    margin-top: 8px;
    font-size: 14px;
    color: #444;
}

/* Add-to-cart block (shared with item pages) */
.item-block {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.item-block button {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    background: #0275d8;
    color: #fff;
    border: none;
    cursor: pointer;
}

.item-block button:hover { background: #025aa5; }

/* Load more */
#loadMore {
    display: block;
    margin: 30px auto;
    padding: 12px 20px;
    background: #0078ff;
    color: white;
    border-radius: 6px;
    border: none;
}

#loadMore:hover { background: #005fcc; }

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    color: #fff;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    cursor: pointer;
}


/* ============================================================
   10. PAGE-SPECIFIC STYLES
   ============================================================ */

.home,
.about-photo {
    display: flex;
    justify-content: center;
    margin: 0 auto 2rem;
}

.home img,
.about-photo img {
    border: 2px solid black;
    box-shadow: 6px 6px 0px black;
    width: 100%;
    object-fit: cover;
}

.about-heading,
.home-heading {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 1rem;
}


/* ============================================================
   11. ITEM PAGE TEMPLATE STYLES (NEW)
   ============================================================ */

/* Image slider wrapper */
.item-image-wrapper {
    max-width: 500px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.item-image-wrapper img {
    width: 100%;
    border-radius: 6px;
    display: none;
}

.item-image-wrapper img.active {
    display: block;
}

/* Slider buttons */
.slider-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.slider-controls button {
    padding: 6px 12px;
    border: none;
    background: #0275d8;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.slider-controls button:hover {
    background: #025aa5;
}

/* Item details */
.item-details {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.item-details h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.item-details h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.item-description {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}



/* ============================================================
   12. WORDPRESS LEGACY STYLES
   ============================================================ */

.wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__submenu-container {
    padding: 0.25rem 0;
}

.wp-block-navigation__submenu-container {
    background-color: var(--wp--preset--color--background);
    border-color: var(--wp--preset--color--primary);
}

.wp-block-search :is(textarea, input:not([type="submit"])) {
    box-shadow: var(--wp--custom--shadow);
}
