/* ============================================================
   WVS Variation Swatches — Modern Gradient Style Override
   Targets: WooCommerce Variation Swatches plugin (.variable-item)
   ============================================================ */

/* Base pill / button swatch */
.variable-items-wrapper.button-variable-items-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    margin: 6px 0 12px !important;
}

.variable-item.button-variable-item {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #374151 !important;
    font-size: .82rem !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    cursor: pointer;
    transition: all .18s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), inset 0 1px 0 rgba(255,255,255,.8) !important;
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.variable-item.button-variable-item::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transition: left .35s ease;
    pointer-events: none;
}
.variable-item.button-variable-item:hover::before {
    left: 120%;
}

/* Hover state */
.variable-item.button-variable-item:hover {
    border-color: #94a3b8 !important;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.9) !important;
    transform: translateY(-1px) !important;
    color: #111827 !important;
}

/* Selected / active state */
.variable-item.button-variable-item.selected,
.variable-item.button-variable-item[aria-checked="true"] {
    border-color: #1e40af !important;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37,99,235,.35), inset 0 1px 0 rgba(255,255,255,.2) !important;
    transform: translateY(-1px) !important;
}
.variable-item.button-variable-item.selected .variable-item-span,
.variable-item.button-variable-item[aria-checked="true"] .variable-item-span {
    color: #fff !important;
}

/* Disabled / out-of-stock */
.variable-item.button-variable-item.disabled,
.variable-item.button-variable-item.out-of-stock {
    opacity: .45 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Inner span */
.variable-item.button-variable-item .variable-item-span {
    font-size: .82rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: .01em;
}

/* Attribute label row (RAM:, Storage:) */
.variations th.label label {
    font-size: .82rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    color: #374151 !important;
}

/* ============================================================
   Laptop Grade Badge v2 — Variation Switcher + Grade Badge
   ============================================================ */

/* ── Grade Badge Wrapper ──────────────────────────────────── */
.lgb-wrapper {
    margin: 18px 0 20px;
    font-family: inherit;
}

/* Section label row */
.lgb-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.lgb-label-text {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6b7280;
}
.lgb-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    transition: background .15s, border-color .15s, color .15s;
}
.lgb-info-btn:hover { background: #111827; border-color: #111827; color: #fff; }

/* ── ROW 1: Horizontal grade pills ─────────────────────────── */
.lgb-grade-pills {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lgb-grade-pill {
    flex: 1;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 8px 9px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
    position: relative;
    overflow: hidden;
}
.lgb-grade-pill::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gc, #111);
    opacity: 0;
    transition: opacity .18s;
}
.lgb-grade-pill:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    transform: translateY(-1px);
}
.lgb-grade-pill:hover::before { opacity: 1; }

.lgb-grade-pill.lgb-grade-active {
    border-color: var(--gc, #111);
    background: color-mix(in srgb, var(--gc, #111) 6%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc, #111) 15%, transparent);
    transform: translateY(-1px);
}
.lgb-grade-pill.lgb-grade-active::before { opacity: 1; }

.lgb-pill-letter {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--gc, #111);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    flex-shrink: 0;
}
.lgb-pill-name {
    font-size: .73rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.lgb-pill-chip {
    font-size: .68rem;
    font-weight: 700;
    color: var(--gc, #111);
    background: color-mix(in srgb, var(--gc, #111) 12%, #fff);
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── ROW 2: Selected grade detail card ─────────────────────── */
.lgb-detail-row { min-height: 0; }

.lgb-detail-card {
    display: none;
    border: 1.5px solid color-mix(in srgb, var(--gc, #111) 30%, #e5e7eb);
    border-radius: 12px;
    padding: 13px 15px;
    background: color-mix(in srgb, var(--gc, #111) 4%, #fff);
    animation: lgbSlideIn .2s ease;
}
.lgb-detail-card.lgb-detail-visible { display: block; }

@keyframes lgbSlideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: none; }
}

.lgb-dc-top {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 8px;
}
.lgb-dc-letter {
    width: 38px; height: 38px;
    border-radius: 9px;
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.lgb-dc-text {
    flex: 1;
    display: flex; flex-direction: column; gap: 2px;
}
.lgb-dc-text strong { font-size: .88rem; color: #111827; line-height: 1.2; }
.lgb-dc-text span   { font-size: .76rem; color: #6b7280; }

.lgb-dc-price {
    font-size: .76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--gc, #111) 15%, #fff);
    color: var(--gc, #111);
    white-space: nowrap;
    flex-shrink: 0;
}
.lgb-dc-best { background: #dcfce7; color: #15803d; }

.lgb-dc-desc {
    font-size: .8rem;
    color: #4b5563;
    line-height: 1.65;
    margin: 0;
}

/* ── Modal ────────────────────────────────────────────────── */
.lgb-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99999;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
@media (min-width: 600px) {
    .lgb-modal-overlay { align-items: center; }
}
.lgb-modal-overlay.lgb-open { display: flex; }

.lgb-modal {
    background: #fff;
    width: 100%;
    max-width: 460px;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
    animation: lgbModalUp .22s ease;
}
@media (min-width: 600px) {
    .lgb-modal { border-radius: 16px; animation: lgbModalZoom .22s ease; }
}
@keyframes lgbModalUp   { from { transform: translateY(60px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes lgbModalZoom { from { transform: scale(.93); opacity:0; } to { transform:none; opacity:1; } }

/* drag handle on mobile */
.lgb-modal::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    margin: 10px auto 0;
}
@media (min-width: 600px) { .lgb-modal::before { display: none; } }

.lgb-modal-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 700; font-size: .95rem; color: #111827;
}
.lgb-modal-close {
    background: none; border: none; font-size: 1rem;
    cursor: pointer; color: #9ca3af; padding: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.lgb-modal-close:hover { background: #fee2e2; color: #dc2626; }

.lgb-modal-item {
    padding: 15px 18px;
    border-bottom: 1px solid #f3f4f6;
}
.lgb-modal-item:last-child { border-bottom: none; }
.lgb-mi-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.lgb-mi-letter {
    width: 34px; height: 34px;
    border-radius: 8px; color: #fff;
    font-weight: 800; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lgb-mi-head strong { display: block; font-size: .87rem; color: #111827; }
.lgb-mi-head span   { font-size: .75rem; color: #6b7280; }
.lgb-modal-item p   { font-size: .8rem; color: #4b5563; line-height: 1.65; margin: 0; }

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
    .lgb-grade-pills { gap: 7px; }
    .lgb-grade-pill  { min-width: 80px; padding: 8px 6px 7px; }
    .lgb-pill-letter { width: 28px; height: 28px; font-size: .9rem; border-radius: 7px; }
    .lgb-pill-name   { font-size: .68rem; }
    .lgb-pill-chip   { font-size: .63rem; padding: 2px 6px; }
    .lgb-swatches    { gap: 6px; }
    .lgb-swatch      { padding: 6px 13px; font-size: .79rem; }
}
