/* ---- Mobile Menu ---- */
/* Isolated mobile navigation styles. Interactive elements use all: unset to
   avoid parent theme button/link leakage. */

.pg-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10002;
    flex-direction: column;
    overflow: hidden;
    background: var(--pg-white);
    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 {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    flex-shrink: 0;
    padding: 0 24px;
    background: var(--pg-white);
    border-bottom: 1px solid #D9D9D9;
}
.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: 44px;
    height: 44px;
    border-radius: 50%;
    box-sizing: border-box;
    color: var(--pg-dark);
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-close:active {
    background: var(--pg-light-grey);
}

/* Body */
.pg-mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--pg-white);
    -webkit-overflow-scrolling: touch;
}

/* Top-level accordion */
.pg-mobile-accordion-header {
    display: flex;
    align-items: center;
    min-height: 61px;
    background: var(--pg-white);
    border-bottom: 1px solid #D9D9D9;
}
.pg-mobile-accordion.expanded > .pg-mobile-accordion-header {
    position: sticky;
    top: 0;
    z-index: 4;
}
.pg-mobile-accordion-link {
    all: unset;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 20px 16px 20px 24px;
    box-sizing: border-box;
    color: var(--pg-dark);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}
.pg-mobile-accordion-link:active {
    color: var(--pg-galaxy);
}
.pg-mobile-nav-icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--pg-galaxy);
}
.pg-mobile-accordion-toggle {
    all: unset;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 68px;
    padding-right: 24px;
    box-sizing: border-box;
    color: var(--pg-dark);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-accordion-toggle:active {
    background: var(--pg-light-grey);
}
.pg-mobile-accordion-chevron {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--pg-dark);
    transition: transform 0.28s ease;
}
.pg-mobile-accordion.expanded .pg-mobile-accordion-chevron {
    transform: rotate(180deg);
}
.pg-mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    background: var(--pg-light-grey);
    transition: max-height 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.pg-mobile-accordion-inner {
    padding: 0;
    background: var(--pg-light-grey);
}

/* Nested categories */
.pg-mobile-subcat-accordion {
    border-bottom: 0;
}
.pg-mobile-subcat-header {
    display: flex;
    align-items: center;
    min-height: 57px;
    background: var(--pg-white);
}
.pg-mobile-subcat-link {
    all: unset;
    flex: 1;
    min-width: 0;
    padding: 18px 16px 18px 48px;
    box-sizing: border-box;
    color: var(--pg-dark);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}
.pg-mobile-subcat-link:active {
    color: var(--pg-galaxy);
}
.pg-mobile-subcat-toggle {
    all: unset;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 68px;
    padding-right: 24px;
    box-sizing: border-box;
    color: var(--pg-dark);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-subcat-toggle:active {
    background: var(--pg-light-grey);
}
.pg-mobile-subcat-chevron {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--pg-dark);
    transition: transform 0.28s ease;
}
.pg-mobile-subcat-accordion.expanded .pg-mobile-subcat-chevron {
    transform: rotate(180deg);
}
.pg-mobile-subcat-panel {
    max-height: 0;
    overflow: hidden;
    background: var(--pg-light-grey);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Horizontal product rail */
.pg-mobile-products-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 20px 24px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.pg-mobile-products-scroll::-webkit-scrollbar {
    display: none;
}

/* Product card */
.pg-mobile-product-card {
    all: unset;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 156px;
    min-height: 222px;
    box-sizing: border-box;
    scroll-snap-align: start;
    background: #FAFAFA;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: var(--pg-dark);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-product-card:active {
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.pg-mobile-product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #FAFAFA;
}
.pg-mobile-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pg-mobile-product-placeholder {
    color: var(--pg-grey-light);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}
.pg-mobile-product-name {
    display: -webkit-box;
    overflow: hidden;
    padding: 10px 10px 2px;
    color: var(--pg-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.pg-mobile-product-price {
    display: block;
    padding: 0 10px 12px;
    color: var(--pg-grey);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}
.pg-mobile-product-price.is-unavailable {
    color: var(--pg-grey-light);
}
.pg-mobile-product-price del {
    color: var(--pg-grey-light);
    font-size: 11px;
}
.pg-mobile-product-price ins {
    color: var(--pg-price);
    font-weight: 700;
    text-decoration: none;
}

/* "Voir tout" card */
.pg-mobile-product-more {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 156px;
    min-height: 222px;
    box-sizing: border-box;
    background: #FAFAFA;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-product-more:active {
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.pg-mobile-product-more span {
    color: var(--pg-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* Direct links */
.pg-mobile-direct-link {
    all: unset;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    box-sizing: border-box;
    background: var(--pg-white);
    border-bottom: 1px solid #D9D9D9;
    color: var(--pg-dark);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    -webkit-tap-highlight-color: transparent;
}
.pg-mobile-direct-link:active {
    background: var(--pg-light-grey);
}

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

@media (max-width: 380px) {
    .pg-mobile-products-scroll {
        gap: 10px;
        padding-inline: 20px;
    }
    .pg-mobile-product-card,
    .pg-mobile-product-more {
        width: 148px;
    }
}
