/* Cinq-Étoiles — Guide des tailles : panneau latéral (étape C). Portée : .cegt-* uniquement. */

.cegt-panel {
    --cegt-red: #6f1b2a;
    --cegt-red-soft: #fbeff1;
    --cegt-ink: #111111;
    --cegt-muted: #5a5a60;
    --cegt-line: #e3e3e6;
    --cegt-chip: #f1f1f3;
    position: fixed;
    inset: 0;
    z-index: 99950;
    font-family: inherit;
    color: var(--cegt-ink);
}

.cegt-panel[hidden] { display: none; }

.cegt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .45);
    opacity: 0;
    transition: opacity .22s ease;
}

.cegt-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(650px, 100vw);
    background: #fff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
    overscroll-behavior: contain;
}

.cegt-panel.is-open .cegt-overlay { opacity: 1; }
.cegt-panel.is-open .cegt-drawer { transform: translateX(0); }

/* Barre d'administration WordPress : le tiroir commence sous la barre. */
body.admin-bar .cegt-drawer { top: 32px; }

@media (max-width: 782px) {
    body.admin-bar .cegt-drawer { top: 46px; }
}

.cegt-drawer__head {
    position: relative;
    padding: 22px 56px 14px 24px;
    border-bottom: 0;
    flex: 0 0 auto;
}

.cegt-drawer__head h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.01em;
}

.cegt-drawer__head::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 12px;
    background: var(--cegt-red);
    border-radius: 2px;
}

.cegt-close {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111111;
    box-shadow: none;
    cursor: pointer;
    transition: background .15s ease;
}

.cegt-close svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: #111111;
    stroke-width: 2.4;
}

.cegt-close:hover { background: #f1f1f3; }

.cegt-close:focus-visible { outline: 2px solid rgba(17, 17, 17, .4); outline-offset: 2px; background: transparent; }

.cegt-drawer:focus { outline: none; }

.cegt-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 24px 28px;
    -webkit-overflow-scrolling: touch;
}

.cegt-chart + .cegt-chart { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--cegt-line); }

.cegt-chart__title {
    margin: 12px 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.cegt-chart__subtitle {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--cegt-muted);
}

.cegt-tabs {
    display: flex;
    gap: 6px;
    margin: 10px 0 16px;
    padding: 4px;
    background: var(--cegt-chip);
    border-radius: 8px;
}

.cegt-tab {
    flex: 1 1 0;
    padding: 11px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cegt-ink);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.cegt-tab[aria-selected="true"] {
    background: var(--cegt-red);
    color: #fff;
}

.cegt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 14px;
}

.cegt-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 4px 0 6px;
}

.cegt-row .cegt-field { flex: 1 1 auto; margin-bottom: 12px; }
.cegt-row .cegt-units { flex: 0 0 auto; margin-bottom: 12px; }

.cegt-product__name {
    margin: 12px 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: var(--cegt-ink);
}

.cegt-preview-badge {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 8px;
    border: 1px solid #f0d3d7;
    border-radius: 4px;
    background: #fdf0f1;
    color: #8b1a2a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cegt-units {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--cegt-chip);
    border-radius: 8px;
}

.cegt-unit {
    padding: 8px 14px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--cegt-ink);
}

.cegt-unit[aria-pressed="true"] { background: var(--cegt-red); color: #fff; }

.cegt-field { margin: 0 0 16px; }

.cegt-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 700;
}

.cegt-select {
    width: 100%;
    height: 46px;
    padding: 0 38px 0 14px;
    border: 1px solid #d6d6da;
    border-radius: 6px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f1b2a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    font: inherit;
    font-size: 15px;
    color: var(--cegt-ink);
    appearance: none;
}

.cegt-select:focus-visible { outline: 2px solid var(--cegt-red); outline-offset: 1px; }

/* Silhouette */
.cegt-figure {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 4px 112px 6px;
    margin: 2px 0 4px;
}

.cegt-figure__media {
    position: relative;
    width: 100%;
    max-width: 190px;
}

.cegt-figure__img {
    display: block;
    width: 100%;
    height: auto;
}

.cegt-figure__guides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cegt-figure__guides .cegt-guide {
    stroke: var(--cegt-red);
    stroke-width: 2.2;
    stroke-dasharray: 10 8;
    fill: none;
}

.cegt-figure__guides .cegt-dot { fill: var(--cegt-red); }

.cegt-callout {
    position: absolute;
    top: 0;
    width: 106px;
    transform: translateY(-50%);
    font-size: 12px;
    line-height: 1.25;
    color: var(--cegt-ink);
}

.cegt-callout--left { left: 0; text-align: left; }
.cegt-callout--right { right: 0; text-align: right; }

.cegt-callout__label {
    display: block;
    color: var(--cegt-red);
    font-weight: 700;
    font-size: 12px;
}

.cegt-callout__value {
    display: block;
    font-weight: 600;
    font-size: 12.5px;
}

.cegt-callout-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.cegt-callout-line {
    fill: none;
    stroke: var(--cegt-red);
    stroke-width: 1.2;
    stroke-dasharray: 5 4;
    opacity: .85;
}

.cegt-undocumented-note {
    margin: -4px 0 12px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--cegt-muted);
}

.cegt-table-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.cegt-table-chips .cegt-chip {
    margin: 0;
}

.cegt-figure__hint {
    margin: 4px 0 2px;
    text-align: center;
    font-size: 12.5px;
    color: var(--cegt-muted);
}

.cegt-measures { margin: 6px 0 0; padding: 0; list-style: none; }

.cegt-measures li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--cegt-line);
    font-size: 14.5px;
}

.cegt-measures li:last-child { border-bottom: 0; }
.cegt-measures dt, .cegt-measures .cegt-m-label { color: var(--cegt-ink); font-weight: 600; }
.cegt-measures .cegt-m-value { text-align: right; font-weight: 600; }
.cegt-measures .cegt-m-alt { color: var(--cegt-muted); font-weight: 500; }

.cegt-missing { color: var(--cegt-muted); font-style: italic; font-size: 13.5px; }

/* Table */
.cegt-table-wrap { overflow-x: auto; margin: 4px 0 10px; }

.cegt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cegt-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 700;
    padding: 4px 0 8px;
    font-size: 14px;
}

.cegt-table th, .cegt-table td {
    border: 1px solid var(--cegt-line);
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.cegt-table thead th {
    background: #f7f7f9;
    font-weight: 700;
    font-size: 13.5px;
}

.cegt-table thead th:first-child { text-align: left; }
.cegt-table tbody th {
    text-align: left;
    font-weight: 700;
    background: #fff;
}

.cegt-table tbody tr.is-selected td,
.cegt-table tbody tr.is-selected th {
    background: var(--cegt-red-soft);
    color: var(--cegt-red);
    font-weight: 700;
}

.cegt-table .cegt-cell-alt { display: block; color: var(--cegt-muted); font-size: 11.5px; font-weight: 500; }
.cegt-table tbody tr.is-selected .cegt-cell-alt { color: var(--cegt-red); }

/* Linen illustration */
.cegt-linen { margin: 4px 0 12px; }
.cegt-linen__figure {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 4px auto 10px;
}
.cegt-linen__caption { margin: -2px 0 10px; text-align: center; font-size: 13px; color: #5a5a60; }
.cegt-linen__figure .cloth { fill: #fdfdfd; stroke: #d8d8dc; stroke-width: 1; }
.cegt-linen__figure .table { fill: #c8a37a; stroke: #a9855e; stroke-width: 1; }
.cegt-linen__figure .dim { stroke: var(--cegt-red); stroke-width: 1.2; fill: none; }
.cegt-linen__figure .dim-text { fill: var(--cegt-red); font-size: 13px; font-weight: 700; }
.cegt-linen__figure .dim-alt { fill: var(--cegt-muted); font-size: 11px; font-weight: 500; }

.cegt-grid-formats { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.cegt-grid-formats th, .cegt-grid-formats td { border: 1px solid var(--cegt-line); padding: 9px 8px; text-align: left; }
.cegt-grid-formats thead th { background: #fafafa; font-size: 13px; }
.cegt-grid-formats td.is-current { background: var(--cegt-red-soft); color: var(--cegt-red); font-weight: 700; }

/* Information discrète, ouverte dans une fenêtre dédiée */
.cegt-note {
    position: relative;
    margin-top: 10px;
    padding: 0;
    background: transparent;
    font-size: 13.5px;
    line-height: 1.45;
}

.cegt-info-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #1769aa;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.cegt-info-trigger:hover {
    background: #fff !important;
    color: #111 !important;
    text-decoration: none;
}
.cegt-info-trigger:focus-visible { outline: 2px solid #1769aa; outline-offset: 3px; border-radius: 3px; }
.cegt-info-trigger__icon { display: inline-flex; line-height: 0; }
.cegt-info-trigger__icon svg { display: block; }

.cegt-info-modal[hidden] { display: none; }
.cegt-info-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cegt-info-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .46);
}

.cegt-info-modal__dialog {
    position: relative;
    width: min(430px, 100%);
    max-height: min(80vh, 520px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    border: 1px solid #e1e1e4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 42px rgba(0, 0, 0, .22);
    color: var(--cegt-ink);
}

.cegt-info-modal__dialog h3 {
    margin: 0 34px 14px 0;
    color: #1769aa;
    font-size: 20px;
    line-height: 1.2;
}

.cegt-info-modal__content { font-size: 14px; line-height: 1.55; }
.cegt-info-modal__content p { margin: 0 0 10px; }
.cegt-info-modal__content p:last-child { margin-bottom: 0; }

.cegt-info-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.cegt-info-modal__close:hover { background: #f1f1f3; }
.cegt-info-modal__close:focus-visible { outline: 2px solid #1769aa; outline-offset: 2px; }
.cegt-info-modal__close svg { display: block; }

.cegt-empty { padding: 24px 0; color: var(--cegt-muted); font-size: 14px; }

/* Control on the product page */
.cegt-control-wrap { margin: 12px 0; }

/* La fiche en deux colonnes place form.cart en grille : le contrôle reste dans la colonne gauche. */
body.ce-product-v2.single-product form.cart .cegt-control-wrap,
body.ce-product-v2.single-product .ce-product-v2-info-col form.cart .cegt-control-wrap {
    grid-column: 1 !important;
    width: 100% !important;
    margin: 12px 0 !important;
}

.cegt-control {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dcdce0;
    border-radius: 8px;
    background: #fff;
    color: var(--cegt-ink, #111);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cegt-control:hover, .cegt-control:focus-visible {
    border-color: #6f1b2a;
    box-shadow: 0 0 0 1px rgba(111, 27, 42, .15);
}

.cegt-control__icon { display: inline-flex; color: #111; }
.cegt-control__icon img { display: block; width: 34px; height: 30px; object-fit: contain; }
.cegt-control__label { flex: 1 1 auto; }
.cegt-control__chevron { display: inline-flex; color: #111; }

@media (max-width: 640px) {
    .cegt-drawer { width: 100%; }
    .cegt-row { flex-wrap: wrap; gap: 8px; }
    .cegt-row .cegt-field { flex: 1 1 100%; margin-bottom: 0; }
    .cegt-row .cegt-units { flex: 0 0 auto; margin-bottom: 4px; }
    .cegt-select { font-size: 16px; }
    .cegt-drawer__head { padding: 18px 52px 12px 18px; }
    .cegt-drawer__head h2 { font-size: 22px; }
    .cegt-drawer__body { padding: 4px 18px 24px; }
    .cegt-figure { padding: 2px 58px 4px; }
    .cegt-figure__media { max-width: 148px; }
    .cegt-callout { width: 72px; font-size: 11px; }
    .cegt-callout__label { font-size: 11px; }
    .cegt-callout__value { font-size: 11.5px; }
    .cegt-measures { margin-top: 10px; }
    .cegt-control { font-size: 16px; padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .cegt-overlay, .cegt-drawer { transition: none; }
}
