/* ============================================================
   WC Visual Options – Frontend Styles v2
   ============================================================ */

.wcvo-option-groups {
    margin: 0 0 24px;
    font-family: inherit;
}

/* ── GROUP FIELDSET ── */
.wcvo-group {
    margin-bottom: 32px;
    border: none;
    padding: 0;
}

.wcvo-group-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 0;
}

.wcvo-required-star { color: #e74c3c; font-size: 16px; line-height: 1; }

.wcvo-multi-badge {
    font-size: 10px;
    font-weight: 600;
    background: #e8f4fd;
    color: #2980b9;
    border: 1px solid #aed6f1;
    border-radius: 20px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ══════════════════════════════════════════
   SUBCATEGORY TABS
══════════════════════════════════════════ */
.wcvo-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 0;
}

.wcvo-subtab {
    position: relative;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color .18s, background .18s;
    bottom: -2px;
    border-bottom: 2px solid transparent;
    outline: none;
    letter-spacing: .02em;
}

.wcvo-subtab:hover {
    color: #2271b1;
    background: #f0f6ff;
}

.wcvo-subtab-active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    background: #f0f6ff;
}

/* ── SUBPANELS ── */
.wcvo-subpanel {
    display: none;
}
.wcvo-subpanel-active {
    display: block;
}

/* ══════════════════════════════════════════
   OPTIONS GRID
══════════════════════════════════════════ */
.wcvo-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

/* ── OPTION CARD ── */
.wcvo-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    background: #fff;
    user-select: none;
}

.wcvo-option-card:hover {
    border-color: #a8c9f0;
    box-shadow: 0 4px 12px rgba(39,110,196,.15);
    transform: translateY(-2px);
}

.wcvo-option-card.wcvo-selected {
    border-color: #2271b1;
    box-shadow: 0 4px 16px rgba(34,113,177,.25);
}

.wcvo-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ── CARD IMAGE ── */
.wcvo-card-image {
    position: relative;
    width: 100%;
    padding-top: 85%;
    overflow: hidden;
    background: #f5f5f5;
}

.wcvo-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.wcvo-option-card:hover .wcvo-card-image img { transform: scale(1.04); }

.wcvo-card-no-image {
    position: relative;
    width: 100%;
    padding-top: 50%;
    background: linear-gradient(135deg, #f0f4f8, #dde4ee);
}

/* ── CHECK OVERLAY ── */
.wcvo-check-overlay {
    position: absolute;
    inset: 0;
    background: rgba(34,113,177,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    backdrop-filter: blur(2px);
}

.wcvo-check-overlay svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

.wcvo-option-card.wcvo-selected .wcvo-check-overlay { opacity: 1; }

/* ── CARD INFO ── */
.wcvo-card-info {
    padding: 8px 8px 10px;
    text-align: center;
    width: 100%;
}

.wcvo-card-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    margin-bottom: 4px;
}

.wcvo-card-price-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: #eaf3fb;
    color: #2271b1;
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.4;
}

.wcvo-option-card.wcvo-selected .wcvo-card-price-badge {
    background: #2271b1;
    color: #fff;
}

/* ── PRICE SUMMARY ── */
.wcvo-price-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    padding: 14px 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.wcvo-price-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #50575e;
}

#wcvo-total-price {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    transition: all .2s;
}

#wcvo-total-price.wcvo-price-updating {
    opacity: .4;
    transform: scale(.97);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .wcvo-options-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
    .wcvo-subtab { padding: 7px 12px; font-size: 12px; }
}

/* ── CONDITIONAL LOGIC — hidden groups ── */
.wcvo-group-hidden {
    display: none;
}

/* Smooth reveal animation */
fieldset.wcvo-group {
    transition: opacity 0.2s ease;
}

/* ══════════════════════════════════════════
   CENTERED LAYOUT (Feature 2)
══════════════════════════════════════════ */
.wcvo-group.wcvo-centered .wcvo-group-legend {
    justify-content: center;
}

.wcvo-group.wcvo-centered .wcvo-options-grid {
    justify-items: center;
    grid-template-columns: repeat(auto-fill, minmax(110px, max-content));
    justify-content: center;
}

.wcvo-group.wcvo-centered .wcvo-card-info {
    text-align: center;
}

.wcvo-group.wcvo-centered .wcvo-subtabs {
    justify-content: center;
}

/* ══════════════════════════════════════════
   CART SELECTIONS PANEL (Feature 1)
══════════════════════════════════════════ */
.wcvo-cart-panel {
    margin-top: 10px;
    background: #f8faff;
    border: 1px solid #d0ddf5;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
}

.wcvo-cart-panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6b7a9a;
    margin-bottom: 8px;
}

.wcvo-cart-selections-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wcvo-cart-selection-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: 6px;
    padding: 6px 10px;
    transition: opacity .2s, transform .2s;
}

.wcvo-cart-selection-item.wcvo-removing {
    opacity: .4;
    transform: translateX(8px);
}

.wcvo-cart-sel-group {
    font-weight: 600;
    color: #2271b1;
    font-size: 12px;
    white-space: nowrap;
}

.wcvo-cart-sel-arrow {
    color: #9aa5b8;
    font-size: 14px;
    line-height: 1;
}

.wcvo-cart-sel-choice {
    color: #1d2327;
    font-size: 13px;
    flex: 1;
}

.wcvo-cart-remove-sel {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background .15s;
    line-height: 1;
    display: flex;
    align-items: center;
}

.wcvo-cart-remove-sel:hover {
    background: #fde8e8;
}

.wcvo-cart-remove-x {
    color: #cc1818;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ══════════════════════════════════════════
   [wcvo_cart_selections] SHORTCODE WIDGET
══════════════════════════════════════════ */
.wcvo-selections-widget {
    margin: 20px 0;
    font-family: inherit;
}

.wcvo-selections-widget-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #50575e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
}

.wcvo-widget-item {
    margin-bottom: 16px;
    background: #f8faff;
    border: 1px solid #d0ddf5;
    border-radius: 10px;
    padding: 12px 14px;
}

.wcvo-widget-product-name {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 8px;
}

.wcvo-widget-selections {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wcvo-widget-sel-row {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    transition: opacity .2s;
}

.wcvo-widget-group {
    font-weight: 600;
    color: #2271b1;
    font-size: 12px;
    white-space: nowrap;
}

.wcvo-widget-arrow {
    color: #9aa5b8;
    font-size: 15px;
    line-height: 1;
}

.wcvo-widget-choice {
    flex: 1;
    color: #1d2327;
}

.wcvo-widget-remove {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    color: #cc1818;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background .15s;
    flex-shrink: 0;
}

.wcvo-widget-remove:hover {
    background: #fde8e8;
}

/* ══════════════════════════════════════════
   CART TABLE — YOUR SELECTIONS COLUMN
══════════════════════════════════════════ */
th.wcvo-sel-header {
    white-space: nowrap;
    font-size: 13px;
}

td.product-wcvo-selections {
    vertical-align: top;
    min-width: 160px;
}

.wcvo-sel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcvo-sel-row {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8faff;
    border: 1px solid #d0ddf5;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 12px;
    transition: opacity .2s;
}

.wcvo-sel-group {
    font-weight: 700;
    color: #2271b1;
    white-space: nowrap;
    font-size: 11px;
}

.wcvo-sel-arrow {
    color: #9aa5b8;
    font-size: 13px;
    flex-shrink: 0;
}

.wcvo-sel-choice {
    flex: 1;
    color: #1d2327;
    font-size: 12px;
}

.wcvo-sel-remove {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    color: #cc1818;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    transition: background .15s;
    margin-left: auto;
}

.wcvo-sel-remove:hover { background: #fde8e8; }

.wcvo-no-sel { color: #aaa; font-size: 12px; }

@media (max-width: 768px) {
    td.product-wcvo-selections {
        display: block;
        width: 100%;
    }
    td.product-wcvo-selections::before {
        content: attr(data-title) ": ";
        font-weight: 700;
    }
}
