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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Broader font stack */
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

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

ul {
    list-style: disc;
    padding-left: 20px; /* Default LTR padding */
    margin-bottom: 1em;
}

ol {
     list-style: decimal;
     padding-left: 20px; /* Default LTR padding */
     margin-bottom: 1em;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.8em;
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 0; } /* Reset top margin for section titles */
h3 { font-size: 1.5em; color: #0056b3; margin-top: 20px;}
h4 { font-size: 1.2em; }

/* --- Utility & Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    gap: 25px;
    margin-top: 20px;
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }


.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

.section-padding {
    padding: 40px 0;
}

.bg-light {
     background-color: #f9f9f9;
     border-top: 1px solid #eee;
     border-bottom: 1px solid #eee;
}

.cta-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #007bff;
    color: white !important; /* Ensure white text */
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    margin: 10px 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* --- Header & Navigation --- */
header {
    background-color: #ffffff;
    padding: 10px 0;
    border-bottom: 1px solid #e7e7e7;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo a {
    text-decoration: none;
    color: #333;
    display: inline-block; /* Important for image alignment */
}
.logo img {
    height: 50px; /* Adjust as needed */
    width: auto;
    vertical-align: middle; /* Align image nicely if text is next to it */
}

nav {
    margin: 0 15px; /* Add some space around nav */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Allow nav items to wrap */
}

nav ul li {
    margin-left: 20px; /* Default LTR margin */
    margin-bottom: 5px; /* Space if wrapping */
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent link text from wrapping */
}

nav a:hover {
    color: #007bff;
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0; /* Default LTR */
    background: #007bff;
    transition: width .3s ease;
}
nav a:hover::after {
    width: 100%;
    left: 0; /* Default LTR */
    background-color: #007bff;
}
nav li.active a {
    color: #007bff;
    font-weight: bold;
}
nav li.active a::after {
     width: 100%;
     left: 0; /* Default LTR */
     background-color: #007bff;
}


.language-switcher {
    margin-left: auto; /* Push switcher to the right in flex layout */
}

.language-switcher select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    font-size: 0.9em;
    cursor: pointer;
    /* margin-left: 15px; /* Removed, margin-left: auto handles positioning */
}

/* --- Footer --- */
footer {
    background-color: #333;
    color: #ccc;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 0.9em;
    text-align: center;
}

footer .container p {
    margin: 8px 0;
}
footer .container strong {
    color: #fff;
}

footer a {
    color: #00aaff;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

footer #year {
    font-weight: normal;
}


/* --- Homepage Specific Styles --- */
#hero {
    position: relative;
    overflow: hidden;
    height: 500px;
    background-color: #eee;
    width: 100%;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.65);
    padding: 25px 35px;
    text-align: center;
    border-radius: 8px;
    z-index: 3;
    max-width: 75%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.banner-text h1 {
    font-size: 2.2em;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.banner-text p {
    font-size: 1.1em;
    margin-bottom: 20px;
}


#welcome h2 {
    text-align: center;
    border-bottom: none;
    margin-bottom: 20px;
    color: #0056b3;
}
#welcome p {
    text-align: justify;
    font-size: 1.1em;
    color: #555;
}

#featured-products .product-item,
#core-strengths .strength-item {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex; /* Use flexbox for alignment */
    flex-direction: column; /* Stack items vertically */
}

#featured-products .product-item:hover,
#core-strengths .strength-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}


#featured-products .product-item img {
    height: 200px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 15px auto;
}
#featured-products .product-item h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #333;
    margin-top: auto; /* Push title down if needed */
}
#featured-products .product-item p {
    font-size: 0.95em;
    color: #666;
    flex-grow: 1; /* Allow paragraph to take space */
}

#core-strengths {
    padding: 30px 0;
}
#core-strengths h2 {
    text-align: center;
}

#core-strengths .strength-item {
    align-items: center;
    min-height: 150px;
}

#core-strengths .strength-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}
#core-strengths .strength-item p {
    font-size: 0.9em;
    color: #555;
    flex-grow: 1;
}
#core-strengths .strength-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 1.05em;
}


#why-us h2 {
    border-bottom: none;
    margin-bottom: 15px;
}


/* --- Inner Page Styles --- */
.page-title {
    text-align: center;
    padding: 60px 20px;
    background-size: cover;
    background-position: center center;
    color: #fff;
    margin-bottom: 30px;
    position: relative;
}
.page-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}
.page-title h1 {
    margin: 0;
    font-size: 2.8em;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* About Page */
#story-vision h3, #team h3, #manufacturing-advantages h3, #commitment h3 {
    margin-top: 30px;
}
#story-vision ul, #team ul, #manufacturing-advantages ul {
     margin-top: 15px;
     padding-left: 25px; /* LTR */
}
#story-vision li, #team li, #manufacturing-advantages li {
     margin-bottom: 8px;
}
#sea-focus, #manufacturing-advantages {
    padding: 30px 0;
}


/* Products Page */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-category-item {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    text-align: center;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.product-category-item:hover {
     box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Products Page - Updated for Square Images */
.product-category-item img {
    width: 200px; /* Set desired square width */
    height: 200px; /* Set equal desired square height */
    object-fit: cover; /* Scales the image to maintain aspect ratio while filling the element's entire content box. The image will be clipped to fit. */
    object-position: center center; /* Centers the image within the frame */
    border-bottom: 1px solid #eee;
    margin-left: auto;   /* Center the image block horizontally */
    margin-right: auto;  /* Center the image block horizontally */
    margin-bottom: 15px; /* Space below the image */
    display: block; /* Necessary for auto margins to work for centering */
}

/* Optional: Adjust size for smaller screens */
@media (max-width: 576px) { /* Adjust breakpoint if needed */
    .product-category-item img {
        width: 150px; /* Smaller square on small screens */
        height: 150px;
    }
}


.product-category-item h4 {
    margin: 15px 10px;
    font-size: 1.15em;
    color: #333;
    margin-top: auto;
    padding-top: 10px;
}
#products-by-material {
     padding: 30px 0;
}


/* Capabilities Page */
.capability-section {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}
.capability-section:first-of-type {
    border-top: none;
    padding-top: 0;
}
#supply-chain .capability-section {
     border-top: 1px dashed #ccc;
     margin-bottom: 0;
}


.capability-section .text-content {
    flex: 1;
}

.capability-section .image-content {
    flex-basis: 250px;
    flex-shrink: 0;
    text-align: center;
    margin-top: 10px;
}

.capability-section .image-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.capability-section h3 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
    margin-bottom: 20px;
    margin-top: 0;
}

.capability-section h4 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
}
.capability-section h4:first-of-type {
    margin-top: 0;
}

.capability-section ul {
    padding-left: 20px; /* LTR default */
    margin-bottom: 15px;
}
.capability-section ul li {
     margin-bottom: 10px;
}
.capability-section p strong {
    color: #0056b3;
}

/* Process Page */
.process-steps {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    counter-reset: process-counter;
    position: relative;
}

.process-steps::before {
    content: '';
    position: absolute;
    left: 17px; /* LTR default */
    top: 17px;
    bottom: 17px;
    width: 3px;
    background-color: #e0e0e0;
    z-index: -1;
}

.process-steps li {
    counter-increment: process-counter;
    margin-bottom: 35px;
    padding-left: 55px; /* LTR default */
    position: relative;
    padding-bottom: 20px;
}

.process-steps li::before {
    content: counter(process-counter);
    position: absolute;
    left: 0; /* LTR default */
    top: 0;
    background-color: #007bff;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    font-size: 1.1em;
    z-index: 1;
    border: 2px solid white;
    box-shadow: 0 0 0 3px #007bff;
}

.process-steps h4 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #0056b3;
}

.process-steps p {
    margin: 5px 0 10px 0;
    color: #555;
    font-size: 1em;
}
.process-steps a {
    font-weight: 600;
}

#process-intro p, #cooperation-simplified p {
    font-size: 1.1em;
}

#cooperation-simplified h2 {
    border-bottom: none;
    margin-bottom: 15px;
}

/* --- Contact Page Iframe Styles --- */
.iframe-container {
    margin-top: 20px;
    margin-bottom: 20px;
    position: relative; /* Keeps context for potential absolute positioning inside */
    width: 100%; /* Explicitly set width to 100% */
    /* Centering is handled by the container/block nature */
}

.feedback-iframe {
    display: block; /* Ensure it behaves like a block element */
    width: 100%; /* Make iframe fill the container width */
    height: 1400px; /* Set the desired fixed height */
    border: 1px solid #ccc; /* Optional: Keep or remove border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Optional: Keep or remove shadow */
    margin-left: auto; /* Ensure centering if container somehow allows it */
    margin-right: auto; /* Ensure centering if container somehow allows it */
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
     h1 { font-size: 2.1em; }
     h2 { font-size: 1.8em; }
     .page-title h1 { font-size: 2.4em; }

     nav { flex-grow: 1; } /* Allow nav to take space */

     .capability-section {
        flex-direction: column;
        gap: 20px;
     }
     .capability-section .image-content {
         flex-basis: auto;
         width: 70%;
         max-width: 300px;
         margin: 20px auto 0 auto;
     }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .logo { margin-bottom: 10px; }
    nav { width: 100%; margin: 10px 0; } /* Adjust margin */
    nav ul {
        flex-direction: column;
        width: 100%;
        /* margin-top: 10px; */ /* Removed, handled by nav margin */
    }
    nav ul li {
        margin-left: 0;
        margin-bottom: 10px;
        text-align: left;
        width: 100%;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }
     nav ul li:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    nav a::after {
        display: none;
    }

    .language-switcher {
        /* margin-top: 15px; */ /* Removed, handled by header wrap */
        align-self: flex-end;
        margin-left: 0;
    }

    .grid-3, .grid-4, .grid-5 {
        grid-template-columns: 1fr;
    }

    #featured-products .product-item img { height: 150px; }
    /* Product grid already adjusts with auto-fit */

    .process-steps li { padding-left: 45px; } /* LTR */
    .process-steps li::before { width: 30px; height: 30px; line-height: 30px; font-size: 1em; left: 0; box-shadow: 0 0 0 2px #007bff;} /* LTR */
    .process-steps::before { left: 15px; top: 15px; bottom: 15px;} /* LTR */

    footer .container {
        text-align: center;
    }
    footer a { margin: 0 5px; }

    #hero { height: 450px; } /* Adjust banner height */
    .banner-text h1 { font-size: 1.8em; }
    .banner-text p { font-size: 1em; }
    .banner-text { max-width: 85%; padding: 20px 25px;}
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .container { padding: 0 15px; }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    .page-title h1 { font-size: 2em; }
    .page-title { padding: 40px 15px; }

    #hero { height: 400px; } /* Slightly taller for small mobile */
    .banner-text { max-width: 90%; padding: 15px 20px;}
    .banner-text h1 { font-size: 1.6em; }
    .banner-text p { font-size: 0.9em; }
    .banner-text .cta-button { padding: 8px 15px; font-size: 0.9em;}

    .cta-button { padding: 10px 20px; font-size: 0.95em; }
    .capability-section .image-content { width: 90%; }

    /* Make product image squares smaller on very small screens */
    .product-category-item img {
        width: 120px;
        height: 120px;
    }
}

/* --- Basic RTL Support --- */
html[dir="rtl"] body {
    text-align: right; /* Default text align */
}

html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 20px; /* Adjust padding side */
}
/* Specific list padding adjustment for capabilities */
html[dir="rtl"] .capability-section ul {
     padding-left: 0;
     padding-right: 20px;
}
/* Specific list padding adjustment for About page sections */
html[dir="rtl"] #story-vision ul,
html[dir="rtl"] #team ul,
html[dir="rtl"] #manufacturing-advantages ul {
      padding-left: 0;
      padding-right: 25px;
}


html[dir="rtl"] nav ul li {
    margin-left: 0;
    margin-right: 20px; /* Reverse margin */
}

html[dir="rtl"] nav a::after {
    right: auto; /* Reset LTR position */
    left: 0; /* Position underline on the left for RTL */
}
html[dir="rtl"] nav a:hover::after,
html[dir="rtl"] nav li.active a::after {
    left: auto; /* Reset LTR position */
    right: 0; /* Make underline grow from right for RTL */
}

html[dir="rtl"] .language-switcher {
    margin-left: 0; /* Reset LTR margin */
    margin-right: auto; /* Push switcher to the left in RTL */
}

html[dir="rtl"] .capability-section {
    flex-direction: row-reverse; /* Reverse flex items */
}
/* Keep image on right on smaller screens when stacked */
@media (max-width: 992px) {
    html[dir="rtl"] .capability-section {
        flex-direction: column; /* Still stack */
    }
     html[dir="rtl"] .capability-section .image-content {
         margin: 20px auto 0 auto; /* Center image */
     }
}


html[dir="rtl"] .process-steps::before {
    left: auto; /* Reset LTR */
    right: 17px; /* Position line on the right */
}

html[dir="rtl"] .process-steps li {
    padding-left: 0; /* Reset LTR */
    padding-right: 55px; /* Add padding on the right */
}

html[dir="rtl"] .process-steps li::before {
    left: auto; /* Reset LTR */
    right: 0; /* Position circle on the right */
}

@media (max-width: 768px) {
     html[dir="rtl"] header .container {
        align-items: flex-end; /* Align items to end (left in RTL) */
     }
     html[dir="rtl"] .logo { align-self: flex-end; } /* Keep logo aligned right */
     html[dir="rtl"] nav ul li {
        margin-right: 0; /* No margin needed when stacked */
        text-align: right; /* Ensure text aligns right */
     }
     html[dir="rtl"] .language-switcher {
        align-self: flex-start; /* Align left in RTL mobile stack */
     }

    html[dir="rtl"] .process-steps li { padding-right: 45px; }
    html[dir="rtl"] .process-steps li::before { right: 0; }
    html[dir="rtl"] .process-steps::before { right: 15px; }
}

/* RTL adjustments for iframe container (likely no changes needed here) */
html[dir="rtl"] .iframe-container {
    /* Add specific RTL styles here if layout issues arise */
}


/* Add more specific RTL adjustments as needed for complex layouts */
/* E.g., reverse grid orders if visual flow requires it */
/* html[dir="rtl"] .grid { direction: rtl; } */ /* Might be needed for some grids */