/* ============================================
   IWATSU 專業測棒 - 國際設計大師級 UI 風格
   ============================================ */

/* 變數定義 */
:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    
    --font-primary: 'Inter', 'Noto Sans TC', sans-serif;
    --font-secondary: 'Noto Sans TC', sans-serif;
    
    --spacing-unit: 1rem;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    padding-top: 80px; /* 預留 navbar 空間 */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* 專業自然風格導航列 */
.navbar {
    background: #3175da !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    color: #ffffff !important;
    font-weight: 800;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: #ffffff !important;
    padding: 0.5rem 1.25rem !important;
    transition: var(--transition);
    position: relative;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 漢堡選單按鈕樣式 */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 優雅的底部線條效果 - 已取消 */
/* .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
    opacity: 0;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 20px;
    opacity: 1;
} */

/* 下拉選單樣式優化 */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 0;
    margin-top: 1rem;
    background: white;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    color: #4a5568;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f7fafc;
    color: var(--primary-color);
    padding-left: 2rem;
}

/* 產品主頁面區塊 */
.products-main-section {
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
    display: flex;
    align-items: center;
}

.product-category-btn {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: var(--transition);
}

.product-category-btn .btn-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-category-btn:hover .btn-content {
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-5px);
}

.product-category-btn h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
}

.product-category-btn:hover h3 {
    color: var(--primary-color);
}

/* 頁面標題 - 移除原有漸層背景，改為簡潔風格 */
.page-header {
    background: white;
    padding: 3rem 0 2rem;
    color: #1a1a1a;
    border-bottom: 1px solid #e2e8f0;
    margin-top: 0; /* 因 navbar 樣式改變調整 */
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.page-header .breadcrumb-item a {
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
}

.page-header .breadcrumb-item.active {
    color: #2d3748;
    font-size: 0.9rem;
}

/* 子類別導航 */
.subcategories-nav {
    border-bottom: 1px solid #edf2f7;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.subcategory-toggle-btn {
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
}

.subcategory-toggle-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subcategory-toggle-btn[aria-expanded="true"] .subcategory-chevron {
    transform: rotate(180deg);
}

.subcategory-btn {
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    margin: 0.25rem;
    white-space: nowrap;
}

.subcategory-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 滑鼠移過時顯示下拉選單 */
.subcategories-nav .dropdown:hover .dropdown-menu {
    display: block;
}

/* 內容區域 */
.content-section {
    padding: 4rem 0;
    background: #fff;
}

.slide-content {
    scroll-margin-top: 150px;
}

.slide-content .card {
    border: none;
    background: transparent;
}

.slide-content .card-body {
    padding: 0;
}

.slide-content .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    color: #2d3748;
    display: inline-block;
    padding-right: 2rem;
}

.content-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4a5568;
}

.content-text p {
    margin-bottom: 1.25rem;
}

/* 表格樣式優化 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #2d3748;
}

/* 產品圖片容器 */
.product-images-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 產品圖片 - 固定大小 */
.product-fixed-image {
    width: 100%;
    object-fit: contain;
    border-radius: 1rem;
    background: white;
    padding: 1rem;
    border: none;
}

/* 響應式：小螢幕時圖片在上，文字在下 */
@media (max-width: 767px) {
    .product-fixed-image {
        height: 250px;
    }
}

/* Footer */
footer {
    background: white !important; /* 改為白色背景 */
    border-top: 1px solid #e2e8f0;
}

footer .text-white-50 {
    color: #718096 !important;
}

footer .bg-white-50 {
    background-color: #e2e8f0 !important;
    opacity: 1;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

/* 聯絡頁面樣式 */
.contact-card {
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
    border: 1px solid #e2e8f0;
    background: white;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.contact-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: #ebf8ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.contact-card:hover .contact-icon {
    background: var(--primary-color);
    color: white;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .product-category-btn h3 {
        font-size: 1.1rem;
    }
    
    .slide-content .card-title {
        font-size: 1.5rem;
    }
    
    .subcategories-nav {
        position: sticky !important;
        top: 70px !important;
        z-index: 99;
    }
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
}

/* 載入動畫 */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 產品卡片標題統一樣式 */
.product-card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    padding: 0.5rem 1rem !important;
    margin-bottom: 1rem !important;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}