/* 重置樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本樣式 */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --text-color: #2d3436;
    --light-text: #636e72;
    --light-bg: #f5f6fa;
    --dark-bg: #2d3436;
    --border-color: #dfe6e9;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --error-color: #d63031;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: #F8F3C8;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

button, .btn {
    cursor: pointer;
    border: none;
    outline: none;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

button:hover, .btn:hover {
    background: #5649c0;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #d1d1d1;
}

input, select, textarea {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

/* 頁頭樣式 */
header {
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}

.top-bar {
    background-color: var(--dark-bg);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

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

.contact-info span {
    margin-right: 20px;
}

.contact-info i, .user-actions i {
    margin-right: 5px;
}

.user-actions a {
    margin-left: 15px;
    color: white;
}

.user-actions a:hover {
    color: var(--secondary-color);
}

.main-nav {
    padding: 15px 0;
    background: white;
}

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

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo span {
    color: var(--accent-color);
}

.search-bar {
    display: flex;
    width: 40%;
    position: relative;
}

.search-bar input {
    border-radius: 50px;
    padding-right: 50px;
    background-color: var(--light-bg);
    border: none;
}

.search-bar button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50px;
    border-radius: 0 50px 50px 0;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.cart-icon {
    position: relative;
    font-size: 24px;
    color: var(--primary-color);
}

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

.category-nav {
    background-color: var(--light-bg);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-nav ul {
    display: flex;
    justify-content: space-between;
}

.category-nav li a {
    padding: 5px 10px;
    font-weight: 500;
    color: var(--text-color);
}

.category-nav li a:hover {
    color: var(--primary-color);
}

/* 頁尾樣式 */
footer {
    background-color: #f5f5f5;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
}

.footer-column h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

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

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

.footer-column ul li a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.footer-column ul li a:hover {
    color: #f8d568;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.footer-bottom p {
    margin: 5px 0;
    font-size: 12px;
    color: #999;
}

/* 浮动按钮样式 */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.line-btn {
    background-color: #06c755;
}

.fb-btn {
    background-color: #3b5998;
}

.ig-btn {
    background-color: #e1306c;
}

/* 年齡驗證彈窗 */
.age-verification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.age-verification-content {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
}

.age-verification h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.age-verification p {
    margin-bottom: 15px;
}

.age-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-bar {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    .top-bar {
        background-color: white;
        color: #333;
        padding: 10px 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
    }
    
    .top-bar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
    
    .contact-info, .user-actions {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }
    
    .main-nav .container {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 0;
    }
    
    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .search-bar {
        width: 80%;
        margin: 0 auto 15px;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: center;
    }
    
    .category-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .category-nav li {
        margin: 5px;
    }
    
    .footer-middle {
        flex-direction: column;
        gap: 20px;
    }
    
    .guarantee-content {
        flex-direction: column;
    }
    
    .product-row {
        flex-direction: column;
    }
    
    .footer-top {
        flex-wrap: wrap;
    }
    
    .footer-column {
        flex: 0 0 50%;
        margin-bottom: 20px;
    }
    
    .line-content {
        flex-direction: column;
        gap: 20px;
    }
    
    /* 左侧汉堡菜单按钮 */
    .menu-toggle {
        font-size: 22px;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 中间logo */
    .logo-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-mobile img {
        height: 32px;
        width: auto;
    }
    
    /* 右侧操作按钮 */
    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .mobile-actions a {
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 为了腾出顶部固定导航的空间 */
    main {
        /*margin-top: 52px; */
        /* 根据顶部导航栏的高度调整 */
    }
    
    /* 其他移动端样式保持不变 */
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: none;
        padding: 0 15px;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .age-verification-content {
        padding: 20px;
        width: 90%;
    }
    
    .age-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-column {
        flex: 0 0 100%;
    }
}

@media (max-width: 480px) {
    .top-bar {
        font-size: 12px;
    }
    
    .contact-info span, .user-actions a {
        margin: 0 5px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .category-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-nav ul {
        display: inline-flex;
        padding: 0 10px;
    }
    
    .category-nav li {
        flex: 0 0 auto;
    }
    
    .age-verification-content {
        width: 90%;
        max-width: 300px;
        padding: 15px;
    }
    
    .age-verification h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .age-verification p {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .age-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .age-buttons button {
        width: 100%;
        padding: 8px 0;
        font-size: 14px;
    }
    
    .menu-toggle {
        font-size: 20px;
    }
    
    .logo-mobile img {
        height: 28px;
    }
    
    .mobile-actions a {
        font-size: 16px;
    }
    
    .mobile-actions .cart-count {
        width: 14px;
        height: 14px;
        font-size: 8px;
        top: -5px;
        right: -5px;
    }
    
    main {
        /*margin-top: 48px; */
        /* 根据较小的顶部导航栏高度调整 */
    }
}

/* 主横幅样式 */
.main-banner {
    background-color: #a7d7e8;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    border: 3px dashed #f8d568;
    position: relative;
}

.main-banner:before, .main-banner:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
    top: -5px;
}

.main-banner:before {
    left: 50px;
}

.main-banner:after {
    right: 50px;
}

.banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.banner-sign {
    margin-bottom: 15px;
}

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

.banner-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.feature-item i {
    color: #4caf50;
}

/* LINE官方账号区块样式 */
.line-official {
    background-color: #fff;
    border: 1px dashed #ccc;
    padding: 15px;
    margin: 20px 0;
    border-radius: 10px;
}

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

.line-text {
    flex: 1;
    text-align: left;
}

.line-text h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.line-text p {
    margin: 5px 0;
    font-size: 14px;
}

.line-qrcode {
    display: flex;
    align-items: center;
    gap: 10px;
}

.line-qrcode img {
    max-width: 80px;
    height: auto;
}

.line-icon img {
    width: 40px;
    height: auto;
}

/* 商家保证区块样式 */
.merchant-guarantee {
    background-color: #1a2b47;
    color: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.guarantee-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.guarantee-item {
    flex: 1;
    text-align: center;
}

.guarantee-item h3 {
    color: #f8d568;
    margin-bottom: 15px;
    font-size: 18px;
}

.guarantee-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.guarantee-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.guarantee-details img {
    max-width: 150px;
    margin-bottom: 15px;
}

.guarantee-features {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.g-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.g-feature i {
    font-size: 20px;
    color: #f8d568;
}

/* 商品展示区样式 */
.product-showcase {
    margin: 30px 0;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.product-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.product-card {
    flex: 1;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.product-image {
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff6b6b;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.product-price {
    margin-bottom: 15px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
}

.add-to-cart-btn {
    background-color: #f8d568;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #ffc107;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 10px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 5px;
    text-decoration: none;
}

.pagination a.active {
    background-color: #f8d568;
    color: #333;
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #4caf50;
  color: white;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.notification i {
  font-size: 20px;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 移动端和桌面端显示控制 */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.menu-toggle:hover {
    color: var(--primary-color);
    background: none;
    transform: none;
}

/* 移动端logo */
.logo-mobile {
    display: none;
}

.logo-mobile img {
    height: 40px;
    width: auto;
}

/* 移动端操作按钮 */
.mobile-actions {
    display: none;
    gap: 15px;
}

.mobile-actions a {
    color: #333;
    font-size: 20px;
    position: relative;
}

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

/* 移动端导航菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: white;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-menu {
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.close-menu:hover {
    color: var(--primary-color);
    background: none;
    transform: none;
}

.mobile-nav-list {
    padding: 15px;
}

.mobile-nav-list li {
    margin-bottom: 15px;
}

.mobile-nav-list a {
    display: block;
    padding: 10px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.mobile-nav-list a:hover {
    color: var(--primary-color);
}

/* 遮罩层 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .logo-mobile {
        display: block;
    }
    
    .mobile-actions {
        display: flex;
    }
    
    .top-bar {
        background-color: white;
        color: #333;
        padding: 10px 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .top-bar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
}
