.mg-ca-options,
.mg-ca-options * {
    box-sizing: border-box;
}

.mg-ca-options {
    --mg-ca-ink: #222825;
    --mg-ca-muted: #6d746f;
    --mg-ca-line: #d9ddd9;
    --mg-ca-paper: #fff;
    --mg-ca-soft: #f5f6f4;
    --mg-ca-accent: #555d58;
    --mg-ca-selected: #496052;
    width: 100%;
    margin: 18px 0;
    color: var(--mg-ca-ink);
    font-family: inherit;
}

.mg-ca-ribbon {
    margin: 0 0 18px;
    padding-top: 14px;
    border-top: 1px solid #e7e7e7;
}

.mg-ca-ribbon-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.mg-ca-ribbon-label label {
    margin: 0;
    color: var(--mg-ca-ink);
    font-weight: 700;
    line-height: 1.35;
}

.mg-ca-ribbon-title {
    font-size: var(--mg-ca-ribbon-label-size, 14px);
}

.mg-ca-ribbon-optional {
    color: var(--mg-ca-muted);
    font-size: var(--mg-ca-ribbon-optional-size, 12px);
    font-weight: 400;
}

.mg-ca-ribbon-label small {
    flex: 0 0 auto;
    margin: 0;
    color: var(--mg-ca-accent);
    font-weight: 700;
    font-size: var(--mg-ca-ribbon-price-size, 12px);
}

.mg-ca-ribbon-input {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 11px;
    color: var(--mg-ca-ink);
    background: #fff;
    border: 1px solid #d5d9df;
    border-radius: 5px;
    box-shadow: none;
    font: inherit;
    font-size: var(--mg-ca-ribbon-placeholder-size, 14px);
    outline: none;
}

.mg-ca-ribbon-input:focus {
    background: #fff;
    border-color: var(--mg-ca-accent);
    box-shadow: 0 0 0 2px rgba(85, 93, 88, .10);
}

.mg-ca-ribbon-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
    color: var(--mg-ca-muted);
    line-height: 1.4;
}

.mg-ca-ribbon-notice {
    font-size: var(--mg-ca-ribbon-notice-size, 11px);
}

.mg-ca-counter {
    flex: 0 0 auto;
    font-size: var(--mg-ca-ribbon-counter-size, 11px);
    font-variant-numeric: tabular-nums;
}

.mg-ca-addon-block {
    position: relative;
}

.mg-ca-addons {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.mg-ca-addon-block + .mg-ca-addon-block {
    margin-top: 12px;
}

.mg-ca-addon-block[hidden],
.mg-ca-add-more[hidden],
.mg-ca-variations[hidden] {
    display: none !important;
}

.mg-ca-accordion {
    overflow: hidden;
    background: var(--mg-ca-paper);
    border: 1px solid var(--mg-ca-line);
    border-left: 5px solid var(--mg-ca-accent);
    border-radius: 10px;
}

.mg-ca-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 94px;
    padding: 17px 18px;
    background: linear-gradient(105deg, #fff 0%, #f5f6f4 100%);
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.mg-ca-accordion > summary::-webkit-details-marker {
    display: none;
}

.mg-ca-summary-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.mg-ca-summary-copy strong {
    color: var(--mg-ca-ink);
    font-weight: 700;
    line-height: 1.35;
}

.mg-ca-summary-copy .mg-ca-title-first {
    font-size: var(--mg-ca-addon-title-first-size, 16px);
}

.mg-ca-summary-copy .mg-ca-title-more {
    font-size: var(--mg-ca-addon-title-more-size, 16px);
}

.mg-ca-summary-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--mg-ca-accent);
    font-size: var(--mg-ca-addon-none-selected-size, 13px);
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-ca-summary-copy small.is-selected {
    color: var(--mg-ca-selected);
    font-weight: 600;
}

.mg-ca-summary-action {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    padding: 12px 14px;
    color: var(--mg-ca-accent);
    border: 1px solid var(--mg-ca-accent);
    border-radius: 8px;
    font-size: var(--mg-ca-addon-action-open-size, 12px);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mg-ca-summary-icon {
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s ease;
}

.mg-ca-accordion[open] > summary {
    background: linear-gradient(105deg, #fff 0%, #f1f3f1 100%);
}

.mg-ca-accordion[open] .mg-ca-summary-icon {
    transform: rotate(45deg);
}

.mg-ca-accordion[open] .mg-ca-summary-action {
    font-size: var(--mg-ca-addon-action-close-size, 12px);
}

.mg-ca-list {
    padding: 6px 10px 10px;
    background: var(--mg-ca-soft);
    border-top: 1px solid var(--mg-ca-line);
}

.mg-ca-addon-option + .mg-ca-addon-option,
.mg-ca-choice-row + .mg-ca-addon-option {
    border-top: 1px solid var(--mg-ca-line);
}

.mg-ca-choice-row,
.mg-ca-variation-row {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.mg-ca-choice-row > input,
.mg-ca-variation-row > input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.mg-ca-choice-ui {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 8px 9px;
    border-left: 2px solid transparent;
    transition: background-color .18s ease, border-color .18s ease;
}

.mg-ca-choice-row:hover .mg-ca-choice-ui {
    background: #fff;
}

.mg-ca-thumb,
.mg-ca-empty-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    overflow: hidden;
    color: #8b908c;
    background: #eceeeb;
    border: 1px solid var(--mg-ca-line);
    border-radius: 3px;
}

.mg-ca-thumb img,
.mg-ca-variation-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-ca-choice-name {
    flex: 1;
    min-width: 0;
    padding: 0 11px;
    color: var(--mg-ca-ink);
    font-size: var(--mg-ca-addon-product-size, 13px);
    font-weight: 500;
    line-height: 1.4;
}

.mg-ca-none-option {
    font-size: var(--mg-ca-addon-none-option-size, 13px);
}

.mg-ca-radio {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #929994;
    border-radius: 50%;
}

.mg-ca-radio::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--mg-ca-selected);
    border-radius: 50%;
    content: '';
    transform: translate(-50%, -50%) scale(0);
    transition: transform .18s ease;
}

.mg-ca-choice-row input:focus-visible + .mg-ca-choice-ui,
.mg-ca-variation-row input:focus-visible + .mg-ca-variation-ui {
    outline: 2px solid var(--mg-ca-accent);
    outline-offset: -2px;
}

.mg-ca-choice-row input:checked + .mg-ca-choice-ui {
    background: #fff;
    border-left-color: var(--mg-ca-selected);
}

.mg-ca-choice-row input:checked + .mg-ca-choice-ui .mg-ca-radio::after,
.mg-ca-variation-row input:checked + .mg-ca-variation-ui .mg-ca-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.mg-ca-variations {
    margin: 4px 8px 12px 54px;
    padding: 10px;
    background: #eceeeb;
    border-radius: 5px;
}

.mg-ca-variations > p {
    margin: 0 0 8px;
    color: var(--mg-ca-muted);
    font-size: var(--mg-ca-addon-variation-prompt-size, 11px);
    font-weight: 600;
}

.mg-ca-variation-row + .mg-ca-variation-row {
    margin-top: 7px;
}

.mg-ca-variation-ui {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 7px;
    background: #fff;
    border: 1px solid #d8dbd8;
    border-radius: 4px;
}

.mg-ca-variation-thumb {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    overflow: hidden;
    background: var(--mg-ca-soft);
    border-radius: 3px;
}

.mg-ca-variation-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: 0 10px;
}

.mg-ca-variation-copy strong {
    color: var(--mg-ca-ink);
    font-size: var(--mg-ca-addon-variation-name-size, 12px);
    line-height: 1.35;
}

.mg-ca-variation-copy small {
    margin-top: 3px;
    color: var(--mg-ca-selected);
    font-size: var(--mg-ca-addon-variation-price-size, 11px);
    font-weight: 600;
}

.mg-ca-variation-row input:checked + .mg-ca-variation-ui {
    border-color: var(--mg-ca-selected);
}

.mg-ca-add-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 9px;
    padding: 10px 12px;
    color: var(--mg-ca-accent);
    background: #fff;
    border: 1px solid #c8ccc9;
    border-radius: 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.mg-ca-add-more-label {
    font-size: var(--mg-ca-addon-add-more-size, 12px);
}

.mg-ca-add-more:hover {
    background: var(--mg-ca-soft);
}

.mg-ca-remove-block {
    position: absolute;
    top: -8px;
    right: -7px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #fff;
    background: var(--mg-ca-accent);
    border: 2px solid #fff;
    border-radius: 50%;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.woocommerce form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 480px) {
    .mg-ca-ribbon { padding-top: 12px; }
    .mg-ca-ribbon-meta { flex-direction: column; gap: 3px; }
    .mg-ca-accordion > summary { min-height: 84px; padding: 14px 12px; }
    .mg-ca-summary-action > span:first-child { display: none; }
    .mg-ca-summary-action { justify-content: center; width: 32px; height: 32px; padding: 0; }
    .mg-ca-list { padding-right: 6px; padding-left: 6px; }
    .mg-ca-variations { margin-right: 3px; margin-left: 3px; padding: 7px; }
}
