/* Store Detail Page Specific Styles */

.store-detail-page-modern .container {
    padding-top: 30px;
    padding-bottom: 30px;
}
.store-detail-modern-content {
    background-color: var(--bg-color);
}
.store-detail-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.store-detail-header h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 0.2em;
}
.store-detail-category {
    font-size: 1.1rem;
    color: var(--text-color-light);
    font-weight: 700;
}
.store-detail-category .separator {
    margin: 0 0.5em;
    color: var(--border-color);
}
.store-detail-category .rating-display {
    font-weight: bold;
    color: var(--secondary-color);
}

.store-detail-main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.store-detail-gallery-info {
    /* Main content area containing gallery and description */
}

/* Photo Gallery */
.store-gallery-modern {
    margin-bottom: 30px;
}
.main-image-container {
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; /* Ensures the image stays within the rounded corners */
    background-color: #f0f0f0; /* Placeholder background */
    display: flex; /* For centering image if it's smaller than container */
    align-items: center;
    justify-content: center;
}
.main-image-container img#main-gallery-image {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    max-height: 550px; /* Adjust as needed */
    object-fit: contain; /* Use 'contain' to ensure whole image is visible, or 'cover' to fill */
    display: block;
    border-radius: 0; /* Image itself doesn't need radius if container has it */
}
.thumbnail-gallery-container {
    display: flex;
    flex-wrap: wrap; /* Allow thumbnails to wrap to next line */
    gap: 10px; /* Space between thumbnails */
    justify-content: flex-start; /* Align thumbnails to the start */
}
.thumbnail-image {
    width: 100px; /* Adjust width as needed */
    height: 75px;  /* Adjust height, or use aspect-ratio */
    object-fit: cover; /* Ensures image covers the thumbnail area nicely */
    border-radius: calc(var(--border-radius) / 2);
    border: 3px solid transparent; /* Border for active state indication */
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #e9e9e9; /* Placeholder background for thumbnails */
}
.thumbnail-image:hover, 
.thumbnail-image:focus { /* Combined hover and focus for better accessibility */
    border-color: var(--secondary-color);
    transform: scale(1.05); /* Slight zoom effect */
    outline: none; /* Remove default browser outline, as we use border */
    box-shadow: 0 0 5px rgba(var(--secondary-color-rgb, 255, 152, 0), 0.7); /* Use secondary color for focus shadow if defined */
}
.thumbnail-image.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.6); /* Use primary color for active shadow */
}

.store-description-modern{
    padding: 25px;
}
.store-description-modern h2 {
    font-size: 1.8rem;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}
.store-description-modern p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Sidebar */
.store-detail-sidebar section {
    background-color: var(--bg-color-alt);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}
.store-detail-sidebar section:last-child {
    margin-bottom: 0;
}
.store-detail-sidebar h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1em;
}
.store-basic-info-modern dl {
    font-size: 1rem;
}
.store-basic-info-modern dt {
    font-weight: 700;
    color: var(--text-color);
    margin-top: 0.8em;
}
.store-basic-info-modern dt:first-child {
    margin-top: 0;
}
.store-basic-info-modern dd {
    margin-left: 0;
    margin-bottom: 0.5em;
    color: var(--text-color-light);
}
.store-basic-info-modern dd a {
    color: var(--secondary-color);
    text-decoration: underline;
}
.store-basic-info-modern dd a:hover {
    color: var(--primary-color);
}

.store-links-modern ul {
    list-style: none;
}
.store-links-modern ul li {
    margin-bottom: 10px;
}
.store-links-modern .external-link {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    padding: 5px 0;
}
.store-links-modern .external-link svg {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}
.store-links-modern .external-link:hover,
.store-links-modern .external-link:focus {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Map and Owner Comment Sections */
.store-map-modern, .store-owner-comment-modern {
    margin-bottom: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
.store-map-modern:last-child, .store-owner-comment-modern:last-child {
    margin-bottom: 0;
}
.store-map-modern h2, .store-owner-comment-modern h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5em;
}
.map-container-modern iframe {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    height: 400px;
    width: 100%;
}
.map-address-supplement {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-color-light);
    margin-top: 10px;
}

.comment-box-modern {
    display: flex;
    gap: 25px;
    background-color: var(--bg-color-alt);
    padding: 30px;
    border-radius: var(--border-radius);
    align-items: flex-start;
}
.owner-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.comment-text p {
    font-size: 1.05rem;
    margin-bottom: 0.8em;
}
.comment-text .owner-name {
    font-weight: 700;
    text-align: right;
    margin-top: 1em;
    color: var(--primary-color);
    font-size: 1.1rem;
}
.back-to-list-modern {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}


@media (max-width: 992px) { /* Tablet and below - where stacking occurs */
    .store-detail-main-layout {
        display: flex; /* GridからFlexboxに変更してorderを有効にする */
        flex-direction: column; /* 要素を縦に積む */
        gap: 0; /* Gridのgapは不要になるのでリセット（必要ならflex-gapを設定） */
    }

    /* 要素の表示順を order プロパティで制御 */
    .store-detail-gallery-info {
        order: 1; /* 写真ギャラリーとお店の紹介を含むコンテナ */
    }
    .store-detail-sidebar {
        order: 2; /* 基本情報や関連リンクを含むサイドバー */
    }

    /* サイドバー内のセクション順は通常通り */
    /* .store-basic-info-modern は .store-detail-sidebar の最初の子要素として表示される */

    .main-image-container img#main-gallery-image {
        max-height: 450px;
    }
}

@media (max-width: 768px) { /* Large Mobile / Small Tablet */
    .store-detail-header h1 {
        font-size: 2.4rem;
    }
    .store-description-modern h2,
    .store-map-modern h2,
    .store-owner-comment-modern h2 {
        font-size: 1.6rem;
    }
    .store-detail-sidebar h3 {
        font-size: 1.3rem;
    }
     .main-image-container img#main-gallery-image {
        max-height: 400px;
    }
    .thumbnail-image {
        width: 80px;
        height: 60px;
    }
}

@media (max-width: 480px) { /* Small Mobile */
    .store-detail-header h1 {
        font-size: 2rem;
    }
    .store-detail-category {
        font-size: 1rem;
    }
    .store-description-modern p,
    .store-basic-info-modern dl,
    .store-links-modern .external-link,
    .comment-text p {
        font-size: 1rem;
    }
    .main-image-container img#main-gallery-image {
        max-height: 300px;
    }
    .thumbnail-image {
        width: calc( (100% - 4 * 10px) / 5 );
        aspect-ratio: 4 / 3;
        height: auto;
    }
    .comment-box-modern {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    .owner-avatar {
        margin-bottom: 15px;
    }
    .comment-text .owner-name {
        text-align: center;
    }
}