/* ============================================================
   layout.css — global layout, reset, wrappers, header, nav,
                card grid, sidebar, footer, breakpoints
   ============================================================ */

/* ---- CUSTOM PROPERTIES ------------------------------------ */
:root {
    --fmo-black:        #1a1a1a;
    --fmo-dark:         #222222;
    --fmo-header-bg:    #2c2c2c;
    --fmo-nav-bg:       #3a3a3a;
    --fmo-white:        #ffffff;
    --fmo-off-white:    #f8f7f5;
    --fmo-light-gray:   #eeeeee;
    --fmo-mid-gray:     #888888;
    --fmo-border:       #dddddd;
    --fmo-gold:         #c9a84c;
    --fmo-gold-light:   #e8c878;
    --fmo-link:         #2a6496;
    --fmo-link-hover:   #1a4a72;
    --fmo-style-link:   #4a8a4a;
    --fmo-cat-link:     #2a6496;
    --fmo-font-sans:    'Georgia', 'Times New Roman', serif;
    --fmo-font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fmo-font-mono:    'Courier New', monospace;
    --fmo-max-width:    1100px;
    --fmo-content-pad:  20px;
    --fmo-gap:          20px;
    --fmo-gap-sm:       10px;
    --fmo-gap-lg:       40px;
    --fmo-shadow-sm:    0 1px 3px rgba(0,0,0,0.12);
    --fmo-shadow-md:    0 2px 8px rgba(0,0,0,0.15);
    --fmo-transition:   0.2s ease;
}

/* ---- RESET ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--fmo-font-ui);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--fmo-black);
    background: linear-gradient(to bottom, rgb(240,240,240) 0%, rgb(180,180,180) 80%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--fmo-link); text-decoration: none; transition: color var(--fmo-transition); }
a:hover { color: var(--fmo-link-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---- WRAPPERS --------------------------------------------- */
.fmo-outer {
    width: 100%;
    max-width: var(--fmo-max-width);
    margin: 0 auto;
    padding: 0 var(--fmo-content-pad);
}

/* ---- HEADER ----------------------------------------------- */

/* desktop — hide the mobile one */
.fmo-search-mobile { display: none; }

/* mobile — hide the nav search, show the header one */
@media (max-width: 800px) {
    .menu-search-input { display: none; }
    .fmo-search-mobile { display: block; }
}



#fmo-header {
    background: linear-gradient(to bottom, #888888 0%, #000000 100%);
    border-bottom: 2px solid var(--fmo-gold);
    position: relative;
    top: 0;
    z-index: 1000;
}

.fmo-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px var(--fmo-content-pad);
    max-width: var(--fmo-max-width);
    margin: 0 auto;
}

/*Logo*/
.fmo-logo-img {
    display: block;
    line-height: 0;
}
.fmo-logo-img img {
    display: block;
    height: 60px;
    width: auto;
    max-width: 415px;
}
#fmo-logo a { display: block; line-height: 1; }
#fmo-logo img { height: 46px; width: auto; }

#fmo-logo .fmo-logo-text {
    font-family: var(--fmo-font-sans);
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--fmo-white);
    letter-spacing: -0.5px;
}
#fmo-logo .fmo-logo-text span { color: var(--fmo-gold); }

.fmo-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.fmo-follow-label {
    color: var(--fmo-mid-gray);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fmo-social-icons { display: flex; gap: 8px; }

.fmo-social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--fmo-white);
    font-size: 0.75rem;
    transition: background var(--fmo-transition);
}
.fmo-social-icons a.twitter   { background: #1da1f2; }
.fmo-social-icons a.facebook  { background: #3b5998; }
.fmo-social-icons a.pinterest { background: #bd081c; }
.fmo-social-icons a:hover     { background: var(--fmo-gold); color: var(--fmo-white); }

/* NAV BAR */
#fmo-nav {
    background: linear-gradient(to bottom, #f2f2f2, #ededed);
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #dddddd;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.15);
    position: relative;
    z-index: 500;
}

.fmo-nav-inner {
    display: flex;
    align-items: center;
    max-width: var(--fmo-max-width);
    margin: 0 auto;
    padding: 0 var(--fmo-content-pad);
}

/* ---- TOP-LEVEL MENU LIST ---------------------------------- */
ul.fmo-nav-menu {
    display: inline-flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* ---- TOP-LEVEL ITEMS -------------------------------------- */
ul.fmo-nav-menu > li {
    position: relative;
    display: inline-block;
    margin: 0;
}

/* ---- TOP-LEVEL LINKS -------------------------------------- */
ul.fmo-nav-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #555555;
    font-family: 'trebuchet ms', geneva, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 6px;
    white-space: nowrap;
    text-decoration: none;
    text-transform: capitalize;
    border-right: 1px solid #e5e5e5;
    background-color: rgba(240,240,240,0.8);
    min-height: 26px;
    box-sizing: border-box;
}

ul.fmo-nav-menu > li:first-child > a {
    border-left: none;
}

ul.fmo-nav-menu > li > a:hover,
ul.fmo-nav-menu > li.current-menu-item > a {
    background-color: #999;
    color: #fff;
}

/* ---- ARROWS (CSS triangles) ------------------------------- */
/* L1 arrow: down triangle inline after text via flex */
ul.fmo-nav-menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 4px solid #555;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    margin-left: 4px;
}

ul.fmo-nav-menu > li.menu-item-has-children > a:hover::after {
    border-top-color: #fff;
}

/* L2 arrow: right triangle absolute right */
ul.fmo-nav-menu .sub-menu li.menu-item-has-children > a::after,
ul.fmo-nav-menu .children li.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid #555;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

ul.fmo-nav-menu .sub-menu li.menu-item-has-children > a:hover::after,
ul.fmo-nav-menu .children li.menu-item-has-children > a:hover::after {
    border-left-color: #fff;
}

/* ---- HIDE ALL SUBMENUS (off-screen) ----------------------- */
ul.fmo-nav-menu .sub-menu,
ul.fmo-nav-menu .children {
    position: absolute;
    left: -9999px;
    top: 100%;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 220px;
    background: transparent;
    z-index: 700;
    box-sizing: border-box;
}

/* ---- SHOW L2 ON L1 HOVER ---------------------------------- */
ul.fmo-nav-menu > li:hover > .sub-menu,
ul.fmo-nav-menu > li:hover > .children {
    left: 0;
    opacity: 1;
}

/* ---- L3: to the right of L2 ------------------------------ */
ul.fmo-nav-menu .sub-menu .sub-menu,
ul.fmo-nav-menu .children .children {
    top: 0;
    left: -9999px;
    z-index: 800;
}

ul.fmo-nav-menu .sub-menu li:hover > .sub-menu,
ul.fmo-nav-menu .children li:hover > .children {
    left: 100%;
    opacity: 1;
}

/* ---- L3 SUBMENU GRID LAYOUT (production nth-child system) - */
ul.fmo-nav-menu .sub-menu .sub-menu,
ul.fmo-nav-menu .children .children {
    display: grid;
    width: auto;
    min-width: 600px;
}

ul.fmo-nav-menu .sub-menu .sub-menu li,
ul.fmo-nav-menu .children .children li {
    display: block;
    width: 100%;
    height: auto;
}

ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+1),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+1) { grid-row-start: 1; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+2),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+2) { grid-row-start: 2; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+3),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+3) { grid-row-start: 3; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+4),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+4) { grid-row-start: 4; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+5),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+5) { grid-row-start: 5; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+6),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+6) { grid-row-start: 6; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+7),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+7) { grid-row-start: 7; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+8),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+8) { grid-row-start: 8; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n+9),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n+9) { grid-row-start: 9; }
ul.fmo-nav-menu .sub-menu .sub-menu .menu-item:nth-child(10n),
ul.fmo-nav-menu .children .children .menu-item:nth-child(10n)   { grid-row-start: 10; }

/* Remove background bleed from submenu containers */
ul.fmo-nav-menu .sub-menu,
ul.fmo-nav-menu .children { background: transparent; }



/* ---- L3 SUBMENU GRID LAYOUT ------------------------------ */
ul.fmo-nav-menu .sub-menu .sub-menu,
ul.fmo-nav-menu .children .children {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: auto;
    min-width: 600px;
}

ul.fmo-nav-menu .sub-menu .sub-menu li,
ul.fmo-nav-menu .children .children li {
    display: block;
    width: 100%;
}

/* ---- ALL ITEMS NEED position:relative --------------------- */
ul.fmo-nav-menu li {
    position: relative;
}

/* ---- SUB-MENU ITEMS --------------------------------------- */
ul.fmo-nav-menu .sub-menu li,
ul.fmo-nav-menu .children li {
    display: block;
    width: 100%;
}

/* ---- SUB-MENU LINKS (3D button style) --------------------- */
ul.fmo-nav-menu .sub-menu a,
ul.fmo-nav-menu .children a {
    display: block;
    position: relative;
    color: #656565;
    font-family: 'trebuchet ms', geneva, sans-serif;
    font-size: 12px;
    line-height: 1;
    height: 24px;
    padding: 4px 20px 4px 4px;
    margin: 2px;
    width: calc(100% - 4px);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: -webkit-linear-gradient(#fff, #eee);
    background: linear-gradient(to bottom, #fff, #eee);
    border: 1px solid #b7b7b7;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 1px 3px rgba(0,0,0,0.3);
    box-sizing: border-box;
    z-index: 10000;
}

ul.fmo-nav-menu .sub-menu a:hover,
ul.fmo-nav-menu .children a:hover {
    background: -webkit-linear-gradient(#ccc, #aaa);
    background: linear-gradient(to bottom, #ccc, #aaa);
    color: white;
    border: 1px solid #000;
}

ul.fmo-nav-menu .sub-menu a:active,
ul.fmo-nav-menu .children a:active {
    background: linear-gradient(to bottom, #eee, #ccc);
}

/* ---- SEARCH — right side of nav, aligned to max-width ----- */
.fmo-nav-search-desktop {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
}

.fmo-nav-search-desktop input[type="search"] {
    -webkit-appearance: textfield;
    box-sizing: border-box;
    width: 110px;
    height: 24px;
    border: 1px solid black;
    color: #666;
    font-size: 12px;
    font-family: 'trebuchet ms', geneva, sans-serif;
    padding: 5px;
    margin-right: 2px;
    border-radius: 1px;
}

.fmo-nav-search-desktop button[type="submit"] {
    height: 24px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    color: #555;
    font-size: 11px;
    font-family: 'trebuchet ms', geneva, sans-serif;
    padding: 0 8px;
    cursor: pointer;
    border-radius: 2px;
    line-height: 7px;
    white-space: nowrap;
}

.fmo-nav-search-desktop button[type="submit"]:hover {
    background: #ddd;
    color: #000;
}

/* Hide hamburger on desktop */
.fmo-mobile-menu-toggle {
    display: none !important;
}

/* Hide menu-search-input li on desktop (mobile only) */
@media (min-width: 801px) {
    li.menu-search-input { display: none !important; }
}


/* ---- MOBILE DRAWER ---------------------------------------- */
#fmo-mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--fmo-dark);
    z-index: 2000;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding: 20px 0;
}
#fmo-mobile-drawer.open { left: 0; }

.fmo-drawer-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 20px 16px;
    display: block;
}

.fmo-drawer-nav a {
    display: block;
    color: #ccc;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid #333;
    transition: color var(--fmo-transition), background var(--fmo-transition);
}
.fmo-drawer-nav a:hover { color: var(--fmo-white); background: rgba(255,255,255,0.05); }

.fmo-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}
.fmo-drawer-overlay.open { display: block; }

/* ---- MAIN CONTENT ----------------------------------------- */
#fmo-main { min-height: 60vh; padding: var(--fmo-gap) 0; }

/* ---- CARD GRID — 3 col desktop, 2 col mobile -------------- */
.fmo-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--fmo-gap);
    padding: var(--fmo-gap) 0;
}

.fmo-card {
    background: var(--fmo-white);
    border: 1px solid var(--fmo-border);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--fmo-shadow-sm);
    transition: box-shadow var(--fmo-transition), transform var(--fmo-transition);
}
.fmo-card:hover { box-shadow: var(--fmo-shadow-md); transform: translateY(-2px); }

.fmo-card-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--fmo-light-gray);
}
.fmo-card-image-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.fmo-card:hover .fmo-card-image-wrap img { transform: scale(1.03); }

.fmo-card-body { padding: 10px 12px; }

.fmo-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--fmo-black);
}

.fmo-card-price { font-size: 0.88rem; font-weight: 700; color: var(--fmo-black); }
.fmo-card-store { font-size: 0.75rem; color: var(--fmo-mid-gray); margin-top: 2px; }

.fmo-card-wishlist {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #999;
    transition: color var(--fmo-transition);
    z-index: 2;
}
.fmo-card-wishlist:hover { color: #e63946; }
.fmo-card-wishlist.active { color: #e63946; }

/* ---- SIDEBAR LAYOUT --------------------------------------- */
.fmo-layout-with-sidebar {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--fmo-gap-lg);
    align-items: start;
}

#fmo-sidebar { position: sticky; top: 80px; }

/* ---- FOOTER ----------------------------------------------- */
#fmo-footer {
    background: #c8c8c8;
    border-top: 1px solid var(--fmo-border);
    margin-top: var(--fmo-gap-lg);
}

.fmo-footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--fmo-gap-lg);
    max-width: var(--fmo-max-width);
    margin: 0 auto;
    padding: var(--fmo-gap-lg) var(--fmo-content-pad) var(--fmo-gap);
}

.fmo-footer-col h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fmo-black);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--fmo-black);
}

.fmo-footer-col ul li a {
    font-size: 0.82rem;
    color: var(--fmo-link);
    display: block;
    padding: 2px 0;
    border-bottom: 1px solid var(--fmo-light-gray);
    transition: color var(--fmo-transition);
}
.fmo-footer-col ul li a:hover { color: var(--fmo-link-hover); }

.fmo-footer-copyright {
    background: var(--fmo-nav-bg);
    color: #aaa;
    text-align: center;
    padding: 10px var(--fmo-content-pad);
    font-size: 0.75rem;
}

/* ---- REGION HEADING (shared) ------------------------------ */
.fmo-region-heading {
    background: var(--fmo-nav-bg);
    color: var(--fmo-white);
    text-align: center;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

/* ---- UTILITIES -------------------------------------------- */
.fmo-text-center { text-align: center; }
.fmo-mt-1  { margin-top: var(--fmo-gap-sm); }
.fmo-mt-2  { margin-top: var(--fmo-gap); }
.fmo-mb-1  { margin-bottom: var(--fmo-gap-sm); }
.fmo-mb-2  { margin-bottom: var(--fmo-gap); }
.fmo-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---- RESPONSIVE — 800px ----------------------------------- */
@media (max-width: 800px) {
    .fmo-nav-links  { display: none; }
    .fmo-nav-search { display: none; }
    .fmo-mobile-menu-toggle { display: block; }
    #fmo-mobile-drawer { display: block; }
    .fmo-nav-inner { justify-content: space-between; }

    .fmo-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fmo-layout-with-sidebar { grid-template-columns: 1fr; }
    #fmo-sidebar { position: static; }

    .fmo-footer-inner {
        grid-template-columns: 1fr;
        gap: var(--fmo-gap);
        padding: var(--fmo-gap) var(--fmo-content-pad);
    }
}