/**
 * AOE Kit Builder - Frontend Styles
 *
 * Based on mockup design with red (#8B0000) accent color
 */

/* Variables */
:root {
    --aoe-kit-accent: #8B0000;
    --aoe-kit-accent-hover: #6d0000;
    --aoe-kit-text: #333;
    --aoe-kit-text-light: #666;
    --aoe-kit-border: #ddd;
    --aoe-kit-bg: #f9f9f9;
}

/* Container */
.aoe-kit-builder {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Hero Section */
.aoe-kit-hero {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 60px 20px;
    min-height: 500px;
}

.aoe-kit-hero__content {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    max-width: 500px;
    margin-right: 60px; /* Gap fallback */
}

.aoe-kit-hero__title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px;
    color: var(--aoe-kit-text);
}

.aoe-kit-hero__description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--aoe-kit-text-light);
    margin: 0 0 30px;
}

.aoe-kit-hero__cta {
    display: inline-block;
    padding: 14px 32px;
    background: var(--aoe-kit-accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.aoe-kit-hero__cta:hover {
    background: var(--aoe-kit-accent-hover);
    color: #fff;
}

.aoe-kit-hero__image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.aoe-kit-hero__image img {
    max-width: 100%;
    max-height: 600px;
    height: auto;
    width: auto;
    display: block;
}

/* Wrapper for image with hotspots - needed for proper positioning */
.aoe-kit-hero__image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0; /* Remove any extra space below image */
}

/* Hotspots */
.aoe-kit-hotspot {
    position: absolute;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.aoe-kit-hotspot__marker {
    width: 20px;
    height: 20px;
    background: var(--aoe-kit-accent);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.aoe-kit-hotspot:hover .aoe-kit-hotspot__marker {
    transform: scale(1.3);
}

.aoe-kit-hotspot__label {
    margin-left: 8px;
    padding: 6px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.aoe-kit-hotspot__line {
    width: 40px;
    height: 2px;
    background: var(--aoe-kit-accent);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Main Layout */
.aoe-kit-main {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    padding: 0 20px 60px;
}

/* Gap fallback for Safari < 14.1 */
.aoe-kit-categories {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 380px); /* 350px sidebar + 30px gap */
    margin-right: 30px;
    overflow: hidden; /* Contain overflowing content */
}

/* Accordion */
.aoe-kit-accordion {
    border: 1px solid var(--aoe-kit-border);
    margin-bottom: -1px;
}

.aoe-kit-accordion__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
}

.aoe-kit-accordion__header:hover {
    background: var(--aoe-kit-bg);
}

.aoe-kit-accordion__title {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.aoe-kit-accordion__title > * + * {
    margin-left: 12px; /* Gap fallback */
}

.aoe-kit-accordion__icon {
    transition: transform 0.3s;
}

.aoe-kit-accordion.is-open .aoe-kit-accordion__icon {
    transform: rotate(180deg);
}

.aoe-kit-accordion__content {
    display: none;
    padding: 20px;
    background: var(--aoe-kit-bg);
    border-top: 1px solid var(--aoe-kit-border);
}

.aoe-kit-accordion.is-open .aoe-kit-accordion__content {
    display: block;
}

.aoe-kit-accordion__category-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.aoe-kit-accordion__category-icon.dashicons {
    font-size: 24px;
    line-height: 1;
}

.aoe-kit-accordion__name {
    font-weight: 600;
}

.aoe-kit-accordion__description {
    font-size: 13px;
    font-weight: 400;
    color: var(--aoe-kit-text-light);
    margin-left: 10px;
}

/* No Products/Categories Messages */
.aoe-kit-no-products,
.aoe-kit-no-categories {
    padding: 40px 20px;
    text-align: center;
    color: var(--aoe-kit-text-light);
    font-style: italic;
}

/* Hero Placeholder */
.aoe-kit-hero__placeholder {
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aoe-kit-bg);
    border: 2px dashed var(--aoe-kit-border);
    color: var(--aoe-kit-text-light);
}

/* Error Message */
.aoe-kit-error {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    text-align: center;
}

/* Cart Kit Items */
.aoe-kit-cart-item {
    border-left: 3px solid var(--aoe-kit-accent, #8B0000) !important;
}

.aoe-kit-cart-item td {
    background: rgba(139, 0, 0, 0.02);
}

/* Product Grid */
.aoe-kit-products {
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Grid gap fallback for very old browsers */
@supports not (gap: 20px) {
    .aoe-kit-products {
        margin: -10px;
    }
    .aoe-kit-product {
        margin: 10px;
    }
}

@media (min-width: 1271px) and (max-width: 1410px) {
    h3.aoe-kit-product__title,
    .entry-content h3.aoe-kit-product__title {
        font-size: 15px;
    }
}

@media (min-width: 1201px) and (max-width: 1270px) {
    h3.aoe-kit-product__title,
    .entry-content h3.aoe-kit-product__title {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .aoe-kit-products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .aoe-kit-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .aoe-kit-products {
        grid-template-columns: 1fr;
    }
}

/* Product Card */
.aoe-kit-product {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--aoe-kit-border);
    padding: 15px;
    overflow: hidden;
}

.aoe-kit-product__image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 aspect ratio fallback for Safari < 15 */
    margin-bottom: 15px;
    background: #fff;
    overflow: hidden;
}

/* Use aspect-ratio where supported, removing the padding hack */
@supports (aspect-ratio: 1) {
    .aoe-kit-product__image {
        height: auto;
        padding-bottom: 0;
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.aoe-kit-product__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Absolute positioning for padding-bottom fallback */
@supports not (aspect-ratio: 1) {
    .aoe-kit-product__image img {
        position: absolute;
        top: 50%;
        left: 50%;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
    }
}

h3.aoe-kit-product__title,
.entry-content h3.aoe-kit-product__title {
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.3;
    min-height: 36px;
    color: var(--wp--preset--color--primary);
    font-family: inherit;
}

.aoe-kit-product__options {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.aoe-kit-product__options > * + * {
    margin-left: 8px;
}

.aoe-kit-product__option {
    -webkit-flex: 1 1 0%;
    flex: 1 1 0%;
    min-width: 0;
    margin-bottom: 0;
}

.aoe-kit-product__option label {
    display: block;
    font-size: 12px;
    color: var(--aoe-kit-text-light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom select — consistent across Chrome, Safari, Firefox */
.aoe-kit-product__option select {
    width: 100%;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: var(--aoe-kit-text);
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
    cursor: pointer;
    outline: none;
}

.aoe-kit-product__option select:focus {
    border-color: var(--aoe-kit-accent);
    box-shadow: 0 0 0 1px var(--aoe-kit-accent);
}

/* IE/Edge legacy dropdown arrow hide */
.aoe-kit-product__option select::-ms-expand {
    display: none;
}

/* ── Custom Dropdown Component ── */
/* Replaces native <select> with a consistent cross-browser UI */

.aoe-select {
    position: relative;
    width: 100%;
}

.aoe-select__trigger {
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    color: var(--aoe-kit-text);
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    -webkit-transition: border-color 0.15s, box-shadow 0.15s;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.aoe-select__trigger:hover {
    border-color: #bbb;
}

.aoe-select__trigger:focus {
    outline: none;
    border-color: var(--aoe-kit-accent);
    box-shadow: 0 0 0 1px var(--aoe-kit-accent);
}

.aoe-select__trigger--placeholder .aoe-select__value {
    color: var(--aoe-kit-text-light);
}

.aoe-select__value {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.aoe-select__arrow {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    color: var(--aoe-kit-text-light);
    -webkit-transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
}

.aoe-select.is-open .aoe-select__arrow {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

.aoe-select.is-open .aoe-select__trigger {
    border-color: var(--aoe-kit-accent);
    box-shadow: 0 0 0 1px var(--aoe-kit-accent);
}

.aoe-select__panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    -webkit-overflow-scrolling: touch;
}

/* Product card dropdowns: constrain to ~3.5 visible items */
.aoe-kit-product .aoe-select__panel {
    max-height: calc(3.5 * 34px); /* ~119px — shows 3.5 rows to hint scrollability */
}

.aoe-select.is-open .aoe-select__panel {
    display: block;
}

.aoe-select__option {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--aoe-kit-text);
    cursor: pointer;
    line-height: 1.4;
    -webkit-transition: background 0.1s;
    transition: background 0.1s;
}

.aoe-select__option:hover,
.aoe-select__option:focus {
    background: var(--aoe-kit-bg);
    outline: none;
}

.aoe-select__option.is-selected {
    background: rgba(139, 0, 0, 0.06);
    font-weight: 600;
    color: var(--aoe-kit-accent);
}

.aoe-select__option.is-selected:hover,
.aoe-select__option.is-selected:focus {
    background: rgba(139, 0, 0, 0.1);
}

/* Modal dropdowns — slightly larger padding */
.aoe-kit-modal .aoe-select__trigger {
    padding: 10px 12px;
    font-size: 14px;
}

.aoe-kit-modal .aoe-select__option {
    padding: 10px 12px;
    font-size: 14px;
}

.aoe-kit-modal .aoe-select__panel {
    max-height: 220px;
}

/* Hide the native select visually (JS adds inline styles too) */
select.aoe-select-upgraded {
    position: absolute !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.aoe-kit-product__price {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: auto; /* Push price to align across cards */
}

@media (min-width: 1411px) {
    .aoe-kit-product__price {
        font-size: 18px;
    }
}

@media (min-width: 1271px) and (max-width: 1410px) {
    .aoe-kit-product__price {
        font-size: 14px;
    }
}

@media (min-width: 1201px) and (max-width: 1270px) {
    .aoe-kit-product__price {
        font-size: 12px;
    }
}

.aoe-kit-product__actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    margin-top: 0; /* price has margin-top:auto, actions follow immediately */
}

.aoe-kit-product__actions > * + * {
    margin-top: 10px; /* Gap fallback */
}

.aoe-kit-product__quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--aoe-kit-border);
    width: 100%;
}

.aoe-kit-product__quantity button {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
}

.aoe-kit-product__quantity button:hover {
    background: var(--aoe-kit-bg);
}

.aoe-kit-product__quantity input {
    flex: 1;
    min-width: 40px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--aoe-kit-border);
    border-right: 1px solid var(--aoe-kit-border);
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

/* Hide native number input spinners */
.aoe-kit-product__quantity input::-webkit-outer-spin-button,
.aoe-kit-product__quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.aoe-kit-product__add {
    width: 100%;
    padding: 12px 15px;
    background: var(--aoe-kit-accent);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.aoe-kit-product__add:hover {
    background: var(--aoe-kit-accent-hover);
}

.aoe-kit-product__add:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Sidebar */
.aoe-kit-sidebar {
    width: 350px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 32px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.aoe-kit-sidebar__inner {
    background: #fff;
    border: 1px solid var(--aoe-kit-border);
}

.aoe-kit-sidebar__header {
    padding: 20px;
    border-bottom: 1px solid var(--aoe-kit-border);
}

.aoe-kit-sidebar__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.aoe-kit-sidebar__items {
    max-height: 400px;
    overflow-y: auto;
}

.aoe-kit-sidebar__empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--aoe-kit-text-light);
}

/* Sidebar Item */
.aoe-kit-item {
    display: -webkit-flex;
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid var(--aoe-kit-border);
}

.aoe-kit-item > * + * {
    margin-left: 15px; /* Gap fallback */
}

.aoe-kit-item:last-child {
    border-bottom: none;
}

.aoe-kit-item__image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.aoe-kit-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.aoe-kit-item__details {
    flex: 1;
    min-width: 0;
}

.aoe-kit-item__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px;
}

.aoe-kit-item__options {
    font-size: 11px;
    color: var(--aoe-kit-text-light);
    line-height: 1.4;
    margin-bottom: 8px;
}

.aoe-kit-item__quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.aoe-kit-item__quantity button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--aoe-kit-border);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.aoe-kit-item__price {
    text-align: right;
    white-space: nowrap;
}

.aoe-kit-item__price-value {
    font-size: 14px;
    font-weight: 600;
}

.aoe-kit-item__remove {
    font-size: 12px;
    color: var(--aoe-kit-accent);
    cursor: pointer;
}

.aoe-kit-item__remove:hover {
    text-decoration: underline;
}

/* Totals */
.aoe-kit-totals {
    padding: 20px;
    border-top: 1px solid var(--aoe-kit-border);
}

.aoe-kit-totals__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.aoe-kit-totals__row:last-child {
    margin-bottom: 0;
}

.aoe-kit-totals__row--total {
    font-weight: 600;
    font-size: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--aoe-kit-border);
    margin-top: 10px;
}

/* Sidebar Actions */
.aoe-kit-sidebar__actions {
    padding: 20px;
    border-top: 1px solid var(--aoe-kit-border);
}

.aoe-kit-sidebar__checkout {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--aoe-kit-accent);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.aoe-kit-sidebar__checkout:hover {
    background: var(--aoe-kit-accent-hover);
    color: #fff;
}

.aoe-kit-sidebar__checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.aoe-kit-sidebar__secondary {
    display: -webkit-flex;
    display: flex;
    margin-top: 10px;
}

.aoe-kit-sidebar__secondary > * + * {
    margin-left: 10px; /* Gap fallback */
}

.aoe-kit-sidebar__save,
.aoe-kit-sidebar__share {
    flex: 1;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--aoe-kit-border);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.aoe-kit-sidebar__save:hover,
.aoe-kit-sidebar__share:hover {
    background: var(--aoe-kit-bg);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .aoe-kit-hero {
        -webkit-flex-direction: column;
        flex-direction: column;
        text-align: center;
    }

    .aoe-kit-hero__content {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 30px;
    }

    .aoe-kit-main {
        -webkit-flex-direction: column;
        flex-direction: column;
    }

    .aoe-kit-categories {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 30px;
        overflow: visible;
    }

    .aoe-kit-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .aoe-kit-hero__title {
        font-size: 32px;
    }

    .aoe-kit-hotspot__label,
    .aoe-kit-hotspot__line {
        display: none;
    }
}

/* Configurator Product Card */
.aoe-kit-product__customize {
    width: 100%;
    padding: 12px 15px;
    background: var(--aoe-kit-accent);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.aoe-kit-product__customize:hover {
    background: var(--aoe-kit-accent-hover);
}

/* Configurator Modal */
.aoe-kit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aoe-kit-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.aoe-kit-modal *,
.aoe-kit-modal *::before,
.aoe-kit-modal *::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.aoe-kit-modal__container {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.aoe-kit-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--aoe-kit-border);
    background: var(--aoe-kit-bg);
}

.aoe-kit-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.aoe-kit-modal__message {
    margin: 0;
    padding: 1rem 0 0 1rem;
    font-size: 14px;
    color: #333;
}

.aoe-kit-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--aoe-kit-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aoe-kit-modal__close:hover {
    color: var(--aoe-kit-text);
}

.aoe-kit-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.2rem;
}

.aoe-kit-modal__product {
    display: flex;
    gap: 15px;
    padding: 1rem;
    border-bottom: 1px solid var(--aoe-kit-border);
}

.aoe-kit-modal__product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.aoe-kit-modal__product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.aoe-kit-modal__product-info {
    flex: 1;
}

.aoe-kit-modal__product-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.aoe-kit-modal__product-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--aoe-kit-accent);
}

.aoe-kit-modal__product-range {
    font-size: 12px;
    color: var(--aoe-kit-text-light);
    margin-top: 4px;
    line-height: 1.4;
}

.aoe-kit-modal__options {
    margin-bottom: 0;
}

.aoe-kit-modal__option {
    margin-bottom: 15px;
}

.aoe-kit-modal__option label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--aoe-kit-text);
    margin-bottom: 6px;
}

.aoe-kit-modal__option select {
    width: 100%;
    padding: 10px 28px 10px 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: var(--aoe-kit-text);
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    cursor: pointer;
}

.aoe-kit-modal__option select::-ms-expand {
    display: none;
}

.aoe-kit-modal__quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-top: 1px solid var(--aoe-kit-border);
}

.aoe-kit-modal__quantity label {
    font-size: 13px;
    font-weight: 500;
}

.aoe-kit-modal__quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--aoe-kit-border);
}

.aoe-kit-modal__quantity-controls button {
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
}

.aoe-kit-modal__quantity-controls button:hover {
    background: var(--aoe-kit-bg);
}

.aoe-kit-modal__quantity-controls input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--aoe-kit-border);
    border-right: 1px solid var(--aoe-kit-border);
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

/* Hide native number input spinners */
.aoe-kit-modal__quantity-controls input::-webkit-outer-spin-button,
.aoe-kit-modal__quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.aoe-kit-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid var(--aoe-kit-border);
    background: var(--aoe-kit-bg);
}

.aoe-kit-modal__summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aoe-kit-modal__summary-label {
    font-size: 12px;
    color: var(--aoe-kit-text-light);
}

.aoe-kit-modal__summary-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--aoe-kit-accent);
}

.aoe-kit-modal__add-to-kit {
    padding: 12px 24px;
    background: var(--aoe-kit-accent);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.aoe-kit-modal__add-to-kit:hover {
    background: var(--aoe-kit-accent-hover);
}

/* Sidebar Edit & Remove Actions */
.aoe-kit-item__actions {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-top: 5px;
}

.aoe-kit-item__actions > * + * {
    margin-left: 10px; /* Gap fallback */
}

.aoe-kit-item__edit {
    font-size: 12px;
    color: var(--aoe-kit-accent);
    cursor: pointer;
}

.aoe-kit-item__edit:hover {
    text-decoration: underline;
}

/* Modal Option Groups */
.aoe-kit-modal__option-group {
    padding: 1rem;
    margin-bottom: 0;
}

.aoe-kit-modal__option-group:nth-child(odd) {
    background: #fff;
}

.aoe-kit-modal__option-group:nth-child(even) {
    background: var(--aoe-kit-bg);
}

.aoe-kit-modal__option-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--aoe-kit-text);
}

.aoe-kit-modal__option-group select {
    width: 100%;
    padding: 10px 28px 10px 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: var(--aoe-kit-text);
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
}

.aoe-kit-modal__option-group select::-ms-expand {
    display: none;
}

.aoe-kit-modal__option-group select:focus {
    outline: none;
    border-color: var(--aoe-kit-accent);
}

.aoe-kit-modal__option-group.aoe-error select {
    border-color: #dc3545;
}

.aoe-kit-modal__option-group.aoe-error label::after {
    content: ' *';
    color: #dc3545;
}

/* Sidebar flash animation */
.aoe-kit-sidebar__items.aoe-flash {
    animation: aoe-flash-highlight 0.5s ease;
}

@keyframes aoe-flash-highlight {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(200, 16, 46, 0.1); }
}

/* Body modal open state */
body.aoe-modal-open {
    overflow: hidden;
    padding-right: var(--aoe-scrollbar-width, 0px); /* Prevent layout shift */
}

/* Save/Share Modal Specific Styles */
.aoe-kit-modal__container--small {
    max-width: 450px;
}

.aoe-kit-modal__field {
    padding: 1rem;
    margin-bottom: 0;
}

.aoe-kit-modal__field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--aoe-kit-text);
}

.aoe-kit-modal__field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    font-size: 14px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.aoe-kit-modal__field input[type="text"]:focus {
    outline: none;
    border-color: var(--aoe-kit-accent);
}

.aoe-kit-modal__notice {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

.aoe-kit-modal__notice--info {
    background: #e8f4fd;
    border: 1px solid #bee5ff;
    color: #0077b6;
}

.aoe-kit-modal__notice p {
    margin: 0;
}

.aoe-kit-modal__btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.aoe-kit-modal__btn--primary {
    background: var(--aoe-kit-accent);
    color: #fff;
}

.aoe-kit-modal__btn--primary:hover {
    background: var(--aoe-kit-accent-hover);
}

.aoe-kit-modal__btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aoe-kit-modal__btn--secondary {
    background: #f5f5f5;
    color: var(--aoe-kit-text);
}

.aoe-kit-modal__btn--secondary:hover {
    background: #e5e5e5;
}

/* Radio group for permissions */
.aoe-kit-modal__radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aoe-kit-modal__radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.aoe-kit-modal__radio:hover {
    border-color: var(--aoe-kit-accent);
}

.aoe-kit-modal__radio input[type="radio"] {
    margin-top: 3px;
}

.aoe-kit-modal__radio input[type="radio"]:checked + .aoe-kit-modal__radio-label {
    color: var(--aoe-kit-accent);
}

/* :has() fallback — JS adds this class for Safari < 15.4 */
.aoe-kit-modal__radio.is-checked,
.aoe-kit-modal__radio:has(input:checked) {
    border-color: var(--aoe-kit-accent);
    background: rgba(200, 16, 46, 0.03);
}

.aoe-kit-modal__radio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aoe-kit-modal__radio-label strong {
    font-size: 14px;
}

.aoe-kit-modal__radio-label small {
    font-size: 12px;
    color: var(--aoe-kit-text-light);
}

/* Copy field */
.aoe-kit-modal__copy-field {
    display: flex;
    gap: 8px;
}

.aoe-kit-modal__copy-field input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    font-size: 13px;
    background: #f9f9f9;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.aoe-kit-modal__copy-btn {
    padding: 10px 12px;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.aoe-kit-modal__copy-btn:hover {
    background: #f5f5f5;
}

.aoe-kit-modal__copy-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Success state */
.aoe-kit-modal__success {
    text-align: center;
    padding: 20px;
    margin-bottom: 15px;
}

.aoe-kit-modal__success .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #28a745;
    margin-bottom: 10px;
}

.aoe-kit-modal__success p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--aoe-kit-text);
}

.aoe-kit-modal__hint {
    font-size: 12px;
    color: var(--aoe-kit-text-light);
    margin-top: 10px;
}

/* Checkout Save Modal - stacked footer buttons */
.aoe-kit-modal__footer--stacked {
    flex-direction: column;
    gap: 8px;
}

/* Saved kits list */
.aoe-kit-modal__saved-kits h4 {
    font-size: 14px;
    margin: 0;
    padding: 1rem;
    border-top: 1px solid var(--aoe-kit-border);
}

.aoe-kit-modal__kits-list {
    max-height: 200px;
    overflow-y: auto;
}

.aoe-kit-modal__kit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem;
    border: 1px solid var(--aoe-kit-border);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.aoe-kit-modal__kit-item:hover {
    border-color: var(--aoe-kit-accent);
}

.aoe-kit-modal__kit-item-info {
    flex: 1;
}

.aoe-kit-modal__kit-item-name {
    font-weight: 600;
    font-size: 14px;
}

.aoe-kit-modal__kit-item-meta {
    font-size: 12px;
    color: var(--aoe-kit-text-light);
}

.aoe-kit-modal__kit-item-actions {
    display: flex;
    gap: 8px;
}

.aoe-kit-modal__kit-item-btn {
    padding: 5px 10px;
    font-size: 11px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.aoe-kit-modal__kit-item-btn--load {
    background: var(--aoe-kit-accent);
    color: #fff;
}

.aoe-kit-modal__kit-item-btn--delete {
    background: #f5f5f5;
    color: #dc3545;
}

/* Toast notifications */
#aoe-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.aoe-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 360px;
}

.aoe-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.aoe-toast--success {
    background: #2e7d32;
}

.aoe-toast--error {
    background: #8B0000;
}

.aoe-toast--info {
    background: #333;
}

.aoe-toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

.aoe-toast__message {
    flex: 1;
}

.aoe-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.aoe-toast__close:hover {
    color: #fff;
}

.variation-SKU p {
    line-height: inherit !important;
}