/* ---- Sticky Wrapper ---- */
.pg-sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--pg-white);
}
.admin-bar .pg-sticky-wrapper { top: 32px; }

/* ---- Main Header ---- */
.pg-header {
    position: relative;
    z-index: 10;
    background: var(--pg-white);
    border-bottom: 1px solid var(--pg-border-subtle);
    transition: box-shadow 0.3s ease;
}
.pg-header.scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pg-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* ---- Logo ---- */
.pg-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.pg-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.pg-logo-img {
    height: 30px;
    width: auto;
    max-width: none;
}
.pg-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--pg-dark);
    letter-spacing: -0.01em;
}
.pg-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.pg-mobile-toggle:hover { background: var(--pg-light-grey); }

/* ---- Navigation ---- */
.pg-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    height: 100%;
}
.pg-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: 4px;
}
.pg-nav-item {
    display: flex;
    align-items: center;
    height: 100%;
}
.pg-nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pg-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
    border-bottom: 2px solid transparent;
}
.pg-nav-item > a:hover { opacity: 0.7; }
.pg-nav-item.active > a {
    border-bottom-color: var(--pg-galaxy);
    opacity: 1;
}
.pg-nav-chevron {
    transition: transform 0.2s;
    margin-top: 1px;
}
.pg-nav-item.active .pg-nav-chevron {
    transform: rotate(180deg);
}

/* ---- Header Icons ---- */
.pg-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.pg-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    padding: 4px;
    position: relative;
    color: var(--pg-dark);
    text-decoration: none;
    transition: background 0.2s;
}
button.pg-icon-btn {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
}
.pg-icon-btn:hover { background: var(--pg-light-grey); }
.pg-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--pg-galaxy);
    color: var(--pg-white);
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ---- Account Logged-In Indicator ---- */
.pg-account-dot {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--pg-success);
    border: 2px solid var(--pg-white);
    pointer-events: none;
    box-shadow: 0 0 0 1px var(--pg-success);
}

/* ---- Header Locale ---- */
.pg-header-locale {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--pg-grey-light);
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--pg-border-light);
}
.pg-locale-sep {
    color: var(--pg-border-medium);
}

/* Search bar moved to search.css (full-screen overlay) */

/* ---- Mega Menu ---- */
.pg-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pg-white);
    border-top: 1px solid var(--pg-border-subtle);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
    max-height: 50vh;
    display: none;
    overflow-x: hidden;
}
.pg-mega.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    display: block;
}
/* Scroll indicator arrow */
.pg-mega-scroll-hint {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 4px 0;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 40%);
}
.pg-mega-scroll-hint.pg-visible {
    opacity: 1;
}
.pg-mega-scroll-hint svg {
    width: 20px;
    height: 20px;
    color: var(--pg-grey-light);
    animation: pgBounceDown 1.5s ease-in-out infinite;
}
@keyframes pgBounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}
.pg-mega-inner {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px;
    width: 100%;
    overflow: hidden;
    max-height: 50vh;
}

/* Mega Sidebar */
.pg-mega-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--pg-border-subtle);
    padding-right: 24px;
    margin-right: 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    max-height: calc(50vh - 48px);
    scrollbar-width: none;
}
.pg-mega-sidebar::-webkit-scrollbar {
    display: none;
}
.pg-mega-sidebar-group-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--pg-grey-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 14px 8px 14px;
    margin-top: 8px;
}
.pg-mega-sidebar-group-header:first-of-type {
    margin-top: 0;
}
.pg-mega-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--pg-grey);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
.pg-mega-sidebar-item:hover,
.pg-mega-sidebar-item.active {
    background: var(--pg-light-grey);
    color: var(--pg-dark);
    font-weight: 600;
}

/* Mega Sidebar Arrow */
.pg-sidebar-arrow {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s;
}
.pg-mega-sidebar-item:hover .pg-sidebar-arrow,
.pg-mega-sidebar-item.active .pg-sidebar-arrow {
    opacity: 1;
}

/* Mega Content */
.pg-mega-content {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    max-height: calc(50vh - 48px);
    scrollbar-width: none;
}
.pg-mega-content::-webkit-scrollbar {
    display: none;
}


/* Panel switching */
.pg-mega-panel-content {
    display: none;
    animation: pgFadeIn 0.25s ease;
}
.pg-mega-panel-content.active {
    display: block;
}
@keyframes pgFadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Panel title */
.pg-mega-panel-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--pg-dark);
}

/* Mega Grid */
.pg-mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Non-featured panels: 5 columns with smaller cards */
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-card-img {
    border-radius: 0;
}
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-card-label {
    font-size: 11px;
    padding: 4px 2px 0;
}
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-card-price {
    font-size: 11px;
    padding: 2px 2px 0;
}
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-panel-title {
    font-size: 14px;
    margin-bottom: 10px;
}
.pg-mega-panel-content:not([data-panel-cat="__featured__"]):not([data-panel-cat="__all__"]) .pg-mega-viewall {
    margin-top: 8px;
    font-size: 12px;
    padding: 6px 12px;
}

.pg-mega-card {
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    transition: transform 0.2s;
}
.pg-mega-card:hover {
    transform: translateY(-4px);
}
.pg-mega-card-img {
    aspect-ratio: 1;
    background: var(--pg-bg-page);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-mega-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pg-mega-card-placeholder {
    font-size: 20px;
    font-weight: 700;
    color: var(--pg-grey-light);
    text-transform: uppercase;
}
.pg-mega-card-label {
    display: block;
    text-align: center;
    padding: 6px 4px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--pg-dark);
}

/* Product card price */
.pg-mega-card-price {
    display: block;
    text-align: center;
    padding: 2px 4px 0;
    font-size: 12px;
    color: var(--pg-grey);
}
.pg-mega-card-price del {
    color: var(--pg-grey-light);
    font-size: 11px;
}
.pg-mega-card-price ins {
    text-decoration: none;
    color: var(--pg-price);
    font-weight: 600;
}

/* "Voir tous" link */
.pg-mega-viewall {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-dark);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--pg-border);
    border-radius: 8px;
    transition: all 0.2s;
}
.pg-mega-viewall:hover {
    background: var(--pg-dark);
    color: var(--pg-white);
    border-color: var(--pg-dark);
}

/* Empty state */
.pg-mega-empty {
    color: var(--pg-grey-light);
    font-size: 14px;
    padding: 20px 0;
}

/* ---- Mobile Menu ---- */
/* Strategy: `all: unset` on each interactive element strips ALL inherited
   theme styles. Properties after `all: unset` in the same rule override it,
   giving us total control with zero specificity fights. */

.pg-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pg-white);
    z-index: 998;
    flex-direction: column;
    overflow: hidden;
    color: var(--pg-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.pg-mobile-menu.active {
    display: flex;
}

/* Header */
.pg-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--pg-border-light);
}
.pg-mobile-menu-header .pg-logo {
    all: unset;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.pg-mobile-menu-header .pg-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--pg-dark);
}

/* Close button */
.pg-mobile-close {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--pg-dark);
    border-radius: 50%;
    transition: background 0.2s;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-close:active {
    background: var(--pg-light-grey);
}

/* Body */
.pg-mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Accordion header (split: link + toggle) */
.pg-mobile-accordion-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--pg-border-light);
}

.pg-mobile-accordion-link {
    all: unset;
    padding: 20px 2em 20px 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--pg-dark);
    cursor: pointer;
    text-decoration: none;
}

.pg-mobile-accordion-link:active {
    color: var(--pg-galaxy);
}

.pg-mobile-accordion-toggle {
    all: unset;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 60px;
    padding-right: 24px;
    cursor: pointer;
    color: var(--pg-dark);
}

.pg-mobile-accordion-toggle:active {
    background: var(--pg-light-grey);
}

/* Chevron animation */
.pg-mobile-accordion-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--pg-dark);
}
.pg-mobile-accordion.expanded .pg-mobile-accordion-chevron {
    transform: rotate(180deg);
}

/* Accordion panel — smooth animation via max-height */
.pg-mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accordion inner content */
.pg-mobile-accordion-inner {
    background: var(--pg-light-grey);
    padding: 0 0 8px;
}

/* --- Subcategory accordion (nested inside main accordion) --- */
.pg-mobile-subcat-accordion {
    border-bottom: 1px solid var(--pg-border-light);
}
.pg-mobile-subcat-accordion:last-child {
    border-bottom: none;
}
.pg-mobile-subcat-header {
    display: flex;
    align-items: center;
}
.pg-mobile-subcat-link {
    all: unset;
    padding: 14px 2em 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pg-text);
    cursor: pointer;
    text-decoration: none;
}

.pg-mobile-subcat-link:active {
    color: var(--pg-galaxy);
}

.pg-mobile-subcat-toggle {
    all: unset;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 44px;
    padding-right: 16px;
    cursor: pointer;
    color: var(--pg-grey-medium);
}

.pg-mobile-subcat-toggle:active {
    background: var(--pg-light-grey);
}
.pg-mobile-subcat-chevron {
    transition: transform 0.3s ease;
    color: var(--pg-grey-medium);
    flex-shrink: 0;
}
.pg-mobile-subcat-accordion.expanded .pg-mobile-subcat-chevron {
    transform: rotate(180deg);
}
.pg-mobile-subcat-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Horizontal product scroll (Bambu Lab style) */
.pg-mobile-products-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 24px 4px 48px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pg-mobile-products-scroll::-webkit-scrollbar {
    display: none;
}

/* Product card */
.pg-mobile-product-card {
    all: unset;
    flex-shrink: 0;
    width: 90px;
    color: var(--pg-dark);
    background: var(--pg-white);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-product-img {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pg-bg-page);
    overflow: hidden;
}
.pg-mobile-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pg-mobile-product-placeholder {
    font-size: 14px;
    font-weight: 700;
    color: var(--pg-grey-light);
    text-transform: uppercase;
}
.pg-mobile-product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--pg-dark);
    text-align: center;
    line-height: 1.3;
}

/* "Plus >" card (Bambulab style — same size as product cards) */
.pg-mobile-product-more {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 90px;
    background: var(--pg-light-grey);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.2s;
}
.pg-mobile-product-more:active {
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}
.pg-mobile-product-more span {
    font-size: 14px;
    font-weight: 700;
    color: var(--pg-dark);
    white-space: nowrap;
}


/* Direct link (non-accordion items like Montage, Avis) */
.pg-mobile-direct-link {
    all: unset;
    display: block;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--pg-dark);
    border-bottom: 1px solid var(--pg-border-light);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-direct-link:active {
    background: var(--pg-light-grey);
}

/* ---- Backdrop ---- */
.pg-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 997;
}
.pg-backdrop.active { display: block; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .pg-nav { display: none; }
    .pg-mobile-toggle { display: flex; }
    .pg-header-inner { gap: 16px; }
}
@media (max-width: 782px) {
    .admin-bar .pg-sticky-wrapper { top: 46px; }
}
@media (max-width: 480px) {
    .pg-header-locale { display: none; }
    .pg-logo-text { font-size: 16px; }
    .pg-header-inner { padding: 0 16px; }
}

/* Logo size enforcement */
img.pg-logo-img,
.pg-logo img,
.pg-header img.pg-logo-img {
    height: 30px;
    width: auto;
    max-width: none;
    max-height: 30px;
}

/* === MONTAGE DISPLAY IN MINI-CART (woocommerce_cart_item_name filter) === */
.pg-montage-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--pg-dark);
}

.pg-montage-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pg-montage-item-line {
    font-size: 13px;
    color: var(--pg-grey);
    line-height: 1.4;
}

.pg-montage-item-label {
    font-weight: 600;
    color: var(--pg-grey-medium);
}

.pg-montage-item-price {
    color: var(--pg-grey-light);
}

.pg-montage-msg {
    margin-top: 8px;
    font-size: 12px;
    color: var(--pg-grey-medium);
    font-style: italic;
    padding: 6px 10px;
    background: var(--pg-bg-light);
    border-radius: 6px;
}
