/* Encre HP Latex — layout une colonne, tout visible d'un coup */

:root {
    --ipip-checkout-bar-height: 88px;
    --ipip-cookie-bar-height: 54px;
}

/* Aligné sur les pages impression (product-builder-single-page) */
body.ipip-ink-product-page.woocommerce.single-product,
body.ipip-ink-product-page.product-builder-single-page {
    padding-top: 14px !important;
}

@media screen and (max-width: 991px) {
    body.ipip-ink-product-page.woocommerce.single-product,
    body.ipip-ink-product-page.product-builder-single-page {
        padding-top: 10px !important;
    }
}

/* Conteneur centré comme le configurateur impression */
.ipip-ink-product.product-builder-single {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

/* Bouton retour — même rendu que product-builder.css */
.ipip-ink-product.product-builder-single > .btn.btn-link.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: left;
    background: #009468;
    color: #fff !important;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ipip-ink-product.product-builder-single > .btn.btn-link.btn-with-icon i {
    margin: 0;
    color: inherit;
}

.ipip-ink-product.product-builder-single > .btn.btn-link.btn-with-icon:hover,
.ipip-ink-product.product-builder-single > .btn.btn-link.btn-with-icon:focus {
    color: #fff !important;
    background: #007d56;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 148, 104, 0.25);
}

@media (max-width: 768px) {
    .ipip-ink-product.product-builder-single > .btn.btn-link.btn-with-icon {
        margin-bottom: 8px;
        font-size: 0.8rem;
    }
}

/* Masquer produits associés + gros bouton rouge sur page encre */
body.ipip-ink-product-page .section__related {
    display: none !important;
}

.ipip-ink-product-page .product__wrapper,
.ipip-ink-product .product__wrapper {
    display: block !important;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 calc(var(--ipip-checkout-bar-height) + 48px);
}

/* Espace sous le footer pour que les liens ne passent pas sous la barre fixe */
body.ipip-ink-product-page .footer-new {
    padding-bottom: calc(var(--ipip-checkout-bar-height) + 24px);
    margin-bottom: 0;
}

.ipip-ink-product-page .product__summary,
.ipip-ink-product .product__summary {
    display: none !important;
}

.ipip-ink-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* div, not <header>: theme _header.scss targets bare `header { position:fixed; top:0; … }` */
.ipip-ink-header {
    position: static;
    display: block;
    width: auto;
    height: auto;
    text-align: center;
    padding: 8px 0 4px;
}

.ipip-ink-title {
    font-size: clamp(1.125rem, 2.25vw, 1.5rem);
    margin: 0 0 8px;
    font-weight: 700;
    line-height: 1.25;
}

.ipip-ink-lead {
    margin: 0 auto;
    max-width: 640px;
    color: #555;
    font-size: 0.875rem;
    line-height: 1.45;
    font-weight: 400;
}

.ipip-section {
    width: 100%;
    text-align: center;
}

.ipip-section-label {
    font-size: 1.05rem;
    text-transform: none;
    letter-spacing: 0;
    color: #333;
    margin: 0 0 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* Modèles avec photo de boîte */
.ipip-model-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ipip-model-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(160px, 42vw);
    padding: 12px 10px 10px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.ipip-model-tab.is-active {
    border-color: #1a5276;
    box-shadow: 0 4px 14px rgba(26, 82, 118, 0.15);
}

.ipip-model-tab.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.ipip-model-tab.is-preorder-only:not(.is-active) {
    border-style: dashed;
}

.ipip-model-thumb {
    width: 100%;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.ipip-model-thumb img {
    max-width: 100%;
    max-height: 88px;
    object-fit: contain;
}

.ipip-model-info {
    text-align: center;
    line-height: 1.25;
}

.ipip-model-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}

.ipip-model-size {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 2px;
}

.ipip-model-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    background: #fff3cd;
    color: #856404;
}

.ipip-model-badge--muted {
    background: #ececec;
    color: #666;
}

/* Grille 7 couleurs — compacte, visible sans scroll */
.ipip-colors {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.ipip-color-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 10px 6px 8px;
    background: #fff;
    min-height: 0;
}

.ipip-color-card.has-qty {
    border-color: #1a5276;
    background: #f7fbfd;
}

.ipip-color-card.is-unavailable {
    opacity: 0.45;
}

.ipip-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-bottom: 6px;
}

.ipip-color-name {
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.2;
    margin-bottom: 2px;
    hyphens: auto;
}

.ipip-color-meta {
    font-size: 0.68rem;
    color: #c0392b;
    font-weight: 600;
    min-height: 14px;
    margin-bottom: 4px;
}

.ipip-color-meta.is-preorder {
    color: #856404;
}

.ipip-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 4px 0;
}

.ipip-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fafafa;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ipip-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ipip-qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.ipip-color-price {
    font-size: 0.72rem;
    color: #444;
    white-space: nowrap;
}

/* Barre panier fixe en bas — au-dessus du footer (z-index 200) et sous les modales cookie */
.ipip-checkout-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

/* Bandeau cookie : empilé au-dessus de la barre checkout (pas par-dessus) */
body.ipip-ink-product-page:has(.instacookie__bar:not([hidden])) .instacookie__bar {
    bottom: var(--ipip-checkout-bar-height);
    z-index: 1195;
}

/* Pastille cookie : au-dessus de la barre checkout, sous la barre si bandeau visible */
body.ipip-ink-product-page .instacookie__fab:not([hidden]) {
    bottom: calc(var(--ipip-checkout-bar-height) + 12px) !important;
    z-index: 1190 !important;
}

body.ipip-ink-product-page:has(.instacookie__bar:not([hidden])) .instacookie__fab:not([hidden]) {
    bottom: calc(var(--ipip-checkout-bar-height) + var(--ipip-cookie-bar-height) + 12px) !important;
}

.ipip-checkout-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ipip-checkout-selection {
    flex: 1 1 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 28px;
}

.ipip-checkout-placeholder {
    color: #999;
    font-size: 0.9rem;
}

.ipip-checkout-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4f8;
    font-size: 0.78rem;
    font-weight: 600;
}

.ipip-checkout-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.ipip-checkout-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.ipip-checkout-total-wrap {
    text-align: right;
}

.ipip-checkout-total-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ipip-checkout-total {
    font-size: 1.35rem;
    color: #1a5276;
}

.ipip-add-to-cart {
    min-width: 180px;
    white-space: nowrap;
}

.ipip-add-to-cart:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ipip-preorder-notice {
    max-width: 1180px;
    margin: 6px auto 0;
    text-align: center;
    color: #856404;
    font-size: 0.82rem;
}

/* Tablette : 4 colonnes couleurs */
@media (max-width: 992px) {
    .ipip-colors {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ipip-ink-product-page .product__wrapper,
    .ipip-ink-product .product__wrapper {
        padding-bottom: calc(var(--ipip-checkout-bar-height) + 40px);
    }
}

/* Mobile : 2 colonnes, barre empilée */
@media (max-width: 600px) {
    .ipip-colors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .ipip-model-tab {
        width: min(140px, 44vw);
    }

    .ipip-model-thumb {
        height: 72px;
    }

    .ipip-model-thumb img {
        max-height: 72px;
    }

    .ipip-checkout-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .ipip-checkout-actions {
        justify-content: space-between;
        width: 100%;
    }

    .ipip-add-to-cart {
        flex: 1;
    }

    .ipip-ink-product-page .product__wrapper,
    .ipip-ink-product .product__wrapper {
        padding-bottom: calc(var(--ipip-checkout-bar-height) + 56px);
    }
}
