/**
 * SH Woo Favorites - Styles (余白最適化版)
 */

/* ========================================
   既存のボタンスタイル
======================================== */
.sp-action-btn--heart {
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sp-action-btn--heart:hover {
    transform: scale(1.1);
}

.sp-action-btn--heart:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.sp-action-btn--heart img {
    transition: all 0.3s ease;
}

.sp-action-btn--heart.shwf-active img {
    width: 27.6px !important;
    height: 23px !important;
}

.sp-action-btn--heart.shwf-loading {
    pointer-events: none;
    opacity: 0.6;
}

.sp-action-btn--heart.shwf-loading img {
    animation: shwf-pulse 1s ease-in-out infinite;
}

.sp-action-btn--heart.shwf-bounce {
    animation: shwf-bounce 0.3s ease;
}

@keyframes shwf-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes shwf-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 通知 */
.shwf-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2c3e50;
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.shwf-notification.shwf-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Astraテーマの上書き
======================================== */

/* お気に入りページ内のリンク下線を削除 */
.shwf-page-container a,
.shwf-favorites-list a,
.shwf-favorite-card a,
.shwf-card-name a {
    text-decoration: none !important;
}

/* ホバー時のみ下線表示（オプション） */
.shwf-card-name a:hover {
    text-decoration: underline !important;
}

/* ========================================
   お気に入りページ（余白最適化版）
======================================== */

/* ページコンテナ */
.shwf-page-container {
    position: relative;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    padding: 0;
    background: #FFFEFB;
    min-height: 100vh;
}

/* ページヘッダー */
.shwf-page-header {
    position: relative;
    padding: 52px 20px 36px;
}

/* タイトル */
.shwf-page-title {
    width: 100%;
    max-width: 310px;
    margin: 0 auto;
    font-family: 'M PLUS 1', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 24px;
    line-height: 100%;
    text-align: center;
    letter-spacing: 0.06em;
    color: #2F2B29;
}

/* 閉じる（×）ボタン */
.shwf-page-close {
    position: absolute;
    width: 26px;
    height: 26px;
    right: 20px;
    top: 52px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.shwf-page-close:hover {
    transform: scale(1.15);
}

.shwf-page-close svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* 商品リスト */
.shwf-favorites-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 40px;
    gap: 28px;
    width: 100%;
}

/* 商品カード */
.shwf-favorite-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 310px;
    padding: 0 0 20px;
    border-bottom: 1px solid #D5D5D5;
}

/* 最後のカードもボーダーを表示 */
.shwf-favorite-card:last-child {
    border-bottom: 1px solid #D5D5D5;
    padding-bottom: 20px;
}

/* カード内部 */
.shwf-card-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

/* 商品画像 */
.shwf-card-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.shwf-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.shwf-card-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    background: #D9D9D9;
    border: 1px solid #D5D5D5;
    display: block;
}

/* 商品情報 */
.shwf-card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* 商品名 */
.shwf-card-name {
    width: 100%;
    min-height: 34px;
    font-family: 'M PLUS 1', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    letter-spacing: 0.04em;
    color: #2F2B29;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.shwf-card-name a {
    color: inherit;
    text-decoration: none;
}

.shwf-card-name a:hover {
    text-decoration: underline;
}

/* 価格・削除・購入エリア */
.shwf-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* 価格と削除の行 */
.shwf-price-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 20px;
}

/* 価格 */
.shwf-price {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
}

.shwf-price-amount {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 20px;
    line-height: 100%;
    color: #2F2B29;
}

.shwf-price-amount::before {
    content: '¥';
}

.shwf-price-tax {
    font-family: 'M PLUS 1', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 10px;
    line-height: 100%;
    color: #2F2B29;
}

/* 削除ボタン */
.shwf-delete-btn {
    font-family: 'M PLUS 1', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    letter-spacing: 0.04em;
    text-decoration-line: underline;
    color: #D5D5D5;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.shwf-delete-btn:hover {
    color: #999;
}

/* 購入ボタン */
.shwf-purchase-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    width: 100%;
    height: 42px;
    background: #444444;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    
    font-family: 'M PLUS 1', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 100%;
    text-align: center;
    letter-spacing: 0.08em;
    color: #FFFEFB;
}

.shwf-purchase-btn:hover {
    background: #333;
}

.shwf-purchase-btn:active {
    transform: scale(0.98);
}

.shwf-purchase-btn:disabled,
.shwf-purchase-btn--disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 空の状態 */
.shwf-empty-state {
    text-align: center;
    padding: 60px 20px;
    width: 100%;
}

.shwf-empty-state p {
    font-family: 'M PLUS 1', sans-serif;
    font-size: 14px;
    line-height: 150%;
    color: #666;
    margin: 0 0 20px 0;
}

.shwf-login-btn,
.shwf-shop-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    background: #444444;
    border-radius: 4px;
    color: #FFFEFB;
    text-decoration: none;
    font-family: 'M PLUS 1', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.08em;
    transition: background 0.2s;
}

.shwf-login-btn:hover,
.shwf-shop-btn:hover {
    background: #333;
    color: #FFFEFB;
}

/* ========================================
   PC版（タブレット・デスクトップ）
======================================== */
@media (min-width: 769px) {
    /* ページコンテナ */
    .shwf-page-container {
        max-width: 1200px;
        padding: 0 40px;
    }

    /* ページヘッダー */
    .shwf-page-header {
        padding: 60px 0 40px;
    }

    /* タイトル */
    .shwf-page-title {
        font-size: 28px;
        max-width: none;
    }

    /* 閉じるボタン */
    .shwf-page-close {
        right: 0;
        top: 60px;
        width: 32px;
        height: 32px;
    }

    /* 商品リスト - グリッド */
    .shwf-favorites-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
        padding: 0 0 60px;
        align-items: start;
    }

    /* 商品カード */
    .shwf-favorite-card {
        max-width: none;
        border-bottom: none;
        border: 1px solid #D5D5D5;
        border-radius: 8px;
        padding: 20px;
        transition: box-shadow 0.2s, transform 0.2s;
    }

    .shwf-favorite-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    .shwf-favorite-card:last-child {
        border: 1px solid #D5D5D5;
    }

    /* カード内部 - 縦レイアウト */
    .shwf-card-inner {
        flex-direction: column;
        gap: 16px;
    }

    /* 商品画像 */
    .shwf-card-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .shwf-card-image img {
        width: 100%;
        height: 100%;
    }

    /* 商品情報 */
    .shwf-card-info {
        width: 100%;
    }

    /* 商品名 */
    .shwf-card-name {
        min-height: 40px;
    }

    /* 価格エリア */
    .shwf-card-actions {
        gap: 12px;
    }
}

/* ========================================
   大画面（デスクトップ）
======================================== */
@media (min-width: 1200px) {
    .shwf-favorites-list {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 40px;
    }

    .shwf-favorite-card {
        padding: 24px;
    }
}

/* ========================================
   SP版の調整
======================================== */
@media (max-width: 768px) {
    .shwf-notification {
        font-size: 13px;
        padding: 12px 20px;
        bottom: 20px;
    }
}

/* タッチデバイス用の調整 */
@media (hover: none) and (pointer: coarse) {
    .sp-action-btn--heart:hover {
        transform: none;
    }
    
    .sp-action-btn--heart:active {
        transform: scale(0.95);
    }
    
    .shwf-favorite-card:hover {
        transform: none;
        box-shadow: none;
    }
}