/*========================== 現代風トップページ CSS ==========================*/

/*=== 基本リセット ===*/
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
}

/*========================== ヘッダーバナー ==========================*/
#head-banner {
    margin: 0 0 15px;
    background:
    padding: 5px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 30px 30px;
}

#head-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* スライダー用スタイル */
#head-banner .slider {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* ヒーローコンテンツ */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    padding: 15px 30px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.cta-button.primary {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.cta-button.primary:hover {
    background: #ff5252;
}

/*========================== トップページカラム ==========================*/
#top-page-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 0 20px 60px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

#column-left {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

#column-right {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/*========================== セクション共通スタイル ==========================*/
.section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.section-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #e74c3c;
    border-radius: 2px;
}

.title-icon {
    font-size: 1.2rem;
}

/*========================== ニュースセクション ==========================*/
#news .box-news {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
}

#news .box-news::-webkit-scrollbar {
    width: 8px;
}

#news .box-news::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#news .box-news::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

#news .box-news::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ニュースアイテムのスタイリング（動的コンテンツ用）
#news .box-news p {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

#news .box-news p:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

#news .box-news a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

#news .box-news a:hover {
    color: #3498db;
}

#news em, #news strong {
    color: #e74c3c;
    font-weight: bold;
}
*/

/*========================== 商品リスト共通 ==========================*/
.list-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.item-box {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.item-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

.item-box:hover::before {
    left: 100%;
}

.item-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.link-image {
    display: block;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.item-box img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-box:hover img {
    transform: scale(1.05);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-box:hover .item-overlay {
    opacity: 1;
}

.view-detail {
    color: white;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.item-content {
    position: relative;
    z-index: 2;
}

.item-name {
    color: #2c3e50;
    font-weight: bold;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 2.8rem;
}

.item-name:hover {
    color: #3498db;
}

.item-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

.regular-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-right: 8px;
}

.sale-price {
    color: #e74c3c;
}

/*========================== 新着商品セクション（修正版） ==========================*/
/*========================== カラーミーショップNEWアイコン精密修正 ==========================*/

/* 新着商品セクションを通常サイズに戻す */
#newitem {
    font-size: 16px !important;
}

/* カラーミーショップのNEWアイコンを正確なサイズに修正 */
#newitem img[src*="new"],
#newitem img[src*="NEW"],
#newitem img[alt*="new"],
#newitem img[alt*="NEW"] {
    width: 32px !important;
    height: 11px !important;  /* 32px → 11px に変更 */
    /* 以下略 */
}

/* 商品画像は通常サイズを維持 */
#newitem .link-image img {
    width: 100% !important;
    height: 150px !important;
    max-width: 100% !important;
    max-height: 150px !important;
    position: static !important;
    object-fit: cover !important;
}

#newitem .list-column {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* 新着商品のホバー問題修正 */
#newitem .item-box {
    transform: translateZ(0) !important; /* GPU加速で安定化 */
}

#newitem .item-box:hover {
    transform: translateY(-3px) translateZ(0) !important; /* 震えを防止 */
}

#newitem .item-box img {
    transform: translateZ(0) !important;
}

#newitem .item-box:hover img {
    transform: scale(1.03) translateZ(0) !important; /* 軽微なスケールに変更 */
}

/* 疑似要素の干渉防止 */
#newitem .item-box::before {
    pointer-events: none !important;
}

/* オーバーレイの干渉防止 */
#newitem .item-overlay {
    pointer-events: none !important;
}

/*========================== ランキングセクション ==========================*/
#toppage-ranking {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

#toppage-ranking::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#toppage-ranking .section-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
    position: relative;
    z-index: 2;
}

#toppage-ranking .section-title::after {
    background: #ff6b6b;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 2;
}

#toppage-ranking .item-box {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 15px;
}

#toppage-ranking .item-box::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.ranking-number {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.ranking-1 .ranking-number { background: #f1c40f; }
.ranking-2 .ranking-number { background: #95a5a6; }
.ranking-3 .ranking-number { background: #cd7f32; }

#toppage-ranking .link-image {
    flex-shrink: 0;
    width: 160px;
    height: 150px;
    margin-right: 15px;
    margin-bottom: 0;
}

#toppage-ranking .item-content {
    flex: 1;
}

#toppage-ranking .item-name {
    color: white;
    font-size: 0.85rem;
    min-height: auto;
    margin-bottom: 5px;
}

#toppage-ranking .item-name:hover {
    color: #ff6b6b;
}

#toppage-ranking .item-price {
    color: #ff6b6b;
    font-size: 1rem;
}

/*========================== 特別お知らせエリア ==========================*/
#special-notice .notice-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notice-item {
    padding: 20px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.notice-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.notice-item:hover::before {
    left: 100%;
}

.notice-item h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.notice-item p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.notice-button {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.notice-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/*========================== レスポンシブ対応 ==========================*/
@media (max-width: 768px) {
    #top-page-column {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 0 15px 40px;
    }

    #head-banner {
        padding: 40px 15px;
        margin-bottom: 30px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .section {
        padding: 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .list-column {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    #toppage-ranking .item-box {
        flex-direction: column;
        text-align: center;
    }

    #toppage-ranking .link-image {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100px;
        height: 75px;
    }

    #news .box-news {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .list-column {
        grid-template-columns: 1fr 1fr;
    }

    .item-box {
        padding: 15px;
    }

    .item-box img {
        height: 120px;
    }

    .section {
        padding: 15px;
    }

    #head-banner {
        padding: 30px 10px;
    }
}

/*========================== clearfix（IE対応） ==========================*/
#top-page-column:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

#top-page-column {
    display: block;
}

/*========================== アニメーション ==========================*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }

/* ニュースセクションのみのリデザイン - 既存レイアウトを一切変更しない */
/*========================== ニュースセクション専用リデザイン ==========================*/
#news .box-news {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
}

#news .box-news::-webkit-scrollbar {
    width: 8px;
}

#news .box-news::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#news .box-news::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

#news .box-news::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ニュースアイテムのデザイン改善 */
#news .box-news p {
    margin: 0 0 12px 0;
    padding: 18px 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    margin-left: 15px;
    margin-right: 15px;
}

#news .box-news p:first-child {
    margin-top: 15px;
}

#news .box-news p:last-child {
    margin-bottom: 15px;
}

#news .box-news p::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.05), transparent);
    transition: left 0.5s ease;
}

#news .box-news p:hover::before {
    left: 100%;
}

#news .box-news p:hover {
    background: #f8f9fa;
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
    border-left-color: #e74c3c;
}

/* 日付の自動スタイリング */
#news .box-news p {
    position: relative;
}

/* 日付パターンを検出してスタイル適用 */
#news .box-news p::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.05), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

/* 日付スタイル（既存のem要素） */
#news .box-news p em {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    font-style: normal;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
    position: relative;
    z-index: 2;
}

/* ニュースタイトル */
#news .box-news p strong {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    display: inline-block;
    margin-top: 2px;
}

/* リンクスタイル */
#news .box-news a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

#news .box-news a:hover {
    color: #3498db;
}

/* 特別なニュースアイテム（重要なお知らせ用） */
#news .box-news p.important {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, #fff9e6, #fef5e7);
}

#news .box-news p.important em {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

#news .box-news p.emergency {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fdf2f2, #fef5f5);
    animation: pulse 2s infinite;
}

#news .box-news p.emergency em {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    50% { box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2); }
}

/* アイコン追加（オプション） */
#news .box-news p[data-type="repair"]::after {
    content: "&#128295;";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.3;
}

#news .box-news p[data-type="update"]::after {
    content: "&#127381;";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.3;
}

#news .box-news p[data-type="notice"]::after {
    content: "&#128226;";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.3;
}

/* 空のニュース欄対策 */
#news .box-news:empty::before {
    content: "最新のニュースを準備中です...";
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-style: italic;
}

/* ニュースが少ない場合のパディング調整 */
#news .box-news {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* レスポンシブ対応（ニュース欄のみ） */
@media (max-width: 768px) {
    #news .box-news {
        max-height: 300px;
        padding: 0;
    }
    
    #news .box-news p {
        margin-left: 10px;
        margin-right: 10px;
        padding: 15px;
    }
    
    #news .box-news p em {
        font-size: 0.75rem;
        padding: 3px 8px;
        margin-right: 8px;
        display: block;
        margin-bottom: 5px;
        width: fit-content;
    }
    
    #news .box-news p strong {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #news .box-news p {
        padding: 12px;
        margin-left: 8px;
        margin-right: 8px;
    }
    
    #news .box-news p em {
        font-size: 0.7rem;
    }
    
    #news .box-news p strong {
        font-size: 0.85rem;
    }
}