/**
 * Mirswa — layout fixes for Windows 125% display scaling on 1920×1080 (~1536 CSS px).
 * Prevents clipped buttons, overflowing input-groups, and rigid flex rows.
 */

/* Allow flex/grid children to shrink instead of forcing overflow */
.mirswa-header-shell .container-fluid,
.mirswa-header-main-grid,
.mirswa-header-utility-grid,
.product-delivery-card,
#checkout_form,
.card-body,
.col-md-6,
.col-lg-5,
.col-lg-7 {
    min-width: 0;
}

/* Stack multi-control input groups unless explicitly marked inline */
.input-group:not(.mirswa-input-group-inline):has(.btn + .btn),
.input-group:not(.mirswa-input-group-inline):has(.form-control + .btn + .btn) {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.input-group:not(.mirswa-input-group-inline):has(.btn + .btn) > .form-control,
.input-group:not(.mirswa-input-group-inline):has(.form-control + .btn + .btn) > .form-control {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.input-group:not(.mirswa-input-group-inline):has(.btn + .btn) > .btn,
.input-group:not(.mirswa-input-group-inline):has(.form-control + .btn + .btn) > .btn,
.input-group:not(.mirswa-input-group-inline):has(.form-control + .btn + .btn) > .input-group-append,
.input-group:not(.mirswa-input-group-inline):has(.form-control + .btn + .btn) > .input-group-prepend {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
}

/* Header search — allow wake label to collapse on medium desktop widths */
@media (max-width: 1600px) {
    .header-search-polish .header-search-wake-wordmark {
        display: none;
    }

    .header-search-polish .input-group-text {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .mirswa-header-main-grid {
        gap: 0.35rem;
    }

    .mirswa-header-app-wrap .mirswa-header-google-play img {
        max-width: 130px;
        height: auto;
    }
}

@media (max-width: 1400px) {
    .mirswa-header-auth-pill {
        font-size: 0.85rem;
    }

    .mirswa-www-location-trigger__label,
    .mirswa-location-trigger__label {
        display: none;
    }

    .btn-sm {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }
}

/* Product detail sidebar — quantity + cart buttons */
@media (max-width: 1600px) {
    .product-page-section .d-flex.gap-2 .btn,
    .product-page-section .input-group .btn {
        white-space: normal;
        text-align: center;
    }
}

/* Checkout address / promo rows */
@media (max-width: 1600px) {
    #checkout_form .input-group:not(.mirswa-delivery-date-group) {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #checkout_form .input-group:not(.mirswa-delivery-date-group) > .form-control {
        flex: 1 1 100%;
        min-width: 0;
    }

    #checkout_form .input-group:not(.mirswa-delivery-date-group) > .btn,
    #checkout_form .input-group:not(.mirswa-delivery-date-group) > .input-group-append {
        flex: 1 1 auto;
    }
}

/* Utility: prevent long postcode/address strings from blowing layout */
.mirswa-www-location-trigger__value,
.mirswa-location-trigger__value,
.product-delivery-card .form-control {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product detail — keep gallery + sidebar from collapsing on scaled desktops */
.product-page-section .row,
.product-page-section .swiper,
.product-page-section .product-image-container,
.product-page-section .product-image-container img {
    min-width: 0;
}

.product-page-section .product-image-container img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
