/**
 * IAR — haut de fiche HikaShop compact.
 * Charge par show_tabular.php. Aucun style global sur le calculateur.
 * Reglages principaux : colonnes, largeur des labels, taille du titre.
 */

/* Le template de production ajoute un fond coupe en deux et de grands vides
 * autour du formulaire. Ces surcharges ne concernent que la fiche refondue.
 * Garder les max-width responsives du template pour l'alignement du contenu.
 */
.hikashop_product_page.iar-product-page {
    background: #fff !important;
}

.iar-product-page > form.iar-product-form {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.iar-product-page #hikashop_product_bottom_part {
    padding-top: 0 !important;
}

#iar-product-hero {
    --iar-accent: #5a3e69;
    --iar-accent-hover: #463052;
    --iar-text: #29222f;
    --iar-muted: #665e6d;
    --iar-border: #e7dfea;
    display: grid;
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
    align-items: center;
    gap: clamp(24px, 3.5vw, 56px);
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 26px;
    padding: 12px 28px 24px;
    border: 0;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(90deg, #fff 0%, #fbf8fd 55%, #f5eef9 100%);
    color: var(--iar-text);
}

#iar-product-hero *,
.iar-video-modal *,
.iar-video-backdrop {
    box-sizing: border-box;
}

#iar-product-hero #hikashop_product_left_part,
#iar-product-hero #hikashop_product_right_part {
    float: none;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
}

#iar-product-hero #hikashop_product_top_part {
    margin: 0;
    padding: 0;
}

#iar-product-hero .iar-product-hero__title {
    margin: 0 0 12px;
    padding: 0;
    font-size: clamp(28px, 2.8vw, 42px);
    font-weight: 750;
    line-height: 1.12;
    letter-spacing: -0.035em;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
    color: var(--iar-text);
}

#iar-product-hero #hikashop_product_name_main {
    font: inherit;
    color: inherit;
}

#iar-product-hero .iar-product-hero__certifications {
    margin: 0 0 14px;
    padding: 0;
    text-align: left;
}

#iar-product-hero .iar-product-hero__certifications img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 28px;
    margin: 0;
    object-fit: contain;
    object-position: left center;
    border: 0;
    border-radius: 0;
}

#iar-product-hero .iar-product-hero__intro {
    max-width: 66ch;
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--iar-muted);
}

#iar-product-hero .iar-product-hero__read-more {
    display: inline-flex;
    margin: 0 0 16px;
    color: var(--iar-accent);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    white-space: nowrap;
}

#iar-product-hero .iar-product-hero__intro:has(+ .iar-product-hero__read-more) {
    margin-bottom: 4px;
}

#iar-product-hero .iar-product-hero__read-more:hover {
    color: var(--iar-accent-hover);
    text-decoration-thickness: 2px;
}

#iar-product-hero .iar-product-hero__read-more:focus-visible {
    outline: 2px solid #9b7cae;
    outline-offset: 3px;
    border-radius: 2px;
}

/* Garder la description visible sous le menu fixe apres "Voir plus". */
.iar-product-page .txt-prdt,
.iar-product-page #hikashop_product_description_main {
    scroll-margin-top: 8rem;
}

#iar-product-hero .iar-product-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

#iar-product-hero .iar-product-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--iar-accent);
    border-radius: 999px;
    background: var(--iar-accent);
    color: #fff;
    box-shadow: none;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

#iar-product-hero .iar-product-action svg {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

#iar-product-hero .iar-product-action span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#iar-product-hero .iar-product-action:hover {
    border-color: var(--iar-accent-hover);
    background: var(--iar-accent-hover);
    color: #fff;
    box-shadow: 0 3px 10px #5a3e6920;
    text-decoration: none;
}

#iar-product-hero .iar-product-action--outline {
    border-color: #d9cde0;
    background: #fff;
    color: var(--iar-accent);
}

#iar-product-hero .iar-product-action--outline:hover {
    border-color: var(--iar-accent);
    background: #eee6f3;
    color: var(--iar-accent-hover);
}

#iar-product-hero :is(button, a):focus-visible,
.iar-video-modal__close:focus-visible {
    outline: 3px solid #9b7cae;
    outline-offset: 3px;
}

/* La galerie garde ses helpers et sa lightbox HikaShop, sans hauteur imposee. */
#iar-product-hero .hikashop_global_image_div,
#iar-product-hero .hikashop_main_image_div {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

#iar-product-hero .hikashop_product_main_image_thumb {
    position: relative;
    width: 100%;
    height: auto !important;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #efedf0;
}

#iar-product-hero .hikashop_product_main_image {
    height: auto !important;
    min-height: 0;
    margin: 0;
    padding: 0;
}

#iar-product-hero .hikashop_product_main_image_subdiv {
    width: 100%;
    margin: 0 !important;
}

#iar-product-hero .hikashop_product_main_image_subdiv > a,
#iar-product-hero .hikashop_product_main_image_subdiv picture {
    display: block;
    width: 100%;
    margin: 0;
}

/* Indication de zoom decorative : le lien et la lightbox HikaShop gardent le clic. */
#iar-product-hero .hikashop_product_main_image_subdiv > a {
    position: relative;
}

#iar-product-hero .hikashop_product_main_image_subdiv > a::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffffed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a3e69' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
    box-shadow: 0 2px 8px #29222f14;
    opacity: 0;
    transform: translateY(3px);
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
}

#iar-product-hero .hikashop_product_main_image_subdiv > a:hover::after,
#iar-product-hero .hikashop_product_main_image_subdiv > a:focus-visible::after {
    opacity: 1;
    transform: none;
}

#iar-product-hero .hikashop_product_main_image_subdiv img[id^="hikashop_main_image"],
#iar-product-hero .hikashop_main_image_div > img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0 !important;
    border: 0;
}

#iar-product-hero .hikashop_small_image_div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
    text-align: left;
}

#iar-product-hero .hikashop_small_image_div:empty {
    display: none;
}

#iar-product-hero .hikashop_small_image_div > a {
    display: block;
    flex: 0 0 72px;
    width: 72px;
    aspect-ratio: 2 / 1;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    opacity: 0.78;
    transition: opacity 150ms ease;
}

#iar-product-hero .hikashop_small_image_div > a:hover,
#iar-product-hero .hikashop_small_image_div > a.hikashop_active_thumbnail {
    opacity: 1;
    box-shadow: none;
}

#iar-product-hero .hikashop_small_image_div > a:focus-visible {
    outline-offset: -3px;
}

#iar-product-hero .hikashop_small_image_div picture {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

#iar-product-hero .hikashop_small_image_div .hikashop_child_image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 2 / 1;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
    transform: none;
}

#iar-product-hero .hikashop_slide_prev,
#iar-product-hero .hikashop_slide_next {
    display: none;
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid #ffffffd9;
    border-radius: 50%;
    background: #ffffffeb;
    color: var(--iar-accent);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #29222f14;
    transform: translateY(-50%);
    transition: background-color 150ms ease;
    cursor: pointer;
}

#iar-product-hero .hikashop_slide_prev { left: 10px; }
#iar-product-hero .hikashop_slide_next { right: 10px; }
#iar-product-hero .hikashop_slide_prev:hover,
#iar-product-hero .hikashop_slide_next:hover { background: #fff; }
#iar-product-hero .hikashop_slide_prev i,
#iar-product-hero .hikashop_slide_next i { color: inherit; }

#iar-product-hero :is(.hikashop_img_mode_slider, .hikashop_img_mode_both) > :is(.hikashop_slide_prev_active, .hikashop_slide_next_active) {
    display: inline-flex;
}

/* Conserver les champs supplementaires sans les anciens espacements fixes. */
#iar-product-hero #hikashop_product_custom_info_main {
    min-height: 0;
    margin: 0;
    padding: 0;
}

#iar-product-hero .hikashop_product_custom_info_main_table {
    width: 100%;
    margin: 16px 0 0;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
}

#iar-product-hero .hikashop_product_custom_info_main_table td {
    padding: 7px 0;
    border-bottom: 1px solid var(--iar-border);
    vertical-align: top;
}

#iar-product-hero .hikashop_product_custom_info_main_table td + td {
    padding-left: 14px;
}

#iar-product-hero .hikashop_product_custom_info_main_table label { margin: 0; }
#iar-product-hero .hikashop_product_custom_info_main:empty,
#iar-product-hero .hikashop_product_vote_mini:empty { display: none; }

/* Modale video. Le lecteur n'existe que pendant son ouverture. */
.iar-video-modal[hidden],
.iar-video-backdrop[hidden] { display: none !important; }

body.iar-video-is-open { overflow: hidden; }

.iar-video-modal {
    width: min(980px, calc(100vw - 40px));
    max-width: 980px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #29222f;
    box-shadow: 0 24px 90px #160d2366;
    overflow: auto;
    overscroll-behavior: contain;
}

.iar-video-modal::backdrop { background: #1c1529bf; backdrop-filter: blur(5px); }
.iar-video-modal__panel { width: 100%; }

.iar-video-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px 14px 22px;
}

.iar-video-modal .iar-video-modal__title {
    margin: 0;
    padding: 0;
    color: #29222f;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.4;
    text-transform: none;
    overflow-wrap: anywhere;
}

.iar-video-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3edf6;
    color: #5a3e69;
    cursor: pointer;
}

.iar-video-modal__close:hover { background: #e8ddec; }
.iar-video-modal__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0f0b13; }
.iar-video-modal__iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }

.iar-video-backdrop { position: fixed; inset: 0; z-index: 2147483645; background: #1c1529bf; }
.iar-video-modal[data-iar-fallback="true"][open] { position: fixed; inset: 0; z-index: 2147483646; height: fit-content; }

@media (max-width: 991px) {
    .iar-product-page > form.iar-product-form { padding: 0 16px !important; }
    #iar-product-hero { gap: 24px; padding: 12px 20px 20px; }
    #iar-product-hero .iar-product-hero__title { font-size: 30px; }
    #iar-product-hero .iar-product-hero__intro { font-size: 14px; line-height: 1.55; }
}

@media (max-width: 767px) {
    #iar-product-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        margin-bottom: 20px;
        padding: 8px 16px 16px;
        border-radius: 0 0 14px 14px;
    }
    .iar-product-page .txt-prdt,
    .iar-product-page #hikashop_product_description_main { scroll-margin-top: 6rem; }
    #iar-product-hero .iar-product-hero__title { font-size: clamp(26px, 6vw, 34px); }
    #iar-product-hero .iar-product-hero__intro { max-width: none; margin-bottom: 14px; }
    #iar-product-hero .iar-product-action { min-height: 42px; }
    #iar-product-hero .hikashop_small_image_div { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .iar-video-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; }
    .iar-video-modal__header { gap: 10px; padding: 10px 12px 10px 16px; }
    .iar-video-modal .iar-video-modal__title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    #iar-product-hero .iar-product-action,
    #iar-product-hero .hikashop_product_main_image_subdiv > a::after,
    #iar-product-hero .hikashop_small_image_div > a,
    #iar-product-hero .hikashop_slide_prev,
    #iar-product-hero .hikashop_slide_next { transition: none; }
}
