/* ================================
   五力機電廠股份有限公司 - 主樣式表
   ================================ */

/* ================================
   配色方案：紅灰白
   主紅色：#C41E3A
   深紅色：#8B0000
   深灰色：#495057
   中灰色：#6C757D
   淺灰色：#E9ECEF
   背景色：#F8F9FA
   ================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Container - 與 header logo 位置切齊 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo img {
    height: 60px;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    font-weight: 500;
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
}

.main-nav a:hover,
.main-nav li.active a {
    color: #C41E3A;
    background: #FFE5E9;
}

.main-nav .has-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    min-width: 200px;
    padding: 10px 0;
    list-style: none;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.has-dropdown:hover .dropdown-menu {
    display: block;
    visibility: visible;
    opacity: 1;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
}

.dropdown-menu a:hover {
    background: #FFE5E9;
    color: #C41E3A;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.language-switcher a {
    padding: 5px 10px;
    border-radius: 3px;
}

.language-switcher a.active {
    background: #C41E3A;
    color: #fff;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    overflow: hidden;
    background: #000;
}

.slider-container {
    position: relative;
    width: 100%;
    height: var(--slider-height, 500px);
    transition: height 0.5s ease;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    color: #fff;
    z-index: 10;
}

.slide-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-description {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
}

.slider-prev,
.slider-next {
    background: rgba(255,255,255,0.3);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

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

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

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

.dot.active {
    background: #fff;
}

/* Sections */
.welcome-section,
.product-categories,
.featured-products,
.contact-cta {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.section-subtitle {
    font-size: 18px;
    color: #666;
}

/* Product Categories & Cards */
.categories-grid,
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.category-card,
.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover,
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.category-image,
.product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    /* 16:9 比例 = (9/16) * 100% = 56.25% */
    padding-bottom: 56.25%;
}

.category-image img,
.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s;
}

.category-card:hover .category-image img,
.product-card:hover .product-image img {
    transform: scale(1.1);
}

.category-content,
.product-content {
    padding: 25px;
}

.category-content h3,
.product-content h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #333;
}

.category-content p,
.product-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background: #C41E3A;
    color: #fff;
}

.btn-primary:hover {
    background: #8B0000;
}

.btn-outline {
    background: transparent;
    border: 2px solid #C41E3A;
    color: #C41E3A;
}

.btn-outline:hover {
    background: #C41E3A;
    color: #fff;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

/* Contact CTA */
.contact-cta {
    background: linear-gradient(135deg, #C41E3A 0%, #8B0000 100%);
    color: #fff;
    text-align: center;
}

.cta-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

/* Page Header */
.page-header {
    /*background: linear-gradient(135deg, #C41E3A 0%, #8B0000 100%);*/
    background: url('assets/images/c-1.png') center center no-repeat;
    background-size: cover;


    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    font-weight: 700;
}

/* About Image Section */
.about-image-section {
    padding: 40px 0 20px;
    background: #fff;
}

.about-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.et_pb_image {
    margin-left: auto;
    margin-right: auto;
    line-height: 0;
    display: block;
}

.et_pb_image .et_pb_image_wrap {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

.et_pb_image .et_pb_image_wrap img {
    position: relative;
    width: 100%;
    height: auto;
}

.et_pb_image_0 {
    margin-top: -25px;
    width: 61%;
    text-align: left;
    margin-left: 0;
}

.et_pb_image_0.et_pb_module {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Responsive - Tablet */
@media only screen and (max-width: 980px) {
    .et_pb_image_0 {
        width: 80%;
    }
    
    .et_pb_image_0 .et_pb_image_wrap img {
        width: auto;
        max-width: 100%;
    }
}

/* Responsive - Mobile */
@media only screen and (max-width: 767px) {
    .about-image-section {
        padding: 20px 0 10px;
    }
    
    .et_pb_image_0 {
        width: 100%;
        margin-top: -15px;
    }
    
    .et_pb_image_0 .et_pb_image_wrap img {
        width: 100%;
    }
}

/* Breadcrumb */
.breadcrumb {
    background: #f5f5f5;
    padding: 15px 0;
}

.breadcrumb ul {
    display: flex;
    list-style: none;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 10px;
    color: #999;
}

.breadcrumb a {
    color: #C41E3A;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Product Detail */
.product-detail {
    padding: 50px 0;
}

.detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery .main-image {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f9f9f9;
    /* 16:9 比例 = (9/16) * 100% = 56.25% */
    padding-bottom: 56.25%;
}

.product-gallery .main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #C41E3A;
}

.product-info .product-category {
    color: #C41E3A;
    font-weight: 500;
    margin-bottom: 10px;
}

.product-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.product-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: #666;
}

/* Tabs */
.product-tabs {
    background: #f9f9f9;
    padding: 50px 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-btn:hover {
    color: #C41E3A;
}

.tab-btn.active {
    color: #C41E3A;
    border-bottom-color: #C41E3A;
}

.tab-pane {
    display: none;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    line-height: 1.8;
}

.tab-pane.active {
    display: block;
}

/* Contact Page */
.contact-page {
    padding: 60px 0 !important;
}

.contact-content {
    padding: 60px 0;
}

.contact-info-section {
    margin-bottom: 120px;
}

.office-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 80px;
    padding: 50px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-left: 6px solid #C41E3A;
}

.office-info {
    padding-right: 20px;
}

.office-map {
    display: flex;
    align-items: center;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.info-icon {
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #C41E3A, #8B1538);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* Contact Page Info Content */
.contact-page .info-content {
    opacity: 1 !important;
    transform: none !important;
    position: static !important;
}

.contact-page .info-content h4 {
    color: #000 !important;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.contact-page .info-content p {
    color: #000 !important;
    line-height: 1.6;
    margin: 0;
}

.info-content a {
    color: #C41E3A;
    font-weight: 500;
    text-decoration: none;
}

.info-content a:hover {
    text-decoration: underline;
}

.map-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.map-container iframe {
    width: 100%;
    border: none;
    border-radius: 10px;
}

.contact-form-section {
    background: white;
    padding: 60px 50px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

/* Form */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #C41E3A;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.contact-form textarea {
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Category Filter */
.category-filter {
    background: #f9f9f9;
    padding: 30px 0;
}

.filter-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 25px;
    border-radius: 25px;
    background: #fff;
    border: 2px solid #ddd;
    font-weight: 500;
    transition: 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #C41E3A;
    color: #fff;
    border-color: #C41E3A;
}

.products-list {
    padding: 50px 0;
}

.no-products {
    text-align: center;
    padding: 50px 0;
    color: #666;
}

/* Related Products */
.related-products {
    padding: 50px 0;
    background: #f9f9f9;
}

.related-products h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
}

/* Footer */
.site-footer {
    background: #000000;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3,
.footer-column h4 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-column p {
    color: #bbb;
    line-height: 1.8;
}

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

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

.footer-column a {
    color: #bbb;
    transition: 0.3s;
}

.footer-column a:hover {
    color: #fff;
}

.contact-info li {
    margin-bottom: 15px;
    color: #bbb;
}

.contact-info strong {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    color: #bbb;
}

/* ================================
   About Page 1 (ET Builder Style)
   ================================ */

/* Main Content Area */
#et-main-area {
    background-color: #fff;
}

#main-content {
    max-width: 100%;
    margin: 0 auto;
}

/* Article & Entry Content */
.entry-content {
    padding: 0;
}

.et-l {
    width: 100%;
}

.et_builder_inner_content {
    position: relative;
    z-index: 1;
}

/* Gutters */
.et_pb_gutters3 .et_pb_row {
    padding-left: 5.5%;
    padding-right: 5.5%;
}

.et_pb_gutters3.et_pb_row {
    padding-left: 5.5%;
    padding-right: 5.5%;
}

/* Sections */
.et_pb_section {
    position: relative;
    background-color: #fff;
    background-position: 50%;
    background-size: 100%;
    background-repeat: no-repeat;
    padding: 54px 0;
}

.et_section_regular {
    display: block;
}

.et_pb_section_0 {
    background-image: radial-gradient(circle at top left, rgba(40, 40, 40, 0.79) 0%, rgba(40, 40, 40, 0.86) 100%), url(../images/C-1.png) !important;
    background-size: cover !important;
    /* padding 由後台設定的 min-height 控制，不需要固定值 */
    display: flex;
    align-items: center;
}

.et_pb_section_1 {
    padding-bottom: 23px;
}

.et_pb_with_background {
    position: relative;
    z-index: 0;
}

/* Rows */
.et_pb_row {
    width: 80%;
    max-width: 1080px;
    margin: auto;
    position: relative;
}

.et_pb_section_0 .et_pb_row {
    display: flex;
    align-items: center;
    width: 100%;
}

.et_pb_row:after {
    content: "";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

.et_pb_row_0 {
    /* 高度由父元素 et_pb_section_0 的 min-height 控制 */
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
}

/* Columns */
.et_pb_column {
    float: left;
    background-size: cover;
    background-position: 50%;
    position: relative;
    z-index: 2;
    min-height: 1px;
    padding: 0;
}

.et_pb_column_2_3 {
    width: 66.667%;
}

.et_pb_column_1_3 {
    width: 33.333%;
}

.et_pb_column_4_4 {
    width: 100%;
}

.et_pb_column_empty {
    min-height: 1px;
}

.et-last-child {
    margin-right: 0 !important;
}

.et_pb_css_mix_blend_mode_passthrough {
    mix-blend-mode: unset !important;
}

/* Modules */
.et_pb_module {
    animation-timing-function: ease-in-out;
    animation-duration: .2s;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;
    position: relative;
}

/* Text Module */
.et_pb_text {
    word-wrap: break-word;
}

.et_pb_text_align_left {
    text-align: left;
}

.et_pb_bg_layout_light {
    color: #333;
}

.et_pb_bg_layout_dark {
    color: #fff !important;
}

.et_pb_text_inner {
    position: relative;
}

.et_pb_text_0 {
    border-left: 10px solid #C41E3A;
    padding-left: 20px !important;
    margin-left: -60px !important; /* 調整紅色標記位置與LOGO對齊 */
}

.et_pb_with_border {
    position: relative;
}

.et_pb_text_0 h1 {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 90px;
    line-height: 1.1em;
    margin: 0;
    padding: 0;
    color: #fff;
}

.et_pb_module_header {
    margin: 0;
    padding: 0;
}

.et_pb_text_1 {
    max-width: 1080px;
}

.et_pb_text_1 p {
    line-height: 1.8em;
    font-size: 18px;
    margin-bottom: 1em;
    color: #333;
}

/* Image Module */
.et_pb_image {
    margin-left: auto;
    margin-right: auto;
    line-height: 0;
    display: block;
}

.et_pb_image .et_pb_image_wrap {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

.et_pb_image .et_pb_image_wrap img {
    position: relative;
    width: 100%;
    height: auto;
}

.et_pb_image_0 {
    margin-top: -25px !important;
    width: 61%;
    text-align: left;
    margin-left: 0;
}

.et_pb_image_0.et_pb_module {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Responsive Styles */
@media only screen and (max-width: 980px) {
    .et_pb_gutters3 .et_pb_row {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    .et_pb_row {
        width: 100%;
        max-width: 100%;
        padding: 0 30px;
    }
    
    .et_pb_column_2_3,
    .et_pb_column_1_3,
    .et_pb_column_4_4 {
        width: 100%;
        margin: 0;
    }
    
    .et_pb_text_0 {
        border-left-width: 10px;
        margin-left: -40px !important; /* 平板設備調整 */
    }
    
    .et_pb_text_0 h1 {
        font-size: 50px;
    }
    
    .et_pb_image_0 {
        width: 80%;
    }
    
    .et_pb_image_0 .et_pb_image_wrap img {
        width: auto;
        max-width: 100%;
    }
}

@media only screen and (max-width: 767px) {
    .et_pb_row {
        padding: 0 20px;
    }
    
    .et_pb_text_0 {
        border-left-width: 10px;
        padding-left: 15px !important;
        margin-left: -20px !important; /* 手機設備調整 */
    }
    
    .et_pb_text_0 h1 {
        font-size: 35px;
    }
    
    .et_pb_text_1 p {
        font-size: 16px;
    }
    
    .et_pb_image_0 {
        width: 100%;
        margin-top: -15px !important;
    }
    
    .et_pb_image_0 .et_pb_image_wrap img {
        width: 100%;
    }
    
    .et_pb_section {
        padding: 30px 0;
    }
    
    /* 手機版 Container 調整 */
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

/* 平板版響應式 */
@media only screen and (min-width: 768px) and (max-width: 980px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
}
