/*
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 (CLEAN + CONSOLIDATED)
   ============================================================ */

/* 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;
}

/* Logo */
.site-logo {
    height: 30px;
    width: auto;
    display: block;
    border: 2px solid var(--wp--preset--color--primary);
}

/* Navigation container */
.site-nav {
    position: relative;
}

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

.nav-menu > li {
    text-align: center;
}

/* Main menu link base styling */
.nav-menu a {
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    border-radius: 4px;
}

/* Submenu parent label base styling */
.submenu-label {
    color: var(--wp--preset--color--foreground);
    padding: 0.5rem 0.75rem; /* matches main menu */
    border-radius: 4px;      /* matches main menu */
    display: inline-block;   /* ensures padding behaves like a link */
    cursor: default;         /* keeps it feeling like a label, not a link */
}


/* Main menu hover */
.nav-menu > li > a:hover,
.nav-menu > li > a:active {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Hover highlight for submenu parent label */
.has-submenu .submenu-label:hover {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

/* ============================
   SUBMENU (keep behavior, de-dupe only)
   ============================ */

/* Parent item: keep text + arrow inline */
.has-submenu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Arrow button (unstyled) */
.submenu-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.submenu-toggle:hover,
.submenu-toggle:focus {
    background: none;
    outline: none;
}

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

/* Submenu links – merged both previous rules */
.submenu a {
    white-space: nowrap;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.15s ease;
}

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

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

/* JS toggle support (keep exactly as you had it) */
.has-submenu:hover .submenu.open {
    display: block;
}



/* ============================
   MOBILE NAVIGATION (unified)
   ============================ */

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

/* Mobile layout */
@media (max-width: 768px) {

    /* Show toggle button */
    .nav-toggle {
        display: block;
    }

    /* Mobile menu container */
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 1rem;
        background: var(--wp--preset--color--background);
        padding: 1rem;
        border: 2px solid var(--wp--preset--color--primary);
        position: absolute;
        top: 100%;
        right: 0;

        /* UPDATED */
        width: max-content;        /* expands to fit longest item */
        min-width: 220px;          /* keeps your original minimum */
        white-space: nowrap;       /* prevents text wrapping */

        z-index: 20;
    }

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

    /* Submenu parent stacks vertically */
    .has-submenu {
        display: block;
        align-items: flex-start;
    }

    /* Text + arrow stay inline */
    .has-submenu > a,
    .has-submenu > .submenu-toggle {
        display: inline-flex;
        align-items: center;

        /* UPDATED */
        white-space: nowrap;       /* prevents wrapping on submenu parents */
    }

    /* Submenu dropdown sits below parent */
    .submenu {
        position: static;
        border: none;
        padding-left: 1rem;
        margin-top: 0.5rem;
        display: none;

        /* UPDATED */
        white-space: nowrap;       /* prevents wrapping inside submenus */
    }

    .submenu.open {
        display: block;
    }

    /* Allow hover/tap to open submenu on mobile */
    .has-submenu:hover .submenu {
        display: block;
    }

}

/* ============================================================
   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;
    align-items: center;
    gap: 12px;
    background: #fafafa;
}

/* Thumbnail added for cart items */
.cart-thumb {
    width: 80px;
    height: auto;
    border-radius: 6px;
}

.cart-details {
    flex: 1;
}

.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: #01192f;
    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. 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;
}

/* ============================================================
   9. MOBILE CARD LAYOUT
   ============================================================ */

@media (max-width: 768px) {

    .results-row {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    /* Mobile gallery: 2 columns instead of 4 */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}


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

/* Updated compact, dark item block */
.item-block {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #000;
    color: #fff;
    font-size: 14px;
}

.item-block p {
    margin: 4px 0;
}

/* Quantity inline */
.item-block label {
    margin-right: 6px;
}

.item-block .qty-input {
    width: 50px;
    display: inline-block;
    margin-left: 4px;
}

/* Navy button matching floating cart */
.item-block button {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #01192f;
    color: #fff;
    border: none;
    cursor: pointer;
}

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

.item-title {
    font-weight: bold;
    margin-bottom: 6px;
    color: #fff;
}

.qty-row {
  display: flex;
  justify-content: center;   /* centers horizontally */
  align-items: center;       /* vertically aligns label + input */
  gap: 6px;                  /* optional spacing between label and input */
  margin: 10px 0;            /* optional spacing above/below */
}


/* 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 */
.slide {
  display: none;
}

.slide.active {
  display: block;
}

.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);
}
