/* ============================================================================
   YAI Shade picker + size selector + kit components panel
   Save to: /var/www/yai/public/css/yai-shade.css
   ============================================================================ */

.yai-variant-row {
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
}

.yai-variant-row:first-of-type {
    border-top: none;
    padding-top: 6px;
}

/* ---------- Size selector buttons ---------------------------------------- */

.yai-size-btn {
    min-width: 92px;
    font-weight: 600;
    line-height: 1.15;
    padding: 8px 12px;
}

.yai-size-btn small {
    font-size: 10px;
    opacity: .7;
}

.yai-size-btn.active {
    background: var(--yai-blue, #1e3a8a) !important;
    color: #fff !important;
    border-color: var(--yai-blue, #1e3a8a) !important;
}

/* Kits get a distinct outline so they're visually different from solo sizes */
.yai-size-btn.is-kit {
    border-style: dashed;
}

.yai-size-btn.is-kit.active {
    border-style: solid;
}

/* ---------- Shade swatches = product photos ------------------------------ */

.yai-shade-chip {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    color: inherit;
    transition: transform .1s, background .1s;
    padding: 6px 8px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    min-width: 70px;
    max-width: 130px;
    height: auto;
    min-height: 82px;
}

.yai-shade-chip:hover {
    transform: translateY(-2px);
    background: #f3f4f6;
    color: inherit;
}

.yai-shade-chip.active {
    border-color: var(--yai-blue, #1e3a8a);
    background: #eef2ff;
}

.yai-shade-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #fff;
    display: block;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.yai-shade-chip.active .yai-shade-swatch {
    border-color: var(--yai-blue, #1e3a8a);
    box-shadow: 0 0 0 3px rgba(30,58,138,.15), inset 0 1px 2px rgba(0,0,0,.1);
}

/* Transparent / no-color (hardener, thinner, clear coat) — checkered pattern */
.yai-shade-swatch.no-color {
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    background-color: #fff;
}

/* Photo-in-swatch (paint/primer without color keyword — show the can) */
.yai-shade-swatch.yai-shade-photo {
    background: #fff;
    padding: 2px;
}
.yai-shade-swatch.yai-shade-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* ---------- "Buy as set" reminder (garage/guest only) ------------------- */

.yai-set-reminder {
    background: #fff8e1;
    border: 1px solid #facc15;
    border-radius: 10px;
    padding: 12px 14px;
}

.yai-set-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px 10px;
    text-decoration: none;
    color: inherit;
    font-size: 12px;
    transition: border-color .1s, transform .1s;
}

.yai-set-chip:hover {
    border-color: var(--yai-blue, #1e3a8a);
    transform: translateY(-1px);
    color: inherit;
    text-decoration: none;
}

/* ---------- Text-only chips (thinner, no swatch circle) ----------------- */

.yai-shade-chip.yai-chip-text {
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    background: #fff;
}

.yai-shade-chip.yai-chip-text:hover {
    border-color: var(--yai-blue, #1e3a8a);
    background: #eef2ff;
    transform: none;
}

.yai-shade-chip.yai-chip-text.active {
    border-color: var(--yai-blue, #1e3a8a);
    background: var(--yai-blue, #1e3a8a);
    color: #fff;
}

.yai-shade-chip.yai-chip-text .yai-shade-label {
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
    white-space: nowrap;
    overflow: visible;
    display: block;
    -webkit-line-clamp: unset;
}

.yai-shade-chip.yai-chip-text.active .yai-shade-label {
    color: #fff;
}

.yai-shade-label {
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #4b5563;
    text-align: center;
    width: 100%;
    /* Allow up to 2 lines so labels like "3A ICE — 2 กก." don't get clipped */
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.yai-shade-chip.active .yai-shade-label {
    color: var(--yai-blue, #1e3a8a);
    font-weight: 700;
}

/* ---------- Kit component panel ----------------------------------------- */

.yai-kit-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.yai-kit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
}

.yai-kit-row:last-child {
    border-bottom: none;
}

.yai-kit-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px;
    flex-shrink: 0;
}

.yai-kit-info {
    flex: 1;
    min-width: 0;
}
