/*
 * mhl-shell.css — MYHAUSLINE Modern Global Shell
 * Phase 1A: Modern platform navigation + layout standard
 * Version: 1.4.0 — Shop UI Polish Phase 1
 */

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Global Header ──────────────────────────────────────────────────────────── */
#mhl-global-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
}

.mhl-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ── Logo ───────────────────────────────────────────────────────────────────── */
.mhl-header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mhl-logo-link,
.mhl-header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mhl-logo-link img,
.mhl-header-logo img,
img.mhl-logo-img {
    height: 48px !important;
    width: auto !important;
    max-width: 180px !important;
    max-height: 48px !important;
    object-fit: contain;
    display: block;
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
nav.mhl-primary-nav,
.mhl-nav-wrap {
    flex: 1;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

nav.mhl-primary-nav ul,
.mhl-nav-wrap ul,
ul.mhl-nav-list,
ul#menu-hauptmenue {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex !important;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}

nav.mhl-primary-nav ul li,
.mhl-nav-wrap ul li,
ul.mhl-nav-list li,
ul#menu-hauptmenue li {
    margin: 0;
    padding: 0;
}

nav.mhl-primary-nav ul li a,
.mhl-nav-wrap ul li a,
ul.mhl-nav-list li a,
ul#menu-hauptmenue li a {
    display: block;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #333333;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

nav.mhl-primary-nav ul li a:hover,
.mhl-nav-wrap ul li a:hover,
ul.mhl-nav-list li a:hover,
ul#menu-hauptmenue li a:hover,
nav.mhl-primary-nav ul li.current-menu-item > a,
ul.mhl-nav-list li.current-menu-item > a,
ul#menu-hauptmenue li.current-menu-item > a {
    background: #f0f0f0;
    color: #000000;
}

/* ── Cart / Actions ─────────────────────────────────────────────────────────── */
.mhl-header-actions,
.mhl-cart-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mhl-cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.mhl-cart-link:hover {
    background: #f0f0f0;
    border-color: #cccccc;
    color: #000000;
}

.mhl-cart-count {
    background: #333333;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ── Mobile Toggle ──────────────────────────────────────────────────────────── */
.mhl-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 18px;
    color: #333333;
    flex-shrink: 0;
}

/* ── Modern Page Wrapper ────────────────────────────────────────────────────── */
#mhl-modern-page {
    min-height: calc(100vh - 64px);
}

.mhl-page-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* ── WooCommerce Container Override ────────────────────────────────────────── */
.woocommerce,
.woocommerce-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SHOP UI POLISH — Phase 1
   Scope: shop, category archive, product cards, sidebar, spacing
   Rules: no global reset, no Woo hook changes, scoped to shop/archive pages
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Shop Page Top Spacing ──────────────────────────────────────────────────── */
body.woocommerce .woocommerce,
body.woocommerce-page .woocommerce {
    padding-top: 32px;
    padding-bottom: 48px;
}

/* ── Shop Layout: Sidebar + Main Content ────────────────────────────────────── */
.mhl-shop-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
}

/* ── Sidebar Polish ─────────────────────────────────────────────────────────── */
.mhl-shop-sidebar {
    width: 240px !important;
    min-width: 220px;
    flex-shrink: 0;
    background: #f9f9f9;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    padding: 20px 16px;
    position: sticky;
    top: 80px;
}

.mhl-shop-sidebar .widget {
    margin-bottom: 24px;
}

.mhl-shop-sidebar .widget:last-child {
    margin-bottom: 0;
}

.mhl-shop-sidebar .widget-title,
.mhl-shop-sidebar h3,
.mhl-shop-sidebar h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888888;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.mhl-shop-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mhl-shop-sidebar ul li {
    margin: 0;
    padding: 0;
}

.mhl-shop-sidebar ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 13px;
    color: #444444;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

.mhl-shop-sidebar ul li a:hover,
.mhl-shop-sidebar ul li.current-cat > a {
    background: #eeeeee;
    color: #111111;
}

.mhl-shop-sidebar ul li.current-cat > a {
    font-weight: 600;
}

/* ── Category Cards Grid ────────────────────────────────────────────────────── */
.mhl-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mhl-cat-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.15s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mhl-cat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.mhl-cat-card .mhl-cat-icon {
    font-size: 28px;
    line-height: 1;
}

.mhl-cat-card .mhl-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    line-height: 1.3;
}

.mhl-cat-card .mhl-cat-count {
    font-size: 12px;
    color: #888888;
}

/* ── Product Grid ───────────────────────────────────────────────────────────── */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Product Card Polish ────────────────────────────────────────────────────── */
ul.products li.product {
    background: #ffffff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 10px !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: box-shadow 0.2s, transform 0.15s !important;
    overflow: hidden;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

ul.products li.product:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.09) !important;
    transform: translateY(-2px) !important;
}

ul.products li.product a img {
    width: 100% !important;
    height: 160px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    background: #f7f7f7 !important;
    display: block !important;
    margin-bottom: 12px !important;
}

ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #222222 !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
    flex: 1;
}

ul.products li.product .price {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111111 !important;
    margin: 0 0 12px !important;
}

ul.products li.product .price del {
    color: #aaaaaa !important;
    font-weight: 400 !important;
    font-size: 12px !important;
}

ul.products li.product .button,
ul.products li.product .add_to_cart_button {
    display: block !important;
    width: 100% !important;
    padding: 9px 12px !important;
    background: #222222 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-align: center !important;
    border-radius: 7px !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s !important;
    margin-top: auto !important;
}

ul.products li.product .button:hover,
ul.products li.product .add_to_cart_button:hover {
    background: #444444 !important;
}

/* ── Shop Toolbar (results count + sort) ────────────────────────────────────── */
.woocommerce-products-header {
    margin-bottom: 16px;
}

.woocommerce-result-count {
    font-size: 13px;
    color: #888888;
    margin: 0 0 8px;
}

.woocommerce-ordering select {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: #444444;
    background: #ffffff;
}

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.woocommerce-pagination {
    margin-top: 32px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: block;
    padding: 7px 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #444444;
    text-decoration: none;
    transition: background 0.12s;
}

.woocommerce-pagination ul li a:hover {
    background: #f0f0f0;
}

.woocommerce-pagination ul li span.current {
    background: #222222;
    color: #ffffff;
    border-color: #222222;
}

/* ── Shop Page Title ────────────────────────────────────────────────────────── */
h1.page-title,
h1.woocommerce-products-header__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111111 !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
}

/* ── Mobile Shop ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .mhl-mobile-toggle {
        display: block;
    }

    nav.mhl-primary-nav,
    .mhl-nav-wrap {
        display: none !important;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid #e0e0e0;
        padding: 12px 0;
        z-index: 9998;
        flex-direction: column;
        align-items: flex-start;
    }

    nav.mhl-primary-nav.mhl-nav-open,
    .mhl-nav-wrap.mhl-nav-open {
        display: flex !important;
    }

    nav.mhl-primary-nav ul,
    .mhl-nav-wrap ul,
    ul.mhl-nav-list,
    ul#menu-hauptmenue {
        flex-direction: column;
        gap: 0;
        padding: 0 16px;
        width: 100%;
    }

    nav.mhl-primary-nav ul li a,
    .mhl-nav-wrap ul li a,
    ul.mhl-nav-list li a,
    ul#menu-hauptmenue li a {
        padding: 12px 8px;
        font-size: 15px;
    }

    .mhl-header-inner {
        padding: 0 16px;
    }

    .mhl-logo-link img,
    .mhl-header-logo img,
    img.mhl-logo-img {
        height: 40px !important;
        max-height: 40px !important;
        max-width: 140px !important;
    }

    /* Mobile shop layout */
    .mhl-shop-layout {
        flex-direction: column;
        gap: 20px;
    }

    .mhl-shop-sidebar {
        width: 100% !important;
        min-width: unset;
        position: static;
    }

    .mhl-cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    ul.products li.product a img {
        height: 120px !important;
    }
}
