body.app-page--product {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--tenant-surface) 88%, #fff), #fff 62%),
        color-mix(in srgb, var(--tenant-primary) 4%, #fff);
}

body.app-page--product::before {
    background-image: none;
    opacity: 0;
}

.main-content-product-page {
    padding-top: 0;
}

.product-detail-shell {
    max-width: 1320px;
    padding-block: clamp(0.65rem, 1.5vw, 1.2rem);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(340px, 560px) minmax(340px, 520px);
    justify-content: center;
    gap: clamp(1rem, 2.4vw, 2.4rem);
    align-items: start;
}

.product-gallery-panel,
.product-info-panel {
    min-width: 0;
}

.product-gallery-panel {
    position: sticky;
    top: calc(88px + 1rem);
}

.product-gallery-carousel {
    position: relative;
}

.product-image-frame {
    max-width: 560px;
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 12%, rgba(15, 23, 42, 0.08));
    border-radius: var(--app-radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--tenant-surface) 72%, #fff));
    box-shadow: 0 18px 38px color-mix(in srgb, var(--tenant-primary) 10%, rgba(15, 23, 42, 0.1));
}

.product-carousel-image {
    display: block;
    width: 100%;
    height: clamp(360px, 32vw, 560px);
    object-fit: cover;
    object-position: center;
    background: #fff;
    cursor: zoom-in;
    transition: transform 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
    .product-image-frame:hover .carousel-item.active .product-carousel-image {
        transform: scale(1.035);
    }
}

.product-gallery-control {
    width: 3rem;
    opacity: 1;
}

.product-gallery-control .carousel-control-prev-icon,
.product-gallery-control .carousel-control-next-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background-size: 56%;
    background-color: color-mix(in srgb, var(--tenant-primary) 84%, #111827);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--tenant-primary) 20%, transparent);
}

.product-gallery-thumbs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 68px;
    justify-content: center;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.9rem 0.1rem 0.2rem;
    scrollbar-width: thin;
}

.product-gallery-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 0.25rem;
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 16%, rgba(15, 23, 42, 0.12));
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.product-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-gallery-thumb:hover,
.product-gallery-thumb:focus-visible,
.product-gallery-thumb.active {
    border-color: var(--tenant-primary);
    box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--tenant-primary) 12%, transparent);
    transform: translateY(-1px);
}

.product-info-panel {
    width: 100%;
    max-width: 520px;
    padding: clamp(0.72rem, 1.2vw, 0.92rem);
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 12%, rgba(15, 23, 42, 0.08));
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 34px color-mix(in srgb, var(--tenant-primary) 8%, rgba(15, 23, 42, 0.08));
}

.product-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.product-back-link,
.product-category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.product-back-link {
    gap: 0.25rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 22%, rgba(15, 23, 42, 0.12));
    color: var(--tenant-text);
    background: #fff;
}

.product-back-link:hover,
.product-back-link:focus {
    border-color: var(--tenant-primary);
    color: var(--tenant-primary);
    background: color-mix(in srgb, var(--tenant-primary) 6%, #fff);
}

.product-category-chip {
    max-width: min(20rem, 58%);
    padding: 0.45rem 0.8rem;
    color: var(--tenant-primary);
    background: color-mix(in srgb, var(--tenant-primary) 9%, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-detail-title {
    margin: 0;
    color: var(--tenant-text);
    font-size: clamp(1.22rem, 1.85vw, 1.65rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.product-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.65rem;
}

.product-price-label {
    color: var(--tenant-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.product-price {
    margin: 0;
}

.badge-price {
    display: inline-flex;
    align-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 76%, var(--tenant-accent)));
    border-radius: 999px;
    padding: 0.46rem 0.75rem;
    font-size: clamp(1.08rem, 1.7vw, 1.42rem);
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--tenant-primary) 18%, transparent);
}

.product-purchase-form {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.product-options-block,
.product-buy-box,
.product-description-card {
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 14%, rgba(15, 23, 42, 0.08));
    border-radius: var(--app-radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--tenant-surface) 78%, #fff));
}

.product-options-block,
.product-description-card {
    padding: 0.68rem;
}

.product-section-head,
.product-buy-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.product-section-heading {
    margin: 0;
    color: var(--tenant-text);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0;
}

.product-required-note {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    color: var(--tenant-accent);
    background: color-mix(in srgb, var(--tenant-accent) 10%, #fff);
    font-size: 0.78rem;
    font-weight: 800;
}

.product-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 104px));
    align-items: start;
    gap: 0.5rem;
}

.product-theme-option {
    min-width: 0;
    align-self: start;
}

.theme-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-label {
    display: block;
    height: auto;
    cursor: pointer;
}

.theme-item {
    display: grid;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tenant-primary) 14%, rgba(15, 23, 42, 0.08));
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-item img {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
    object-position: center;
    padding: 0;
    background: #fff;
}

.theme-item-body {
    display: grid;
    gap: 0.08rem;
    padding: 0.38rem 0.35rem 0.42rem;
    text-align: center;
}

.theme-item-body strong,
.theme-item-body small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.theme-item-body strong {
    color: var(--tenant-text);
    display: -webkit-box;
    min-height: 1.8em;
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.theme-item-body small {
    color: var(--tenant-primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.theme-radio:checked + .theme-label .theme-item {
    border-color: var(--tenant-primary);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px color-mix(in srgb, var(--tenant-primary) 13%, transparent);
}

.theme-radio:focus-visible + .theme-label .theme-item {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--tenant-primary) 14%, transparent);
}

.product-theme-observation {
    margin-top: 0.65rem;
}

.product-theme-observation .form-label {
    color: var(--tenant-text);
    font-weight: 700;
}

.product-theme-observation .form-control {
    height: 3.6rem;
    min-height: 3.4rem;
    border-color: color-mix(in srgb, var(--tenant-primary) 16%, rgba(15, 23, 42, 0.14));
    border-radius: 12px;
}

.product-theme-observation .form-control:focus,
.product-quantity-control .form-control:focus {
    border-color: var(--tenant-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--tenant-primary) 10%, transparent);
}

.product-buy-box {
    padding: 0.68rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--tenant-primary) 8%, #fff), rgba(255, 255, 255, 0.98));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tenant-primary) 4%, transparent);
}

.stock-note {
    color: var(--tenant-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.product-action-row {
    display: grid;
    grid-template-columns: minmax(7.6rem, 9.1rem) minmax(0, 1fr);
    gap: 0.5rem;
    align-items: stretch;
    min-width: 0;
}

.product-quantity-control {
    display: grid;
    grid-template-columns: 2.3rem minmax(0, 1fr) 2.3rem;
    min-height: 2.55rem;
    min-width: 0;
    max-width: 100%;
}

.product-quantity-control .btn,
.product-quantity-control .form-control {
    min-height: 2.55rem;
    border-color: color-mix(in srgb, var(--tenant-primary) 18%, rgba(15, 23, 42, 0.16));
    border-radius: 0;
}

.product-quantity-control .btn {
    min-width: 2.3rem;
    color: var(--tenant-text);
    font-weight: 900;
    background: #fff;
}

.product-quantity-control .btn:hover,
.product-quantity-control .btn:focus {
    color: var(--tenant-primary);
    background: color-mix(in srgb, var(--tenant-primary) 7%, #fff);
}

.product-quantity-control .btn:first-child {
    border-radius: 10px 0 0 10px;
}

.product-quantity-control .btn:last-child {
    border-radius: 0 10px 10px 0;
}

.product-quantity-control .form-control {
    min-width: 0;
    width: 100%;
    color: var(--tenant-text);
    font-weight: 800;
}

.product-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 2.55rem;
    width: 100%;
    padding: 0.56rem 0.75rem;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 72%, var(--tenant-accent)));
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 14px 28px color-mix(in srgb, var(--tenant-primary) 18%, transparent);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.product-add-button:hover,
.product-add-button:focus {
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tenant-primary) 76%, #111827), var(--tenant-primary));
    box-shadow: 0 18px 34px color-mix(in srgb, var(--tenant-primary) 24%, transparent);
    transform: translateY(-1px);
}

.product-add-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

.product-description-card {
    margin-top: 0.5rem;
}

.product-description-text {
    margin: 0.5rem 0 0;
    color: color-mix(in srgb, var(--tenant-text) 88%, #111827);
    font-size: 0.86rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.modal-image {
    max-height: min(82vh, 900px);
    object-fit: contain;
}

@media (max-width: 1199px) {
    .product-detail-grid {
        grid-template-columns: minmax(300px, 460px) minmax(300px, 460px);
    }

    .product-theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(86px, 100px));
    }
}

@media (max-width: 991px) {
    .product-detail-shell {
        padding-block: 0.9rem 2rem;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .product-gallery-panel {
        position: static;
    }

    .product-info-panel {
        width: calc(100vw - 1.3rem);
        max-width: 560px;
        padding: 0.85rem;
    }

    .product-gallery-panel {
        width: 100%;
        max-width: 560px;
        margin-inline: auto;
    }

    .product-image-frame {
        max-width: 560px;
    }

    .product-carousel-image {
        height: min(62vw, 420px);
    }

    .product-action-row {
        grid-template-columns: 1fr;
    }

    .product-quantity-control,
    .product-add-button {
        width: 100%;
    }

    .product-quantity-control {
        grid-template-columns: 3rem minmax(0, 1fr) 3rem;
        max-width: 21rem;
    }

    .product-add-button {
        max-width: 21rem;
    }
}

@media (max-width: 575px) {
    .product-detail-shell {
        padding-inline: 0.65rem;
        padding-block: 0.65rem 1.4rem;
    }

    .product-gallery-panel,
    .product-info-panel {
        width: calc(100vw - 1.3rem);
        max-width: 100%;
    }

    .product-options-block,
    .product-buy-box,
    .product-description-card {
        width: 100%;
        max-width: 100%;
    }

    .product-buy-box {
        overflow: hidden;
    }

    .product-carousel-image {
        height: min(56vw, 230px);
    }

    .product-quantity-control .btn {
        min-width: 0;
    }

    .product-quantity-control {
        grid-template-columns: 2.55rem minmax(0, 1fr) 2.55rem;
        width: calc(100vw - 5.1rem);
    }

    .product-add-button {
        width: calc(100vw - 5.2rem);
        padding-inline: 0.65rem;
        white-space: normal;
    }

    .product-gallery-thumbs {
        grid-auto-columns: 58px;
        justify-content: start;
        gap: 0.45rem;
    }

    .product-image-frame,
    .product-info-panel,
    .product-options-block,
    .product-buy-box,
    .product-description-card {
        border-radius: 14px;
    }

    .product-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-category-chip {
        max-width: 100%;
    }

    .badge-price {
        width: auto;
        max-width: 100%;
        border-radius: 14px;
    }

    .product-theme-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-section-head,
    .product-buy-box-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
