/**
 * Gadget Panel Shortcode CSS
 * シンプルな上下2段レイアウト
 */

/* ========== Variables ========== */
.gadget-panel {
    --accent: #e82598;
    --accent-light: #f9d4eb;
    --accent-soft: #fceef7;
    --text-primary: #2d2d2d;
    --text-secondary: #555;
    --text-light: #888;
    --bg-white: #ffffff;
    --bg-soft: #f9f9f9;
    --border-color: #e8e8e8;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 8px;
    --star-color: #f5a623;
    --amazon-color: #ff9900;
    --rakuten-color: #bf0000;
}

/* ========== Container ========== */
.gadget-panel {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 24px 0;
    overflow: hidden;
    font-family: 'Noto Sans JP', sans-serif;
}

/* ========== Rank Badge ========== */
.gadget-panel__rank {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #ff6bb3 100%);
    color: white;
    padding: 8px 16px 8px 12px;
    border-radius: 0 0 var(--radius) 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
    z-index: 10;
}

.gadget-panel__rank .rank-number {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.gadget-panel__rank .rank-label {
    font-size: 0.75rem;
    font-weight: 600;
}


/* ========== Top Section (写真 + 情報) ========== */
.gadget-panel__top {
    display: flex;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

/* ========== Image (正方形コンテナ、画像は等倍) ========== */
.gadget-panel__image {
    flex: 1;
    aspect-ratio: 1 / 1;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gadget-panel__image img {
    max-width: 250px;  /* ← ここで画像サイズを調整 */
    max-height: 250px; /* ← ここで画像サイズを調整 */
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}


.gadget-panel__image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.gadget-panel__image a:hover img {
    transform: scale(1.05);
}

.gadget-panel__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== Info (右側) 50:50 ========== */
.gadget-panel__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.gadget-panel__brand {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.gadget-panel__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.gadget-panel__title a {
    color: inherit;
    text-decoration: none;
}

.gadget-panel__title a:hover {
    color: var(--accent);
}

/* ========== Spec Tags ========== */
.gadget-panel__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gadget-panel .spec-tag {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.gadget-panel .spec-tag--accent {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* ========== Rating ========== */
.gadget-panel__rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gadget-panel__rating .rating-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.gadget-panel__rating .rating-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}

.gadget-panel__rating .rating-stars {
    display: flex;
    gap: 1px;
}

.gadget-panel__rating .star {
    font-size: 1.2rem;
    color: var(--star-color);
}

.gadget-panel__rating .star.empty {
    color: #ddd;
}

/* ========== Price ========== */
.gadget-panel__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.gadget-panel__price .price-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.gadget-panel__price .price-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #d60000;
}

.gadget-panel__price .price-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ========== Buttons ========== */
.gadget-panel__buttons {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.gadget-panel .btn-cta {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.gadget-panel .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2), 0 5px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

.gadget-panel .btn-cta:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
}

.gadget-panel .btn-amazon {
    background: linear-gradient(180deg, #ffad33 0%, var(--amazon-color) 100%);
}

.gadget-panel .btn-rakuten {
    background: linear-gradient(180deg, #e60000 0%, var(--rakuten-color) 100%);
}

/* ========== Bottom Section ========== */
.gadget-panel__bottom {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== Overview ========== */
.gadget-panel__overview p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* ========== Highlights ========== */
.gadget-panel__highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gadget-panel__highlights .highlight-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.gadget-panel__highlights .highlight-icon {
    color: var(--accent);
    font-weight: 700;
}

/* ========== Review ========== */
.gadget-panel__review {
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.gadget-panel__review .review-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}

.gadget-panel__review p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ========== Detail Link ========== */
.gadget-panel__detail-link {
    display: inline-block;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 0;
    transition: color 0.2s ease;
}

.gadget-panel__detail-link:hover {
    color: #c91d80;
    text-decoration: underline;
}

/* ========== Error ========== */
.gadget-card-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: #856404;
    font-size: 0.9rem;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .gadget-panel__top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }

    .gadget-panel__image {
        width: 250px;
        height: 250px;
    }

    .gadget-panel__info {
        align-items: center;
    }

    .gadget-panel__specs {
        justify-content: center;
    }

    .gadget-panel__rating {
        justify-content: center;
    }

    .gadget-panel__price {
        justify-content: center;
    }

    .gadget-panel__buttons {
        flex-direction: column;
        width: 100%;
    }

    .gadget-panel .btn-cta {
        width: 100%;
    }

    .gadget-panel__bottom {
        padding: 20px;
        gap: 14px;
    }

    .gadget-panel__title {
        font-size: 1.1rem;
    }

    .gadget-panel__highlights {
        justify-content: center;
    }

    .gadget-panel__detail-link {
        text-align: center;
        display: block;
    }
}
