/* 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); }
}

.auto-affiy__card--search {
    padding: 10px;
}
.auto-affiy__search-panel {
    height: var(--aaf-image-height);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    background: #f6f4f1;
    border-radius: max(0px, calc(var(--aaf-radius) - 3px));
}
.auto-affiy__search-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #75615e;
    border-radius: 50%;
    font-size: 34px;
    line-height: 1;
    color: #75615e;
}
.auto-affiy__search-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #665a58;
}
.auto-affiy__search-kicker {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #817875;
    margin-bottom: 3px;
}
.auto-affiy__name--search {
    font-size: .96em;
    font-weight: 600;
    line-height: 1.45;
    min-height: 2.8em;
}
.auto-affiy__card--search .auto-affiy__button {
    margin-top: auto;
    background: #665a58;
    color: #fff !important;
    font-size: .82em;
    padding: 11px 8px;
}
.auto-affiy__card--search:hover .auto-affiy__button {
    background: #514846;
}
.auto-affiy__image--fallback{display:flex;align-items:center;justify-content:center;background:#f5f5f5;}
.auto-affiy__fallback-label{font-size:14px;font-weight:600;letter-spacing:.02em;color:#555;}
@media (max-width: 782px) {
    .auto-affiy__search-panel { height: min(var(--aaf-image-height), 180px); min-height: 130px; }
}

/* Amazon.com API fallback designs */
.auto-affiy--fallback {
  box-sizing: border-box;
  margin: 28px 0;
  padding: 0;
  color: #18263a;
  font-family: inherit;
}
.auto-affiy--fallback * { box-sizing: border-box; }
.auto-affiy__amazon-logo {
  position: relative;
  display: inline-block;
  width: max-content;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #111827;
  padding-bottom: 6px;
}
.auto-affiy__amazon-logo::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 5%;
  bottom: 1px;
  height: 7px;
  border-bottom: 2px solid #ff9900;
  border-radius: 0 0 70% 70%;
  transform: rotate(-4deg);
}
.auto-affiy__fallback-link {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  padding: 22px 26px;
  text-decoration: none;
  color: inherit;
  background: #fffdf9;
  border: 1px solid #e3ddd3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(36, 29, 22, .06);
}
.auto-affiy__fallback-link:hover { transform: translateY(-1px); }
.auto-affiy__fallback-icon {
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff1d5;
  color: #27364a;
  font-size: 34px;
  line-height: 1;
}
.auto-affiy__fallback-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.auto-affiy__fallback-kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: #6b7280; }
.auto-affiy__fallback-heading { display: block; font-size: 21px; line-height: 1.35; font-weight: 750; color: #18263a; }
.auto-affiy__fallback-sub { display: block; font-size: 13px; line-height: 1.5; color: #697386; }
.auto-affiy__fallback-arrow {
  margin-left: auto;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff9900;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}
.auto-affiy__fallback-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.auto-affiy__fallback-more a { color: #53657c; font-size: 12px; text-decoration: underline; }
.auto-affiy__fallback-box { border: 1px solid #e6ded2; border-radius: 12px; background: #fffdf9; overflow: hidden; }
.auto-affiy__fallback-chips { padding: 22px 24px 24px; background: #faf6ef; }
.auto-affiy__fallback-top { display: flex; align-items: flex-start; gap: 15px; }
.auto-affiy__fallback-top > div { flex: 1; min-width: 0; }
.auto-affiy__fallback-top .auto-affiy__amazon-logo { margin-left: auto; }
.auto-affiy__fallback-cart { font-size: 34px; line-height: 1; }
.auto-affiy__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.auto-affiy__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #ded8cf;
  border-radius: 999px;
  background: #fff;
  color: #26354a;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
}
.auto-affiy__chip span { color: #ff9900; font-size: 18px; line-height: 1; }
.auto-affiy__fallback-shop { display: flex; min-height: 205px; }
.auto-affiy__shop-copy { flex: 1; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.auto-affiy__shop-copy .auto-affiy__amazon-logo { margin-bottom: 5px; }
.auto-affiy__fallback-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #ff9900;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}
.auto-affiy__shop-art {
  position: relative;
  flex: 0 0 36%;
  min-height: 205px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8e5d9, #f1d2bf);
}
.auto-affiy__shop-art::before,
.auto-affiy__shop-art::after { content: ""; position: absolute; border: 3px solid #a96850; border-radius: 50%; opacity: .72; }
.auto-affiy__shop-art::before { width: 120px; height: 120px; right: 35px; top: 28px; }
.auto-affiy__shop-art::after { width: 78px; height: 78px; right: 120px; top: 80px; }
.auto-affiy__shop-art-line { position: absolute; width: 170px; height: 5px; background: #6d594e; transform: rotate(-52deg); right: 72px; top: 94px; border-radius: 5px; }
.auto-affiy__shop-art-ring { position: absolute; width: 42px; height: 42px; border: 5px solid #c48b76; border-radius: 50%; right: 32px; bottom: 28px; }
.auto-affiy__shop-art-dot { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #a96850; right: 155px; bottom: 35px; }
.auto-affiy__popular-label { margin: 16px 0 7px; font-size: 13px; font-weight: 750; color: #27364a; }
.auto-affiy__chips--light { margin-top: 0; }
.auto-affiy__chips--light .auto-affiy__chip { background: #fff; font-weight: 500; }
.auto-affiy__fallback-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid #ebe5dc; background: #fff; }
.auto-affiy__fallback-row { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid #eee9e2; color: #243349; text-decoration: none; font-size: 14px; font-weight: 600; }
.auto-affiy__fallback-row:last-child { border-bottom: 0; }
.auto-affiy__fallback-row > span:first-child { color: #ff9900; font-size: 20px; }
.auto-affiy__fallback-row b { margin-left: auto; color: #ff9900; font-size: 24px; font-weight: 400; }
.auto-affiy--fallback .auto-affiy__disclosure { margin-top: 14px; color: #8a8177; font-size: 11px; line-height: 1.6; }
@media (max-width: 700px) {
  .auto-affiy__fallback-link { gap: 13px; padding: 17px; }
  .auto-affiy__fallback-icon { flex-basis: 48px; width: 48px; height: 48px; font-size: 28px; }
  .auto-affiy__fallback-heading { font-size: 17px; }
  .auto-affiy__fallback-sub { font-size: 12px; }
  .auto-affiy__fallback-arrow { flex-basis: 38px; width: 38px; height: 38px; font-size: 28px; }
  .auto-affiy__fallback-top .auto-affiy__amazon-logo { display: none; }
  .auto-affiy__fallback-shop { min-height: 0; }
  .auto-affiy__shop-copy { padding: 20px; }
  .auto-affiy__shop-art { flex-basis: 31%; min-height: 180px; }
  .auto-affiy__fallback-list-head { padding: 16px; }
  .auto-affiy__fallback-row { padding: 12px 16px; }
}
