/**
 * Partoo CSS overrides
 *
 * CSS isolation and additional rules to fix style conflicts between Magento and Partoo.
 * All selectors must be scoped with .partoo-proxy-content to avoid leaking.
 */

/* ==========================================================================
   CSS Isolation
   ========================================================================== */

/*
 * Prevent Magento styles from leaking into Partoo content.
 * `all: initial` on the container cuts CSS inheritance from Magento ancestors.
 * `all: revert` on children restores browser defaults so Partoo's scoped CSS
 * (prefixed with .partoo-proxy-content) can take over cleanly.
 * SVG elements are excluded from revert to preserve fill/stroke attributes.
 */
.page-wrapper > .partoo-proxy-content {
    all: initial;
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
    max-width: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.partoo-proxy-content *:not(svg, path, g, circle, rect, line, ellipse, polyline, polygon, text, tspan, use, defs, clipPath, symbol, image):not(:where(.gm-style, .gm-style *)),
.partoo-proxy-content *:not(:where(.gm-style, .gm-style *))::before,
.partoo-proxy-content *:not(:where(.gm-style, .gm-style *))::after {
    all: revert;
}

/* ==========================================================================
   Component overrides
   ========================================================================== */

.partoo-proxy-content .b-form__button.c-button {
    background: transparent !important;
}

.partoo-proxy-content .c-button--reversed:hover {
    background-color: #207e42 !important;
    border-color: #207e42 !important;
}

.partoo-proxy-content .b-form--with-modal-filters .b-form__search-button.c-button {
    background: transparent !important;
}

.partoo-proxy-content .b-form--with-modal-filters .b-form__input {
    --inputHeight: unset !important;
}

.partoo-proxy-content .c-button--reversed {
    background-color: transparent !important;
}

.partoo-proxy-content .c-button.b-result__button,
.partoo-proxy-content .c-button.b-infos__action,
.partoo-proxy-content .c-button.b-area-list__all {
    height: 24px !important;
}

.partoo-proxy-content .b-result__buttons .c-button {
    flex-basis: calc(50% - 40px) !important;
}

.partoo-proxy-content .p-locator {
    margin-bottom: 20px;
}

.partoo-proxy-content .c-toggle input[type="checkbox"] {
    width: unset;
}

/* Exclude Google Maps images (Pegman, controls) from Partoo's max-width reset */
.partoo-proxy-content .gm-style img {
    max-width: none !important;
}

.partoo-proxy-content .b-reviews__item {
    box-sizing: border-box;
}

.partoo-proxy-content .gm-iv-address-description {
    vertical-align: top;
    padding-right: 30px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.partoo-proxy-content .gm-iv-short-address-description {
    font-weight: bold;
    font-size: 12px;
    padding-bottom: 2px;
}

.partoo-proxy-content .gm-iv-long-address-description {
    font-weight: normal;
    font-size: 11px;
}

.partoo-proxy-content .gm-iv-address {
    font-family: Roboto, Arial, sans-serif;
    padding: 6px 8px;
    margin-top: 10px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.partoo-proxy-content .gm-iv-address-link a {
    color: #aecbfa;
    text-decoration: none;
    font-size: 11px;
}

.partoo-proxy-content .gm-iv-container {
    border-right: 1px solid #666;
    font-family: Roboto, Arial, sans-serif;
    margin-top: 10px;
}

.partoo-proxy-content .gm-iv-profile-link {
    font-weight: bold;
    font-size: 12px;
}

/* Ensure Swiper container max-width is set before Partoo CSS loads via proxy,
   so Swiper JS calculates slide widths from the correct container size */
@media screen and (min-width: 1200px) {
    .partoo-proxy-content .swiper,
    .partoo-proxy-content .swiper-container {
        max-width: 1024px;
    }
}
