/* MICROMAD iPhone product enhancement. Native WooCommerce controls remain the fallback. */
body.mm-iphone-product {
    --mm-iphone-blue: #1262a6;
    --mm-iphone-blue-hover: #0c4a81;
    --mm-iphone-blue-soft: #edf5fc;
    --mm-iphone-ink: #182735;
    --mm-iphone-muted: #566473;
    --mm-iphone-line: #dce3ea;
    --mm-iphone-surface: #f7f9fb;
}

body.mm-iphone-product .woocommerce-product-gallery,
body.mm-iphone-product .summary.entry-summary,
body.mm-iphone-product .summary form.cart,
body.mm-iphone-product .mm-iphone-options,
body.mm-iphone-product .mm-iphone-option-group,
body.mm-iphone-product .mm-iphone-option-buttons,
body.mm-iphone-product .mm-iphone-selection-summary {
    min-width: 0;
    max-width: 100%;
}

body.mm-iphone-product .woocommerce-product-gallery {
    padding: clamp(16px, 2.5vw, 32px);
    border: 1px solid #edf0f4;
    border-radius: 22px;
    background: #fff;
}

body.mm-iphone-product .woocommerce-product-gallery__image > a > img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

body.mm-iphone-product .summary .product_title {
    margin-bottom: 16px;
    color: var(--mm-iphone-ink);
    font-size: clamp(28px, 2.5vw, 40px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

body.mm-iphone-product .summary .price {
    color: var(--mm-iphone-ink);
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.mm-iphone-product .summary .price del {
    color: var(--mm-iphone-muted);
    font-size: .72em;
    font-weight: 400;
}

body.mm-iphone-product .summary .price ins {
    background: transparent;
    color: var(--mm-iphone-ink);
    text-decoration: none;
}

body.mm-iphone-product .summary .woocommerce-price-suffix {
    color: var(--mm-iphone-muted);
    font-size: .55em;
    font-weight: 500;
}

body.mm-iphone-product .mm-iphone-from {
    display: block;
    margin-bottom: 2px;
    color: var(--mm-iphone-muted);
    font-size: 14px;
    font-weight: 400;
}

body.mm-iphone-product .summary.mm-iphone-summary-enhanced .summary-inner > table.shop_attributes {
    display: none;
}

body.mm-iphone-product .mm-iphone-sibling-capacity { margin: 24px 0; }
body.mm-iphone-product .mm-iphone-sibling-label { margin-bottom: 10px; font-weight: 700; color: var(--mm-iphone-ink); }
body.mm-iphone-product .mm-iphone-sibling-links { display: flex; flex-wrap: wrap; gap: 10px; }
body.mm-iphone-product .mm-iphone-sibling-link { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--mm-iphone-line); border-radius: 11px; color: var(--mm-iphone-ink); background: #fff; }
body.mm-iphone-product .mm-iphone-sibling-link.is-selected { border-color: var(--mm-iphone-blue); box-shadow: inset 0 0 0 1px var(--mm-iphone-blue); background: var(--mm-iphone-blue-soft); color: var(--mm-iphone-blue-hover); }
body.mm-iphone-product .mm-iphone-sibling-link:focus-visible { outline: 3px solid var(--mm-iphone-blue); outline-offset: 3px; }

body.mm-iphone-product .summary form.cart {
    margin-top: 24px;
}

/* Hide legacy choices only after the script has built and bound working controls. */
body.mm-iphone-product form.variations_form.mm-iphone-enhanced table.variations,
body.mm-iphone-product form.variations_form.mm-iphone-enhanced .mm-capacity-server {
    display: none !important;
}

/* WooCommerce still controls the variation wrapper, stock and native purchase button. */
body.mm-iphone-product form.mm-iphone-enhanced.mm-iphone-price-synced .woocommerce-variation-price {
    display: none;
}

body.mm-iphone-product .mm-iphone-options,
body.mm-iphone-product .mm-iphone-options *,
body.mm-iphone-product .mm-iphone-options *::before,
body.mm-iphone-product .mm-iphone-options *::after,
body.mm-iphone-product .mm-iphone-selection-summary {
    box-sizing: border-box;
}

body.mm-iphone-product .mm-iphone-options {
    display: grid;
    gap: 24px;
    margin: 0 0 20px;
}

body.mm-iphone-product .mm-iphone-option-group {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

body.mm-iphone-product .mm-iphone-option-label {
    float: none;
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    color: var(--mm-iphone-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

body.mm-iphone-product .mm-iphone-option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.mm-iphone-product button.mm-iphone-option-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    min-height: 48px;
    max-width: 100%;
    margin: 0;
    padding: 11px 15px;
    border: 1px solid var(--mm-iphone-line);
    border-radius: 11px;
    background: #fff;
    box-shadow: none;
    color: var(--mm-iphone-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

body.mm-iphone-product .mm-iphone-option-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.mm-iphone-product .mm-iphone-color-dot {
    flex: 0 0 20px;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(24, 39, 53, .28);
    border-radius: 50%;
    background: var(--mm-iphone-color, #e5e7eb);
}

body.mm-iphone-product .mm-iphone-option-group[data-kind="capacity"] .mm-iphone-option-button {
    flex: 1 1 100px;
}

body.mm-iphone-product button.mm-iphone-option-button:not(:disabled):not([aria-disabled="true"]):hover {
    border-color: var(--mm-iphone-blue);
    background: var(--mm-iphone-blue-soft);
}

body.mm-iphone-product button.mm-iphone-option-button[aria-pressed="true"] {
    border-color: var(--mm-iphone-blue);
    background: var(--mm-iphone-blue-soft);
    box-shadow: inset 0 0 0 1px var(--mm-iphone-blue);
    color: var(--mm-iphone-blue-hover);
    font-weight: 700;
}

body.mm-iphone-product button.mm-iphone-option-button:disabled,
body.mm-iphone-product button.mm-iphone-option-button[aria-disabled="true"] {
    border-color: #e1e6eb;
    border-style: dashed;
    background: #f7f8fa;
    box-shadow: none;
    color: #78828d;
    cursor: not-allowed;
}

body.mm-iphone-product button.mm-iphone-option-button:focus-visible,
body.mm-iphone-product button.mm-iphone-reset-options:focus-visible,
body.mm-iphone-product .summary .single_add_to_cart_button:focus-visible,
body.mm-iphone-product .summary a[href$="#Devis_popup"]:focus-visible,
body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button:focus-visible,
body.mm-iphone-product .summary .reset_variations:focus-visible {
    outline: 3px solid var(--mm-iphone-blue);
    outline-offset: 3px;
}

body.mm-iphone-product button.mm-iphone-reset-options {
    appearance: none;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    max-width: 100%;
    margin: -6px 0 14px;
    padding: 10px 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: var(--mm-iphone-blue);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: normal;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
}

body.mm-iphone-product button.mm-iphone-reset-options:not([hidden]) {
    display: inline-flex;
}

body.mm-iphone-product button.mm-iphone-reset-options[hidden] {
    display: none;
}

body.mm-iphone-product button.mm-iphone-reset-options:hover {
    background: transparent;
    color: var(--mm-iphone-blue-hover);
}

body.mm-iphone-product .mm-iphone-selection-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--mm-iphone-line);
    border-radius: 11px;
    background: var(--mm-iphone-surface);
    color: var(--mm-iphone-muted);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

body.mm-iphone-product .mm-iphone-selected-text {
    color: var(--mm-iphone-ink);
    font-weight: 600;
}

body.mm-iphone-product .mm-iphone-stock-text:empty {
    display: none;
}

body.mm-iphone-product .mm-iphone-selection-summary.is-available .mm-iphone-stock-text {
    color: #23613c;
}

body.mm-iphone-product .mm-iphone-selection-summary.is-unavailable {
    border-color: #ead7d7;
    background: #fff8f8;
}

body.mm-iphone-product .mm-iphone-selection-summary.is-unavailable .mm-iphone-stock-text {
    color: #9b3030;
}

body.mm-iphone-product .mm-iphone-selection-summary.is-pending .mm-iphone-stock-text {
    color: var(--mm-iphone-muted);
}

body.mm-iphone-product .summary .single_add_to_cart_button {
    min-height: 50px;
    max-width: 100%;
    padding: 13px 24px;
    border-radius: 11px;
    background-color: var(--mm-iphone-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    white-space: normal;
}

body.mm-iphone-product .summary .single_add_to_cart_button:not(:disabled):not(.disabled):hover {
    background-color: var(--mm-iphone-blue-hover);
    color: #fff;
}

body.mm-iphone-product .summary a[href$="#Devis_popup"] {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 48px;
    border-radius: 11px;
    white-space: normal;
}

body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    max-width: 100%;
    padding: 12px 20px;
    border-radius: 11px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
}

body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button-content-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button .e-font-icon-svg {
    width: 1.2em;
    height: 1.2em;
    max-width: 1.2em;
    flex-shrink: 0;
    fill: currentColor;
}

body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.mm-iphone-product .summary .reset_variations {
    min-height: 44px;
    padding-block: 12px;
    color: var(--mm-iphone-blue);
    font-size: 13px;
    text-underline-offset: 3px;
}

@media (max-width: 767px) {
    body.mm-iphone-product .woocommerce-product-gallery {
        padding: 16px;
        border-radius: 16px;
    }

    body.mm-iphone-product .summary .product_title {
        margin-top: 20px;
        margin-bottom: 12px;
        font-size: clamp(26px, 7vw, 32px);
    }

    body.mm-iphone-product .summary form.cart {
        width: 100%;
        margin-top: 20px;
    }

    body.mm-iphone-product .mm-iphone-options {
        gap: 20px;
    }

    body.mm-iphone-product .mm-iphone-option-buttons {
        gap: 8px;
    }

    body.mm-iphone-product button.mm-iphone-option-button {
        padding: 11px 12px;
    }

    body.mm-iphone-product .mm-iphone-option-group[data-kind="capacity"] .mm-iphone-option-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.mm-iphone-product .mm-iphone-selection-summary {
        padding: 12px 14px;
    }

    body.mm-iphone-product .summary .single_add_to_cart_button,
    body.mm-iphone-product .summary a[href$="#Devis_popup"],
    body.mm-iphone-product .summary .wd-after-add-to-cart .elementor-button {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        margin-inline: 0;
    }

    body.mm-iphone-product .summary form.cart input[type="number"],
    body.mm-iphone-product .summary form.cart select {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.mm-iphone-product button.mm-iphone-option-button {
        transition: none;
    }
}
