/* =====================================================================
   Albüm Rengi Seçici (SUP-0317)
   Ürün sayfası ve özel albüm formunda ortak kullanılır.
   ===================================================================== */

.ac-picker { margin-bottom: 20px; }
.ac-picker.ac-in-panel { padding: 14px 18px 0; margin-bottom: 0; }

/* --- Önizleme --- */
.ac-preview {
    display: flex; align-items: center; gap: 14px;
    padding: 10px; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface);
}
.ac-preview-img {
    flex: 0 0 auto;
    width: 112px; height: 112px; border-radius: 10px; overflow: hidden;
    background: var(--cream);
    display: flex; align-items: center; justify-content: center;
}
.ac-preview-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-preview-img img[hidden], .ac-preview-empty[hidden] { display: none; }
.ac-preview-empty svg { width: 30px; height: 30px; color: var(--muted); }
.ac-preview-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-preview-text strong { font-size: 15px; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.ac-preview-text small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* --- Kare renk görselleri --- */
.ac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    max-height: 252px; overflow-y: auto; overscroll-behavior: contain;
    padding: 3px;
}
.ac-swatch {
    position: relative; display: block; cursor: pointer;
    aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden;
    border: 2px solid var(--border);
    background: var(--cream);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ac-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
/* Görseller daire biçiminde çekildiği için kareyi dolduracak kadar büyütülür */
.ac-swatch img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.38);
}
.ac-swatch:hover { transform: translateY(-1px); border-color: var(--ink-soft); }
.ac-swatch.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.ac-swatch.selected::after {
    content: ""; position: absolute; right: 3px; top: 3px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.ac-swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.ac-error { margin: 8px 0 0; font-size: 13px; color: var(--accent-dark); font-weight: 600; }
.ac-error[hidden] { display: none; }
.ac-picker.ac-invalid .ac-preview { border-color: var(--accent); }

@media (max-width: 480px) {
    .ac-preview-img { width: 92px; height: 92px; }
    .ac-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; max-height: 230px; }
}
