/*
 * co-options.css - product options of the "co_" book configurator
 * (loaded by Magento_Catalog/templates/product/view/options/wrapper.phtml only when an option has a co_ css_class)
 *
 * Design reference: onprintshop "Tarjetas de plástico PVC" configurator
 *   - option label above a row of white, bordered, 8px-rounded buttons
 *   - bold navy title + small muted subtitle
 *   - selected button = solid navy with white text
 *   - plain fields = label on the left, control on the right
 */

#product-options-wrapper.co_options {
    --co-navy: #1e3a5f;
    --co-navy-hover: #2a4a75;
    --co-text: #1f2937;
    --co-muted: #6b7c93;
    --co-border: #d5e0ec;
    --co-border-strong: #9db3cc;
    --co-soft: #f3f6fa;
    --co-radius: 8px;
    --co-focus: 0 0 0 3px rgba(30, 58, 95, .16);
}

/* ------------------------------------------------------------------ layout (label on the left, control on the right) */
#product-options-wrapper.co_options .fieldset {
    display: block;
    margin: 0;
}

#product-options-wrapper.co_options .field.co_option {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 18px !important;
    padding: 0;
}

#product-options-wrapper.co_options .field.co_option > .label {
    display: block;
    flex: 0 0 200px;
    float: none;
    width: 200px;
    margin: 0;
    padding: 8px 16px 0 0;
    box-sizing: border-box;
    color: var(--co-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
}

#product-options-wrapper.co_options .field.co_option > .control {
    position: relative;
    flex: 1 1 auto;
    float: none;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 767px) {
    #product-options-wrapper.co_options .field.co_option {
        flex-wrap: wrap;
    }

    #product-options-wrapper.co_options .field.co_option > .label {
        flex-basis: 100%;
        width: 100%;
        padding: 0 0 6px;
    }

    #product-options-wrapper.co_options .field.co_option > .control {
        flex-basis: 100%;
    }
}

/* section headings (Interior / Cubierta) */
#product-options-wrapper.co_options .co_section_title {
    margin: 30px 0 16px;
    padding: 0;
    color: var(--co-navy);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

/* ------------------------------------------------------------------ button groups (co_ui_buttons) */
#product-options-wrapper.co_options .co_btn_group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#product-options-wrapper.co_options .co_btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    flex: 1 1 150px;
    max-width: 240px;
    min-height: 64px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    background: #fff;
    box-shadow: none;
    color: var(--co-navy);
    font-family: inherit;
    line-height: 1.25;
    text-align: center;
    text-transform: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

#product-options-wrapper.co_options .co_btn_title {
    font-size: 15px;
    font-weight: 700;
}

#product-options-wrapper.co_options .co_btn_sub {
    display: none; /* sub notes hidden for now - remove this line to show them again (texts: CONFIG.subtitles) */
    color: var(--co-muted);
    font-size: 12px;
    font-weight: 400;
}

#product-options-wrapper.co_options .co_btn:hover:not(:disabled) {
    border-color: var(--co-border-strong);
    background: #fff;
    color: var(--co-navy);
}

#product-options-wrapper.co_options .co_btn:focus-visible {
    outline: 2px solid #4c8bd6;
    outline-offset: 2px;
}

#product-options-wrapper.co_options .co_btn.co_selected,
#product-options-wrapper.co_options .co_btn.co_selected:hover:not(:disabled) {
    border-color: var(--co-navy);
    background: var(--co-navy);
    box-shadow: 0 4px 10px rgba(30, 58, 95, .28);
    color: #fff;
}

#product-options-wrapper.co_options .co_btn.co_selected .co_btn_sub {
    color: rgba(255, 255, 255, .8);
}

#product-options-wrapper.co_options .co_btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* native controls behind the buttons stay in the DOM (validation, price, add to cart) but are not visible */
#product-options-wrapper.co_options .co_native_hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    opacity: 0;
    pointer-events: none;
}

/* co_hide_label: label kept for screen readers only */
#product-options-wrapper.co_options .field.co_option.co_hide_label > .label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* the "None" radio Magento adds to optional radio groups */
#product-options-wrapper.co_options .co_none_hidden {
    display: none !important;
}

/* ------------------------------------------------------------------ dependency / tab states (keep last) */
#product-options-wrapper.co_options .field.co_option.co_hidden,
#product-options-wrapper.co_options .field.co_option.co_tab_hidden {
    display: none !important;
}

#product-options-wrapper.co_options div.mage-error {
    margin-top: 6px;
    font-size: 13px;
}

/* ------------------------------------------------------------------ quantity (taken from Copias, see co-options.js) */
body.co-book-product .box-tocart .field.qty {
    display: none !important;
}
