@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* Enhanced Root Variables */
:root {
    --brand-color: #d4a373;
    /* 더 부드러운 갈색 */
    --brand-dark: #bc8a5f;
    --body-bg-light: #FDF9F3;
    /* Off-white, slightly creamy background */
    --text-primary: #333;
    --text-secondary: #666;
    --border-color-light: #E0E0E0;
    --shadow-sm-color: rgba(0, 0, 0, 0.08);
    --shadow-md-color: rgba(0, 0, 0, 0.12);
    --transition-base: all 0.3s ease-in-out;

    /* Override existing Bootstrap vars for consistency */
    --bs-primary: var(--brand-color);
    --bs-primary-rgb: 212, 163, 115;
    /* Reverted to original brand color RGB */

    /* New Variables for Product Section Compatibility */
    --brand-primary: #8D6E63;
    /* Warm Brown for products */
    --bg-surface: #FFFFFF;
    --radius-md: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-primary);
    background-color: var(--body-bg-light);
    line-height: 1.6;
    padding-top: 70px;
    /* Adjusted for fixed-top navbar */
}

section {
    padding: 6rem 0;
}

/* General Text Styling */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
}

p {
    color: var(--text-secondary);
}

.section-heading {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--brand-color);
    border-radius: 5px;
}

.section-subheading {
    font-size: 1.2rem;
    margin-bottom: 4rem;
    color: var(--text-secondary);
}

/* Navbar Enhancements */
.navbar {
    border-bottom: 1px solid var(--border-color-light);
    box-shadow: 0 2px 10px var(--shadow-sm-color);
}

.navbar-brand {
    font-weight: 700;
    font-size: 2rem;
    /* Increased font size */
    letter-spacing: -0.5px;
    color: var(--brand-color) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    /* Added subtle text shadow */
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--brand-color) !important;
}

/* Button Enhancements */
.btn-primary {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    transition: var(--transition-base);
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.2);
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.btn-link {
    color: var(--brand-color);
    font-weight: 500;
}

/* Card Enhancements (Product, Feature) */
.product-item,
.feature-card,
.testimonial-card {
    border: 1px solid var(--border-color-light);
    box-shadow: 0 5px 20px var(--shadow-sm-color);
    border-radius: 0.75rem;
    background: #fff;
    /* Ensure white background for light theme */
}

.product-item:hover,
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px var(--shadow-md-color);
}

.product-item img {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.product-item-hover {
    background-color: rgba(var(--bs-primary-rgb), 0.6);
    /* Reduced opacity */
    transform: scale(0.9);
    /* Initial smaller scale */
    transition: var(--transition-base);
}

.product-item:hover .product-item-hover {
    opacity: 1;
    transform: scale(1);
    /* Scale to normal on hover */
}

.product-item-hover i {
    font-size: 2.5rem;
    color: var(--text-primary);
    /* Changed to text-primary for better contrast */
}

.feature-card .card-body {
    padding: 2rem;
}

.testimonial-card {
    background-color: #fff;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 3px 15px var(--shadow-sm-color);
    padding: 2.5rem;
}

.testimonial-card h5 {
    font-size: 1.3rem;
    margin-top: 1rem;
}

.testimonial-card p {
    font-style: italic;
    color: var(--text-secondary);
}

.testimonial-card .fw-bold {
    color: var(--brand-color);
    font-size: 1.1rem;
}

/* Form Control Enhancements */
.form-control,
.form-select,
.btn-primary {
    border-radius: 0.5rem;
    /* Slightly rounded corners */
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), .25);
}

/* Tab Navigation (Product Categories, Store Filters) */
.nav-pills .nav-link {
    color: var(--text-secondary);
    background-color: #f0f0f0;
    border-radius: 50rem;
    padding: 0.6rem 1.5rem;
    margin: 0 0.3rem 0.5rem;
    transition: var(--transition-base);
    font-weight: 600;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:hover {
    background-color: var(--brand-color) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.2);
}

/* Store Locator Specifics */
.store-list-item {
    background-color: #fff;
    border: 1px solid var(--border-color-light);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-base);
}

.store-list-item:hover {
    box-shadow: 0 2px 10px var(--shadow-sm-color);
}

.store-list-item h5 {
    color: var(--text-primary);
}

/* Hero Section */
#page-top {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-attachment: fixed;
    /* Parallax effect */
    background-size: cover;
    background-position: center;
    position: relative;
    text-align: center;
}

#page-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Dark overlay */
    z-index: 1;
}

#page-top .container {
    position: relative;
    z-index: 2;
    color: #fff;
}

#page-top h1 {
    font-size: 3.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

#page-top p {
    font-size: 1.3rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.85);
}

/* Image overrides for proper display in all contexts */
img {
    display: block;
    /* Remove extra space below images */
}

/* Ensure consistent component spacing */
.my-5 {
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.my-4 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

.py-4 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Summernote fullscreen fix for Bootstrap */
.note-editor.note-frame.note-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    /* Higher than Bootstrap's navbar z-index */
}

/* Lightcase navigation arrows centering */
.lightcase-nav-prev,
.lightcase-nav-next {
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    /* Override any bottom positioning */
}

/* Make sure the icons themselves are visible and well-sized */
.lightcase-nav-prev span,
.lightcase-nav-next span {
    font-size: 2rem;
    /* Adjust as needed for better visibility */
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.lightcase-nav-prev span:hover,
.lightcase-nav-next span:hover {
    opacity: 1;
}

/* Product grid alignment for mobile */
@media (max-width: 767.98px) {
    .product-grid {
        justify-content: flex-start !important;
    }

    /* Category and Region Filter alignment for mobile */
    #pills-tab.nav-pills,
    #region-filter.nav-pills {
        flex-wrap: wrap;
        justify-content: center !important;
        /* Ensure it stays centered */
        padding-left: 0;
        padding-right: 0;
        margin-left: -5px;
        /* Compensate for item margins */
        margin-right: -5px;
        /* Compensate for item margins */
    }

    #pills-tab .nav-item,
    #region-filter .nav-item {
        flex-shrink: 1;
        /* Allow items to shrink if needed */
        margin: 0 5px 10px;
        /* Uniform margins for wrapping */
    }

    #pills-tab .nav-link,
    #region-filter .nav-link {
        padding: 0.5rem 0.8rem;
        /* Adjust padding for smaller size */
        white-space: normal;
        /* Allow text to wrap within button */
        text-align: center;
        /* Center text if it wraps */
    }
}

/* Global box-sizing for better responsive layouts */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Aggressive fix for horizontal overflow on the entire page */
html,
body {
    overflow-x: hidden;
}

/* --- NEW PRODUCT SECTION STYLES --- */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 4rem;
}

/* Product Grid Overrides for New Look */
.product-item {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    border: none;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.product-item-caption {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-surface);
}

.product-item-caption h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tab Navigation Overrides for New Look */
.nav-pills .nav-link {
    background: transparent;
    border: 1px solid var(--border-color-light);
    color: var(--text-secondary);
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    margin: 0 0.25rem;
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.3);
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Modern Table Styles --- */
.modern-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.modern-table-card:hover {
    transform: translateY(-5px);
}

.modern-table-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.modern-table-card h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: var(--brand-color);
    border-radius: 2px;
}

.modern-table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.modern-table th {
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    width: 40%;
}

.modern-table td {
    color: var(--text-secondary);
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
}

.modern-table tr:last-child th,
.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover td,
.modern-table tr:hover th {
    background-color: #fcfcfc;
}

.modern-table-card small {
    display: block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}