/* Auto Affiy - クラフターズ風デザイン */
.auto-affiy {
    --aaf-gap: 12px;
    --aaf-border: #cfc8bd;
    --aaf-text: #665a58;
    --aaf-muted: #817875;
    --aaf-accent: #665a58;
    position: relative !important;
    box-sizing: border-box !important;
    margin: 50px 10px !important;
    padding: 28px !important;
    font-family: inherit;
    background: #fffdf9 !important;
    border: 10px solid #fbf8ef !important;
    border-radius: 14px !important;
    box-shadow: inset 0 0 0 1px #cfc8bd !important;
}
.auto-affiy * { box-sizing: border-box; }
.auto-affiy__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 22px;
}
.auto-affiy__title {
    color: #75615e !important;
    font-size: 1.25em !important;
    font-weight: 600 !important;
    line-height: 1.5;
}
.auto-affiy__title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 8px 2px 0;
    background: #75615e;
}
.auto-affiy__controls { display: flex; gap: 5px; }
.auto-affiy__controls button {
    width: 30px;
    height: 30px;
    border: 1px solid #e1dbd2;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #665a58;
    padding: 0;
}
.auto-affiy__viewport { overflow: hidden; }
.auto-affiy__track {
    display: flex;
    gap: var(--aaf-gap);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 8px;
    scrollbar-width: none;
}
.auto-affiy__track::-webkit-scrollbar { display: none; }
.auto-affiy__card {
    flex: 0 0 calc((100% - (var(--aaf-gap) * (var(--aaf-desktop) - 1))) / var(--aaf-desktop));
    min-width: 0;
    border: 1px solid #e2ddd7;
    border-radius: var(--aaf-radius);
    background: #fff;
    padding: 10px;
    text-decoration: none !important;
    color: #665a58 !important;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    transition: transform .18s ease, box-shadow .18s ease;
}
.auto-affiy__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
}
.auto-affiy__image {
    height: var(--aaf-image-height);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
    background: #fff;
    border-radius: max(0px, calc(var(--aaf-radius) - 3px));
    overflow: hidden;
}
.auto-affiy__image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.auto-affiy__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: .88em;
    line-height: 1.45;
    min-height: 2.55em;
    margin-bottom: 7px;
    color: #665a58;
}
.auto-affiy__price { font-size: .9em; font-weight: 700; margin-bottom: 2px; color: #514846; }
.auto-affiy__price-note {
    font-size: 11px;
    color: #817875;
    line-height: 1.7;
    margin: 14px 0 0;
}
.auto-affiy__button {
    display: block;
    text-align: center;
    border-radius: 8px;
    background: #f5f3f1;
    color: #514846;
    font-size: .78em;
    font-weight: 600;
    padding: 8px;
    margin-top: auto;
}
.auto-affiy__card:hover .auto-affiy__button { background: #eeece9; }
.auto-affiy__disclosure {
    font-size: 11px;
    color: #817875;
    line-height: 1.7;
    margin: 6px 0 0;
}
@media (max-width: 782px) {
    .auto-affiy {
        margin: 30px 8px;
        padding: 22px 16px 20px;
    }
    .auto-affiy__title { font-size: 1.12em; }
    .auto-affiy__title::before { width: 9px; height: 9px; }
    .auto-affiy__card {
        flex-basis: calc((100% - (var(--aaf-gap) * (var(--aaf-mobile) - 1))) / var(--aaf-mobile));
    }
    .auto-affiy__image { height: min(var(--aaf-image-height), 180px); }
}
