/* Store Detail Refactored Styles - Optimized for Reusability and Performance */

/* 🎨 CSS Variables - Centralized Design Tokens */
:root {
    --primary-color: #87604F;
    --brown-color: #87604f;
    --brown-hover: #6f4f41;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #856404;
    --info-color: #2563eb;
    --light-bg: #f8f9fa;
    --dark-gray: #333;
    --medium-gray: #666;
    --light-gray: #999;
    --border-color: #e0e0e0;
    --white-transparent-20: rgba(255, 255, 255, 0.2);
    --white-transparent-30: rgba(255, 255, 255, 0.3);
    --black-overlay: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    
    /* Additional color tokens */
    --white: #ffffff;
    --dark: #1a1a1a;
    --text-medium: #6b7280;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --primary-light: #f5eeec;
    --primary-hover: #6f4f41;
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --space-3xl: 48px;
    
    /* Border Radius Scale */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-hero: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-action-bar: 0 -2px 12px rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 🧱 Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Full-height main content layout */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.section {
    background: white;
    padding: var(--space-2xl) var(--space-md);
    margin: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(300px, 1fr)); 
    gap: var(--space-md);
    /* Viewport-based sizing for harmonious layout - 2x desktop size */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 28vw), 1fr));
}
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-evenly; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; }

/* Hero section button container */
.hero-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 🎨 Typography System */
.heading-hero { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin: 0; }
.heading-lg { font-size: 1.5rem; font-weight: 600; margin-bottom: var(--space-sm); }
.heading-md { font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.text-base { font-size: 1rem; line-height: 1.6; }
.text-sm { font-size: 0.9rem; line-height: 1.4; }
.text-xs { font-size: 0.85rem; }

.text-white { color: white; }
.text-primary { color: var(--primary-color); }
.text-dark { color: var(--dark-gray); }
.text-medium { color: var(--medium-gray); }
.text-light { color: var(--light-gray); }
.text-white-80 { color: rgba(255, 255, 255, 0.8); }
.text-white-90 { color: rgba(255, 255, 255, 0.9); }

/* 🏷️ Tag System */
.tag-base {
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    transition: background-color var(--transition-normal);
    display: inline-block;
}

.tag-category {
    background-color: var(--brown-color);
    color: white;
    padding: var(--space-sm) var(--space-md);
    width: fit-content;
}

.tag-hashtag {
    background-color: var(--white-transparent-20);
    color: white;
}

.tag-hashtag:hover {
    background-color: var(--white-transparent-30);
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* 🔘 Button System */
.btn-base {
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-hero {
    background: var(--white-transparent-20);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-hero:hover {
    background: var(--white-transparent-30);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-hero.wishlist-btn.wishlisted {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-hero.wishlist-btn.wishlisted:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
}

.btn-primary {
    background: var(--brown-color);
    color: white;
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--brown-hover);
}

.btn-action {
    width: 60px;
    height: 50px;
    background: var(--brown-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
}

.btn-action:hover {
    background: var(--brown-hover);
    transform: translateY(-2px);
}

/* 🖼️ Image System */
.image-hero {
    width: 320px; /* 80% of original 400px */
    height: 240px; /* 80% of original 300px */
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-hero);
    transition: transform var(--transition-normal);
    cursor: pointer;
    margin: 0 auto; /* Center horizontally */
}

.image-hero:hover {
    transform: scale(1.02);
}

.image-gallery {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.image-gallery:hover {
    transform: scale(1.05);
}

.image-gallery img,
.image-hero,
.image-product {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-product {
    transition: transform var(--transition-normal);
}

/* 📦 Card System */
.card-base {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    /* Ensure consistent proportions - 2x desktop size */
    aspect-ratio: 3/4;
    min-width: 280px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.card-product {
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.card-product:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-product:hover .image-product {
    transform: scale(1.05);
}

.card-content {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-image-container {
    width: 100%;
    /* Viewport-based height for better proportions - 2x desktop size */
    height: max(200px, 15vw);
    min-height: 180px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

/* 🎭 Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--black-overlay);
    z-index: 1;
    border-radius: var(--radius-lg);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.store-info {
    gap: var(--space-md);
    margin: 1.5rem auto;
    padding: 0 1rem;
    max-width: 600px;
}

.rating-section {
    font-size: 1.1rem;
}

.rating {
    font-weight: 600;
    color: #87604F;
}

/* 🖼️ Gallery Section */
.gallery-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: var(--space-sm) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--light-gray) transparent;
}

.gallery-scroll .image-gallery {
    width: 200px;
    height: 200px;
}

.gallery-scroll .image-gallery:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    position: relative;
}

.gallery-scroll::-webkit-scrollbar {
    height: 6px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: var(--light-gray);
    border-radius: 3px;
}

/* 📋 Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--medium-gray);
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

/* 🔧 Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-md);
    box-shadow: var(--shadow-action-bar);
    z-index: 1000;
}

.action-bar-content {
    max-width: 1200px;
    margin: 0 auto;
}

.action-buttons {
    gap: var(--space-lg);
}

/* 🔄 Two-Column Main Layout */
.main-layout-wrapper {
    display: flex;
    gap: var(--space-2xl);
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.main-content-column {
    flex: 1;
    min-width: 600px; /* 이미지가 없을 때도 최소 너비 유지 */
}

.sidebar-content-column {
    flex-shrink: 0;
    width: 320px;
    position: sticky;
    top: var(--space-xl);
    /* padding-left: var(--space-lg); /* 24px 패딩으로 메인 컨텐츠와 간격 확보 */
    /* padding-top: var(--space-lg); /* 24px 상단 패딩 추가 */
    margin: var(--space-md); /* 16px 마진 추가 */
}

/* 🎨 SNS & Collaboration Sidebar Styles */
.store-social-collab-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: var(--space-lg);
}

.sidebar-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.collab-info {
    margin-bottom: var(--space-lg);
}

.collab-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.collab-badge:hover {
    background: var(--primary-hover);
    color: var(--white);
}

.collab-badge:hover .material-symbols-outlined,
.collab-badge:hover .collab-text {
    color: var(--white);
}

.collab-badge .material-symbols-outlined {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.collab-text {
    font-weight: 600;
    color: var(--dark);
    flex: 1;
}

.collab-status {
    font-size: 0.85rem;
    color: var(--text-medium);
    background: var(--white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.collab-desc {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.collab-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.collab-tag {
    background: var(--gray-100);
    color: var(--text-medium);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Collapsible collaboration list styles */
.toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
    font-size: 1.2rem;
}

.collab-info.open .toggle-icon {
    transform: rotate(180deg);
}

.collab-list {
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
    list-style: none;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-left: 0;
}

.collab-item {
    margin-bottom: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--white);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
    color: var(--dark);
    transition: background-color 0.2s ease;
}

.collab-item:hover {
    background: var(--primary-light);
}

.collab-item:last-child {
    margin-bottom: 0;
}

.sns-section {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sns-section .collaboration-btn {
    padding: 18px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: var(--space-md);
    align-self: center;
    min-width: 200px;
}

.sns-collab-btn {
    width: 100%;
    margin-top: var(--space-md);
}

.sns-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    word-break: break-all;
}

.sns-link:hover {
    color: var(--primary-hover);
}

.sns-link .material-symbols-outlined {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.sns-placeholder {
    color: var(--text-medium);
    font-size: 0.9rem;
    font-style: italic;
}

.collab-action-btn {
    width: 100%;
    background: var(--brown-color);
    color: var(--white);
    border: none;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.collab-action-btn:hover {
    background: var(--brown-hover);
    transform: translateY(-1px);
}

/* 🖥️ Large Screen Constraints */
@media (min-width: 1400px) {
    .hero-content.grid-2 {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 var(--space-lg);
    }
    
    .store-info.flex-col {
        max-width: 480px;
        padding: 0;
        justify-self: start;
    }
    
    .image-hero.gallery-trigger {
        max-width: 320px;
        max-height: 240px;
        width: 320px;
        height: 240px;
        justify-self: end;
    }
    
    /* Ensure grid items stay within bounds */
    .hero-content.grid-2 > * {
        min-width: 0;
        overflow: hidden;
    }
    
    /* Additional constraint for flex-center container */
    .hero-content .flex-center {
        max-width: 400px;
        justify-self: center;
    }
}

/* 📱 Responsive Design System */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; gap: var(--space-lg); text-align: center; }
    .grid-3 { 
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 40vw), 1fr)); 
        gap: var(--space-lg);
    }
    .image-hero { width: 240px; height: 180px; } /* 80% of responsive size */
    
    .card-image-container {
        height: max(180px, 18vw);
        min-height: 160px;
        max-height: 250px;
    }
    
    /* Stack layout vertically on smaller screens */
    .main-layout-wrapper {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .sidebar-content-column {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .container { margin: 0; }
    .section { margin: 10px; padding: var(--space-lg) 15px; }
    .hero-section { height: 400px; }
    .heading-hero { font-size: 2rem; }
    .image-hero { width: 200px; height: 150px; } /* 80% of responsive size */
    .grid-3 { 
        grid-template-columns: 1fr; 
        gap: var(--space-md);
        max-width: min(100%, 400px);
        margin: 0 auto;
    }
    .action-bar { padding: 12px 15px; }
    .btn-primary { font-size: 0.9rem; padding: 12px 20px; }
    .store-info { margin: 1rem auto; padding: 0 0.75rem; }
    
    .card-base {
        max-width: 100%;
        aspect-ratio: 4/5;
    }
    
    .card-image-container {
        height: max(160px, 20vw);
        min-height: 140px;
        max-height: 200px;
    }
    
    /* Mobile adjustments for new layout */
    .main-layout-wrapper {
        padding: 0 var(--space-sm);
    }
    
    .store-social-collab-box {
        padding: var(--space-md);
    }
    
    .sidebar-heading {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section { height: 350px; }
    .heading-hero { font-size: 1.8rem; }
    .store-info { gap: var(--space-sm); }
    .btn-hero { justify-content: center; }
    .image-gallery { width: 100px; height: 100px; }
    .hero-buttons-container { flex-direction: column; gap: var(--space-sm); }
    .hero-buttons-container .btn-hero { width: 100%; justify-content: center; }
    
    .card-base {
        min-width: 250px;
        aspect-ratio: 3/4;
    }
    
    .card-image-container {
        height: max(140px, 25vw);
        min-height: 120px;
        max-height: 180px;
    }
}

/* 🚀 Performance Optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lazy-load.loaded {
    opacity: 1;
}

/* Reduce paint operations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 🔧 Body Layout */
.store-detail-body {
    margin-left: var(--sidebar-width, 160px);
    padding-bottom: 80px;
    background-color: var(--light-bg);
    transition: margin-left var(--transition-normal);
}

@media (max-width: 768px) {
    .store-detail-body {
        margin-left: 0;
    }
}