/* Ajustes aislados de catálogo y ficha para Safari/iPhone. */
.product-gallery-stage {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 32rem;
    min-width: 0;
    margin-inline: auto;
}

.product-gallery-stage > img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
}

.product-detail-grid,
.product-gallery-panel,
.product-info-panel,
.product-gallery-thumbnails {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1023px) {
    .product-detail-grid {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }
}

.product-card,
.product-card-body,
.product-card-footer {
    min-width: 0;
}

@media (max-width: 639px) {
    .product-detail-page {
        overflow-x: hidden;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .product-detail-card {
        border-radius: 1rem;
    }

    .product-gallery-panel {
        min-height: 0;
        padding: .75rem;
        width: 100%;
    }

    .product-gallery-stage {
        aspect-ratio: auto;
        height: calc(100vw - 4rem);
        max-height: 22rem;
        max-width: 100%;
    }

    .product-gallery-stage > img {
        padding: .5rem;
    }

    .product-info-panel {
        min-width: 0;
        padding: 1.25rem;
        overflow-wrap: anywhere;
        width: 100%;
    }

    .product-gallery-thumbnails {
        width: 100%;
    }

    .product-gallery-caption {
        display: none !important;
    }

    .product-price-row {
        align-items: center;
        flex-wrap: wrap;
        row-gap: .5rem;
    }

    .product-purchase-row {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .product-qty-control {
        justify-content: space-between;
        max-width: 100%;
        width: 100%;
    }

    .product-purchase-row > button {
        font-size: .9375rem;
        max-width: 100%;
        min-width: 0;
        white-space: nowrap;
        width: 100%;
    }

    .product-purchase-row > button svg {
        flex: 0 0 1.25rem;
    }

    .product-card {
        border-radius: .75rem;
    }

    .product-card .product-img {
        padding: .5rem;
    }

    .product-card-body {
        padding: .75rem;
    }

    .product-card-category {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-card-title {
        font-size: .75rem;
        line-height: 1rem;
        overflow-wrap: anywhere;
    }

    .product-card-footer {
        gap: .5rem;
    }

    .product-card-price {
        font-size: 1.125rem;
        line-height: 1.5rem;
        white-space: nowrap;
    }

    .product-card-cart {
        border-radius: .5rem;
        flex: 0 0 2.25rem;
        height: 2.25rem;
        width: 2.25rem;
    }
}
