/* BNJIS Theme Custom Styles */

/* Global Variables */
:root {
    --bnjis-primary: #00a854;
    --bnjis-primary-dark: #008f47;
    --bnjis-primary-light: #e6f7ef;
    --bnjis-secondary: #f5a623;
    --bnjis-text: #1a1a1a;
    --bnjis-text-muted: #666666;
    --bnjis-border: #e0e0e0;
    --bnjis-bg-light: #f8f9fa;
}

/* Remove all gaps - Force reset */
html, body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove gap between header and main content */
body > header,
.wp-site-blocks > header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Target the gap specifically */
.wp-site-blocks > * + * {
    margin-block-start: 0 !important;
}

/* Remove gap after header template part */
.wp-block-template-part + * {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Header Styles - Enhanced */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove gap between header and content - FORCE */
.site-header + *,
.site-header + main,
.site-header + .wp-block-group,
.wp-block-template-part + main,
.wp-block-template-part + .wp-block-group {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* Header inner spacing */
.site-header .wp-block-group {
    min-height: 60px;
}

/* Navigation menu items */
.site-header .wp-block-navigation-item a {
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
}

/* Logo sizing */
.site-header .wp-block-site-logo img {
    max-height: 50px;
    width: auto;
}

/* Remove body padding/margin */
body .is-layout-constrained > .wp-block-group {
    margin-block-start: 0 !important;
}

/* WordPress block gap fix */
.wp-site-blocks main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove all margins from first elements */
main > *:first-child,
.bnjis-product-page > *:first-child,
.bnjis-home > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Navigation styles */
.wp-block-navigation__responsive-container {
    background-color: var(--bnjis-primary) !important;
}

.wp-block-navigation-item a {
    color: #ffffff !important;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.wp-block-navigation-item a:hover {
    opacity: 0.8;
}

/* Language Switcher Styles */
.bnjis-lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.bnjis-lang-switcher a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.bnjis-lang-switcher a:hover {
    background-color: rgba(255,255,255,0.2);
}

.bnjis-lang-switcher a.current {
    background-color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.bnjis-lang-switcher img {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

/* Hero Section */
.bnjis-hero {
    position: relative;
}

.bnjis-hero .wp-block-cover__inner-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Stats Section */
.bnjis-stats {
    text-align: center;
}

.bnjis-stats .wp-block-heading {
    color: var(--bnjis-primary);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Factory Section Overlay */
.factory-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
}

/* Certificate Cards */
.cert-card {
    transition: transform 0.3s ease;
    border: 1px solid var(--bnjis-border);
}

.cert-card:hover {
    transform: scale(1.02);
}

/* News Cards */
.news-card {
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.news-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.news-card .wp-block-post-title a {
    color: var(--bnjis-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card .wp-block-post-title a:hover {
    color: var(--bnjis-primary);
}

/* Partner Logos */
.partner-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Footer Styles */
.site-footer {
    background-color: var(--bnjis-primary);
}

.site-footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #ffffff;
}

/* Button Styles */
.wp-block-button__link {
    transition: all 0.3s ease !important;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,168,84,0.3);
}

/* Section Title Decorations */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::before,
.section-title::after {
    content: '—';
    margin: 0 0.5rem;
    color: var(--bnjis-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wp-block-cover {
        min-height: 400px !important;
    }
    
    .bnjis-stats .wp-block-heading {
        font-size: 2rem;
    }
    
    .wp-block-columns {
        flex-wrap: wrap;
    }
    
    .wp-block-column {
        flex-basis: 100% !important;
    }
    
    .bnjis-lang-switcher {
        position: absolute;
        top: 0.5rem;
        right: 4rem;
    }
    
    .bnjis-lang-switcher a span {
        display: none;
    }
}

/* Animation for scroll reveal */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: fadeInUp 0.6s ease forwards;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--bnjis-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bnjis-primary-dark);
}

/* Image hover effect */
.wp-block-image img {
    transition: transform 0.3s ease;
}

.wp-block-image:hover img {
    transform: scale(1.05);
}

/* Query block pagination */
.wp-block-query-pagination {
    margin-top: 3rem;
}

.wp-block-query-pagination a {
    color: var(--bnjis-primary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--bnjis-border);
    border-radius: 4px;
    margin: 0 0.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wp-block-query-pagination a:hover {
    background-color: var(--bnjis-primary);
    color: #ffffff;
    border-color: var(--bnjis-primary);
}

/* Product Tabs - Click Switch Style */
.bnjis-product-tabs {
    cursor: pointer;
}

.bnjis-product-tab {
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 1rem;
}

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

.bnjis-product-tab .bnjis-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #00a854;
    background: #fff;
    color: #00a854;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bnjis-product-tab .bnjis-icon-circle svg {
    width: 48px;
    height: 48px;
}

.bnjis-product-tab-title {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #00a854;
    text-align: center;
    transition: all 0.3s ease;
}

/* Active state - Green filled */
.bnjis-product-tab.active .bnjis-icon-circle {
    background: #00a854;
    border-color: #00a854;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 168, 84, 0.4);
}

.bnjis-product-tab.active .bnjis-product-tab-title {
    color: #00a854;
    font-weight: 600;
}

/* Product Content Panels */
.bnjis-product-content {
    margin-top: 2rem;
}

.bnjis-product-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bnjis-product-panel.active {
    display: block;
    opacity: 1;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bnjis-product-panel.active .wp-block-column {
    animation: fadeIn 0.5s ease forwards;
}

.bnjis-product-panel.active .wp-block-column:nth-child(1) { animation-delay: 0s; }
.bnjis-product-panel.active .wp-block-column:nth-child(2) { animation-delay: 0.1s; }
.bnjis-product-panel.active .wp-block-column:nth-child(3) { animation-delay: 0.2s; }
.bnjis-product-panel.active .wp-block-column:nth-child(4) { animation-delay: 0.3s; }

/* ========================================
   Certificate Carousel Styles
   ======================================== */
.bnjis-cert-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
}

.bnjis-cert-wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
}

.bnjis-cert-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 20px;
}

/* Certificate Slide */
.bnjis-cert-slide {
    flex: 0 0 calc(33.333% - 14px);
    text-align: center;
    transition: all 0.5s ease;
    opacity: 0.6;
    transform: scale(0.85);
}

.bnjis-cert-slide.active {
    opacity: 1;
    transform: scale(1);
}

/* Certificate Card */
.bnjis-cert-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bnjis-cert-slide.active .bnjis-cert-card {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid #f5a623; /* 金色边框高亮 */
}

.bnjis-cert-img {
    margin: 0 !important;
}

.bnjis-cert-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* Certificate Title */
.bnjis-cert-title {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bnjis-cert-slide.active .bnjis-cert-title {
    opacity: 1;
    color: #333;
    font-weight: 500;
}

/* Arrow Buttons */
.bnjis-cert-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid #00a854;
    border-radius: 50%;
    color: #00a854;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.bnjis-cert-arrow:hover {
    background: #00a854;
    color: #fff;
}

.bnjis-cert-arrow svg {
    width: 24px;
    height: 24px;
}

.bnjis-cert-prev {
    left: 0;
}

.bnjis-cert-next {
    right: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .bnjis-cert-carousel {
        padding: 0 40px;
    }
    
    .bnjis-cert-slide {
        flex: 0 0 80%;
    }
    
    .bnjis-cert-arrow {
        width: 40px;
        height: 40px;
    }
    
    .bnjis-cert-arrow svg {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   Partners Carousel Styles
   ======================================== */
.bnjis-partners-carousel {
    position: relative;
}

.bnjis-partners-wrapper {
    overflow: hidden;
    width: 100%;
}

.bnjis-partners-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Partners Slide */
.bnjis-partners-slide {
    flex: 0 0 100%;
    width: 100%;
}

/* Partners Grid */
.bnjis-partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px 0;
}

/* Partner Item */
.bnjis-partner-item {
    flex: 0 0 calc(20% - 24px);
    max-width: 180px;
}

/* Partner Box */
.bnjis-partner-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    transition: all 0.3s ease;
}

.bnjis-partner-box:hover {
    border-color: #00a854;
    box-shadow: 0 4px 15px rgba(0, 168, 84, 0.15);
}

.bnjis-partner-box img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.bnjis-partner-box:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Pagination Dots */
.bnjis-partners-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
}

.bnjis-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.bnjis-dot:hover {
    background: #bbb;
}

.bnjis-dot.active {
    background: #00a854;
    transform: scale(1.2);
}

/* ========================================
   About Page Subnav Styles (Horizontal Text Style)
   ======================================== */
.about-subnav {
    position: sticky;
    top: 60px;
    z-index: 100;
    background: #008f47;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.subnav-list {
    display: flex;
    justify-content: center;
    padding: 0;
}

.subnav-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.3);
    margin: 0;
    padding: 1rem 2rem;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subnav-item:last-child {
    border-right: none;
}

.subnav-item:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.1);
}

.subnav-item.active {
    color: #ffffff !important;
    background: rgba(255,255,255,0.15);
}

.subnav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ffffff;
}

/* Remove icon styles for text-only version */
.subnav-item .icon-circle,
.subnav-item .bnjis-icon-circle {
    display: none;
}

.subnav-item-title {
    margin: 0;
    font-size: 1rem;
    color: inherit;
}

/* About Section Content */
.about-section {
    display: none;
}

.about-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .bnjis-partners-grid {
        gap: 15px;
    }
    
    .bnjis-partner-item {
        flex: 0 0 calc(33.333% - 10px);
    }
    
    .bnjis-partner-box {
        height: 80px;
        padding: 15px;
    }
    
    .bnjis-partner-box img {
        max-height: 50px;
    }
    
    .about-subnav {
        top: 50px;
    }
    
    .subnav-list {
        flex-wrap: wrap;
    }
    
    .subnav-item {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
}
