/**
 * Wine Shop Module - Main Stylesheet
 * 參考Aberdeen風格設計
 */

:root {
    /* 顏色變量 - Aberdeen風格 */
    --primary-color: #4b6584;
    --accent-color: rgb(199 173 119); /* 金黃色調 */
    --background-color: rgb(221 216 209);
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --text-dark: #333;
    --text-gray: #666;
    --success-color: #4CAF50;
    --info-color: #2196F3;
    --main-bgcolor: #E9E6E1;
    --footer-bg-color: #173D58;
    
    /* 尺寸變量 */
    --container-max-width: 1280px;
    --container-padding: 0 20px;
    --section-spacing: 40px;
    --element-spacing: 20px;
    --small-spacing: 10px;
    
    /* 字體變量 - Aberdeen風格 */
    --heading-font: 'Cormorant Garamond', 'Times New Roman', serif;
    --body-font: 'Montserrat', 'Arial', sans-serif;

    /* 顏色變量 - Aberdeen風格 */
    --tw-text-opacity: 1;
    --primary-color: rgb(23 61 88 / var(--tw-text-opacity));
    --accent-color: rgb(199 173 119); /* 金黃色調 */
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --top-border-color: #E9E6E1;
    --menu-border-color: #C7AD77;
    --text-dark: #333;
    --text-gray: #666;
    --blue-btn: #435d7d;
    --success-color: #4CAF50;
    --info-color: #2196F3;    
}

@media only screen and (max-width: 768px) {
    :root {
        --section-spacing: 20px;
    }
}

/* 全局重置和基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--text-dark);
    line-height: 1.6;    
}

main {
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);    
}

.wine-shop-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a5173;
    color: white;
}

.btn-accent {
    background-color: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background-color: #8a1a29;
    color: white;
}

/* Featured Products Section */
.featured-products {
    max-width: 1280px;
    margin: 0 auto;
    padding: 50px 0 0px;
}

@media (min-width: 769px) {
    .featured-products > .container {
        padding-left: 0;
        padding-right: 0;
    }
}

.featured-products .swiper {
    padding: 20px 0 0;
    margin-top: 20px;
    overflow: hidden !important;
}

.swiper-slide .product-card {
    width: 100%;
}

.product-slider-wrapper {
    position: relative;
}

.featured-products .product-slider,
.similar-products-section .similar-products-slider {
    overflow: hidden !important;
    padding: 15px;
    margin: 0;
}

.swiper-next-button {
    right: -40px;
}

.swiper-prev-button {
    left: -40px;
}

.swiper-next-button.disabled,
.swiper-prev-button.disabled {
    opacity: .3;
    pointer-events: none;
}

.product-card__footer {
    min-height: 60px;
    height: auto !important;
}

.similar-products-section {
    max-width: 1280px !important;
    padding: 0 !important;
    overflow: visible !important;
    width: 100% !important;
}

.right-elements {
    display: flex;
    column-gap: 20px;
    align-items: center;
}

.btn-mobile-menu {
    font-size: 20px;
}
.btn-mobile-search {
    font-size: 20px;
    color: var(--footer-bg-color);
}

@media only screen and (max-width: 768px) {
    .navigation-container {
        padding-bottom: 10px;
    }

    .featured-products {
        padding: 0;
    }

    .search-box {
        margin-right: 0 !important;
    }

    .nav-menu {
        position: absolute;
        top: 15px;
        left: -20px;
        right: -20px;
        background-color: var(--primary-color);
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        max-height: 0;
        transition: all .3s;
        overflow: hidden;
        flex-grow: 1;
    }

    .nav-row.bottom-row {
        padding: 0;
        flex-wrap: wrap;
        gap: 10px;
        position: relative;
    }

    .menu-items {
        background-color: var(--primary-color);
        width: 100%;
        padding: 20px !important;
    }

    .nav-menu.open {
        max-height: 100%;
        overflow: visible;
    }

    .wine-categories-scroll {
        display: none !important;
    }

    .menu-items {
        display: block !important;
    }

    .menu-items a:not(.global-hashtag) {
        color: #fff !important;
    } 
}

@media only screen and (min-width: 768px) {
    .btn-mobile-menu {
        display: none;
    }
    .btn-mobile-search {
        display: none;
    }    
}

@media only screen and (max-width: 1380px) {
    .swiper-next-button {
        right: 25px;
    }
    
    .swiper-prev-button {
        left: 25px;
    }
}

.product-card__footer {
    flex-wrap: wrap;
    gap: 20px;
}

.product-card__price-box {
    text-align: center;
}

.product-card__footer > * {
    flex-grow: 1;
    flex-shrink: 0;
}

@media (max-width: 768px) {

    .product-card__actions {
        flex-wrap: nowrap;
        flex-direction: row !important;
    }
}

.swiper-next-button,
.swiper-prev-button {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 1px solid #003366;
    border-radius: 50%;
    color: #003366 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.swiper-next-button span {
    border-left: 1.5px solid #003366;
    border-bottom: 1.5px solid #003366;
    content: '';
    width: 10px;
    height: 10px;
    display: block;
    transform: rotate(-145deg);
    position: relative;
    left: -2px;
}

.swiper-prev-button span {
    border-left: 1.5px solid #003366;
    border-bottom: 1.5px solid #003366;
    content: '';
    width: 10px;
    height: 10px;
    display: block;
    transform: rotate(45deg);
    position: relative;
    right: -2px;
}

/* 通用的标题样式 */
.section-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
    font-family: var(--heading-font);
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

/* 通用標題樣式 */
.section-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    text-align: center;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
}

.view-all-link {
    font-size: 14px;
    color: var(--primary-color);
}

.view-all-link:hover {
    color: var(--accent-color);
}

/* 消息欄樣式 */
.message-bar-new {
    position: relative;
    margin-top: 30px;
    background-color: var(--blue-btn);
    color: white;
    padding: 10px 0;
    text-align: center;
}

/* 導航欄樣式 */
.main-nav {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.site-logo img {
    height: 50px;
}

.nav-menu {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
}

.nav-menu a:hover, 
.nav-menu a.active {
    color: var(--accent-color);
}

.cart-link {
    position: relative;
}

.email-section {
    margin-top: 20px;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--accent-color);
    color: white;
    font-size: 12px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Zoom modal close button 強化 */
.image-zoom-modal .close-zoom {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    line-height: 1;
}

/* 輪播圖基本樣式 */
.slider-container {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--section-spacing);
}

.slider-item {
    display: none;
    width: 100%;
}

.slider-item.active {
    display: block;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slider-dot.active {
    background-color: white;
}

.slider-prev-btn,
.slider-next-btn {
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.slider-prev-btn {
    left: 20px;
}

.slider-next-btn {
    right: 20px;
}

.slider-prev-btn:hover,
.slider-next-btn:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.swiper-button-prev,
.swiper-button-next {
    color: #4b6584;
}

/* 頁腳樣式 */
.footer {
    background-color: var(--footer-bg-color);
    color: white;
    padding: 40px 0 20px;
}
.site-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: var(--section-spacing);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-widget {
    flex: 1;
    min-width: 200px;
}

.footer-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-widget a:hover {
    color: white;
}

.copyright {
    text-align: center;
    font-size: 14px;
    color: #fff;
}

.hours-item {
    width: auto;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .nav-menu li {
        margin: 0 15px 0 0;
    }
    
    .slider-prev-btn,
    .slider-next-btn {
        display: none;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .search-box {
        display: none;
    }

    /* 消息欄樣式 */
    .message-bar-new {
        background-color: var(--blue-btn);
        color: white;
        text-align: center;
        font-size: 14px;                
    }

    .hours-item {
        width: 100%;
    }
    
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
}

/* 輪播導航按鈕 */
.wineshop_product-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.wineshop_product-slider__nav:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.wineshop_product-slider__nav--prev {
    left: -20px;
}

.wineshop_product-slider__nav--next {
    right: -20px;
}

/* 錯誤消息樣式 */
.error-message {
    color: #dc3545;
    padding: 10px;
    margin: 10px 0;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.no-products {
    text-align: center;
    padding: 40px 0;
    color: var(--text-gray);
}

/* 結帳流程樣式 */
.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

/* 刪除.products-area樣式，已移至products-page.css */

/* 全局Hashtag样式 */
.global-hashtag {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    color: var(--text-dark);
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.4;
}

.global-hashtag:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.global-hashtag::before {
    content: "#";
    margin-right: 2px;
}

/* 字母标签样式 */
.winery-letter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 0;
}

/* 生产商列表样式 */
.producer-line {
    display: flex;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.producers-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.alphabetical-producers {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 固定在弹出菜单顶部的字母索引 */
.winery-alphabet-section {
    position: sticky;
    top: 0; /* 固定在滚动容器顶部 */
    background-color: #fff;
    z-index: 10;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.winery-alphabet-section h4 {
    margin-bottom: 8px;
}

.producers-section {
    margin-top: 20px;
    padding-top: 5px;
}

/* 字母链接样式 */
.letter-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    text-align: center;
    margin: 0 2px;
    border-radius: 50%;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
}

.letter-link:hover {
    color: var(--accent-color);
}

/* 字母筛选容器 */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
    gap: 3px;
    justify-content: center;
}

/* 生产商容器滚动区域 */
.producers-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px; /* 为滚动条预留空间 */
    margin-right: -10px; /* 补偿padding-right */
}

/* 自定义滚动条样式 */
.producers-container::-webkit-scrollbar {
    width: 6px;
}

.producers-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.producers-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.producers-container::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* Firefox支持（通过JS增强） */
html.firefox .producers-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) #f1f1f1;
}

/* 生产商链接悬停效果 */
.producers-group .global-hashtag:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* 新的無結果提示樣式 */
.no-results-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: none;
    font-family: var(--body-font);
    color: #666;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.no-results-content strong {
    color: var(--primary-color);
    margin-right: 5px;
    font-weight: 600;
}

.reset-filters-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.reset-filters-btn:hover {
    background-color: #3a506b;
    color: white;
    text-decoration: none;
}

/* 覆蓋原有的no-products-found樣式 */
.no-products-found {
    display: none !important;
}

/* 猜你喜歡部分 */
.guess-you-like-section {
    margin-top: 40px;
}

.guess-you-like-section .section-title {
    font-family: var(--heading-font);
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.guess-you-like-section .section-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--accent-color);
}

.product-card__region-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card__country-flag {
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    object-fit: cover;
}

.product-card__type-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card__grape-icon {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.producer-link {
    margin: 0 8px;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.producer-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 字母组高亮效果 */
@keyframes highlight-animation {
    0% {
        background-color: rgba(199, 173, 119, 0.1);
    }
    50% {
        background-color: rgba(199, 173, 119, 0.3);
    }
    100% {
        background-color: rgba(199, 173, 119, 0);
    }
}

.highlight-group {
    animation: highlight-animation 2s ease;
    border-radius: 4px;
}
