/*
 * YJ→YD クロスプロモモーダル（Backlog REQUEST-3236）
 * 既存 _campaignDialog.html.twig 内でのみ使用する。
 * クラス名は ydPromo__ プレフィックスで局所化し、他モーダルへの影響を避ける。
 */

.ydPromo .modal-content,
.ydPromo__content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.ydPromo__dialog {
    max-width: 360px;
    /* Bootstrap はモバイル(<576px)で .modal-dialog の margin が 0.5rem(左右auto無し)になり
       max-width 指定と相まって左寄せになるため、左右 auto で確実に中央寄せする。 */
    margin-left: auto;
    margin-right: auto;
}

.ydPromo__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #f1efe8;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: #5f5e5a;
    opacity: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ydPromo__close:hover {
    opacity: 0.7;
}

.ydPromo__header {
    padding: 28px 20px 12px;
    text-align: center;
}
.ydPromo__logo {
    display: block;
    margin: 0 auto 16px;
    height: auto;
}
.ydPromo__title {
    font-size: 18px;
    font-weight: 500;
    margin: 8px 0 6px;
    color: #2c2c2a;
}
.ydPromo__subtitle {
    font-size: 13px;
    color: #5f5e5a;
    margin: 0;
    line-height: 1.5;
}

/* スライダー */
.ydPromo__sliderWrap {
    padding: 4px 0 0;
    overflow: hidden;
}
.ydPromo__track {
    display: flex;
    gap: 8px;
    width: max-content;
    padding: 0 20px;
}
/* カードが描画され、データ属性が付いたときのみアニメーションを有効化 */
.ydPromo__track[data-yd-ready="1"] {
    animation: ydPromoSlide var(--yd-slide-duration, 30s) linear infinite;
}
@keyframes ydPromoSlide {
    0% { transform: translateX(0); }
    /* JS が算出した1周分の移動量を CSS 変数で受け取る */
    100% { transform: translateX(var(--yd-slide-distance, -1040px)); }
}

.ydPromo__card {
    width: 200px;
    flex-shrink: 0;
    background: #fff8f4;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}
.ydPromo__card:hover {
    text-decoration: none;
    color: inherit;
}
.ydPromo__cardImg {
    position: relative;
    /* 縦横比を 4:3 に固定（Safari 15+ / iOS 15+ を前提） */
    aspect-ratio: 4 / 3;
    background-color: #f4c0d1;
    background-size: cover;
    background-position: center;
}
/* YDサイトと同じ公式 Free バッジ画像（左上コーナー） */
.ydPromo__free {
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 56px;
    z-index: 1;
}
.ydPromo__cardBody {
    padding: 10px 12px;
}
.ydPromo__cardTitle {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 6px;
    line-height: 1.35;
    min-height: 32px;
    color: #2c2c2a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ydPromo__cardLoc {
    font-size: 11px;
    color: #5f5e5a;
}
.ydPromo__cardPrice {
    margin-top: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.ydPromo__priceIcon {
    width: 13px;
    height: 13px;
    color: #8c6e4a; /* YDサイトの金額アイコンに合わせた茶系 */
    flex-shrink: 0;
}
.ydPromo__cardPrice s {
    color: #888780;
}
.ydPromo__cardPrice strong {
    color: #d4537e;
    font-weight: 500;
    font-size: 13px;
    margin-left: 4px;
}

/* フッター */
.ydPromo__footer {
    padding: 14px 20px 20px;
}
.ydPromo__cta {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background: #facd4e; /* YJ ブランドイエロー */
    color: #2c2c2a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.ydPromo__cta:hover {
    color: #2c2c2a;
    text-decoration: none;
    opacity: 0.85;
}
.ydPromo__later {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: transparent;
    color: #5f5e5a;
    border: none;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}
.ydPromo__later:hover {
    opacity: 0.7;
}
