/* ============================================================================
   Quick-add popup for configurable products — Studioone.
   Self-contained modal (loaded globally via Magento_Theme default_head_blocks),
   restyled to match the project swatches/buttons (round colour swatch + check,
   circle+label text swatch, amber pill CTA). Colours mirror the SASS tokens:
   $siteColor #FFA723, $siteHover #FF6600, $borderDark #CFCFCF, $textColor #1B1A18,
   $error #E33647. Icons use the theme icomoon font ('icon'): close \e904, check \e905.
   ============================================================================ */

.quick-add-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.quick-add-popup._show {
    display: flex;
}

.quick-add-popup .modal-inner-wrap {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    box-sizing: border-box;
    /* kill the Magento module default padding — header/content carry the padding */
    padding: 0;
}

.quick-add-popup .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 32px 32px 0;
}
.quick-add-popup .modal-title {
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 500;
    color: #1B1A18;
}

/* Close — theme icomoon glyph, amber on hover (like .modal-popup .action-close) */
.quick-add-popup .action-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1;
    background: none;
    border: 0;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #1B1A18;
    line-height: 0;
    transition: color 0.3s;
}
.quick-add-popup .action-close:hover {
    color: #FF6600;
}
.quick-add-popup .action-close > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.quick-add-popup .action-close::before {
    content: "\e904";
    font-family: 'icon';
    font-size: 2.4rem;
    line-height: 1;
    display: block;
}

.quick-add-popup .modal-content {
    padding: 24px 32px 32px;
}

/* Attribute groups */
.quick-add-popup .quick-add-attribute {
    margin-bottom: 24px;
}
.quick-add-popup .quick-add-attribute-label {
    display: block;
    font-size: 1.6rem;
    font-weight: 500;
    color: #1B1A18;
    margin-bottom: 14px;
}
.quick-add-popup .quick-add-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
}

/* ---- Colour swatch: 30px round, white check when selected (mirrors .swatch-option.color) */
.quick-add-popup .swatch-option.color {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s;
}
.quick-add-popup .swatch-option.color:hover {
    opacity: 0.7;
}
.quick-add-popup .swatch-option.color.selected {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.quick-add-popup .swatch-option.color.selected::before {
    content: "\e905";
    font-family: 'icon';
    font-size: 2.4rem;
}

/* ---- Text swatch: circle + label radio (mirrors .swatch-option.text) */
.quick-add-popup .swatch-option:not(.color) {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.6rem;
    color: #1B1A18;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}
.quick-add-popup .swatch-option:not(.color)::before {
    content: "";
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0 solid #FF6600;
    box-shadow: inset 0 0 0 1px #D8D8D8;
    margin-right: 14px;
    transition: box-shadow 0.3s, background 0.3s, border-width 0.3s;
}
.quick-add-popup .swatch-option:not(.color):hover {
    color: #FFA723;
}
.quick-add-popup .swatch-option:not(.color):hover::before {
    box-shadow: inset 0 0 0 1px #FFA723;
}
.quick-add-popup .swatch-option:not(.color).selected {
    pointer-events: none;
}
.quick-add-popup .swatch-option:not(.color).selected::before {
    border-width: 2px;
    background: #FF6600;
    box-shadow: inset 0 0 0 2px #fff;
}

.quick-add-popup .quick-add-error {
    color: #E33647;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

/* Apply CTA — matches the site primary button (square, amber; %primaryBtn / .action.tocart) */
.quick-add-popup .quick-add-apply {
    width: 100%;
    height: 49px;
    margin-top: 8px;
    padding: 0 34px;
    background: #FFA723;
    border: none;
    border-radius: 0;
    color: #1B1A18;
    font-size: 1.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}
.quick-add-popup .quick-add-apply:hover {
    background: #FF6600;
}

body._has-modal {
    overflow: hidden;
}

/* TIME-129: the overlay is translucent (rgba(0,0,0,.6)), so the listing cards' bright amber
   "Add to Cart" buttons show through it while the quick-add modal is open — they read as still
   active behind the dim. Hide the card triggers/tocart for the duration the popup is shown.
   visibility (not display) keeps their box, so nothing reflows behind the modal. Scoped to the
   open popup via :has() so unrelated modals don't touch the grid. */
body:has(#quick-add-popup._show) .products.wrapper .action.tocart,
body:has(#quick-add-popup._show) .products.wrapper .quick-add-trigger {
    visibility: hidden;
}

@media (max-width: 480px) {
    .quick-add-popup .modal-header { padding: 24px 20px 0; }
    .quick-add-popup .modal-content { padding: 20px; }
}
