/* ========================================
   Eaglewood Japan - Corporate Website Styles
   Industrial/Energy Style with Modern Design
   ======================================== */

/* ---- CSS Variables ---- */
:root {
    --primary-dark: #1a4480;
    --primary-light: #00b4d8;
    --primary-gradient: linear-gradient(135deg, #1a4480 0%, #00b4d8 100%);
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --bg-dark: #1a202c;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* ---- Utility Classes ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary-dark); }
.text-accent { color: var(--primary-light); }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); color: #fff; }

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 20px auto 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-dark);
    color: var(--primary-dark);
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-white {
    background: #fff;
    color: var(--primary-dark);
}

.btn-white:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

/* ---- Header & Navigation ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    min-width: 0;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}


.logo-company {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    padding: 5px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch {
    display: flex;
    gap: 5px;
    padding: 5px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.lang-switch a {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.lang-switch a.active {
    background: var(--primary-dark);
    color: #fff;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-light);
    width: 250px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.search-box button:hover {
    color: var(--primary-dark);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---- Hero Section ---- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(26, 68, 128, 0.85) 0%, rgba(0, 180, 216, 0.75) 100%),
                url('../images/home02.jpg') center/cover no-repeat;
    color: #fff;
    text-align: center;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.hero-scroll a {
    color: #fff;
    font-size: 2rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---- About Preview Section ---- */
.about-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.about-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0.3;
}

.about-content h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.stat-item .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-item .label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ---- Products Section ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-card.featured {
    border: 2px solid var(--primary-light);
    position: relative;
}

.product-card.featured::before {
    content: 'FEATURED';
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--primary-light);
    color: #fff;
    padding: 5px 40px;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(45deg);
    z-index: 1;
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f5f7fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: var(--transition);
    cursor: zoom-in;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-content {
    padding: 25px;
}

.product-content h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.product-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.product-tags span {
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--primary-dark);
}

.product-link:hover {
    gap: 10px;
}

/* ---- Features Section ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 40px 25px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.feature-item h4 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ---- News Section ---- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.news-card:hover {
    box-shadow: var(--shadow-md);
}

.news-image {
    height: 180px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
}

.news-date {
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.news-content h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.news-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ---- CTA Section ---- */
.cta-section {
    background: var(--primary-gradient);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
}

.cta-section h2 {
    color: #fff;
    margin-bottom: 15px;
}

.cta-section p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* ---- Footer ---- */
.footer {
    background: var(--bg-dark);
    color: #fff;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 2.3fr 1.4fr;
    gap: 36px;
    margin-bottom: 0;
    align-items: start;
}

.footer-brand {
    grid-column: 1 / -1;
    order: 1;
    margin: 0;
    padding: 0;
}

.footer-brand img {
    display: none;
}

.footer-brand p {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
}

.footer h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links h4 a {
    color: inherit;
    display: inline;
    padding: 0;
}

.footer-links a {
    display: block;
    color: rgba(255,255,255,0.7);
    padding-bottom: 8px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-contact p {
    color: rgba(255,255,255,0.7);
    margin: 0 0 10px 0;
    font-size: 0.95rem;
}

.footer-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 8px 22px;
}

.footer-products-grid a {
    white-space: nowrap;
    padding-bottom: 0;
}

.footer-contact-btn {
    margin-top: 15px;
    padding: 8px 20px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-contact-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.footer-legal a {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin-left: 20px;
}

.footer-legal a:hover {
    color: var(--primary-light);
}

/* ---- Page Header ---- */
.page-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 140px 0 60px;
    text-align: center;
}

.page-header h1 {
    color: #fff;
    margin-bottom: 10px;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
}

.breadcrumb a {
    color: rgba(255,255,255,0.8);
}

.breadcrumb a:hover {
    color: #fff;
}

/* ---- Contact Form ---- */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group label .required {
    color: #e53e3e;
    margin-left: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
}

.form-row .form-group label {
    min-height: 2.8em;
    display: flex;
    align-items: flex-end;
}

/* ---- Product Detail Page ---- */
.product-detail-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 60px;
}

.product-gallery img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.product-info h1 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.product-info .lead {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 25px;
}

.product-features {
    margin: 30px 0;
}

.product-features li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-weight: bold;
}

/* Product Tabs */
.product-tabs {
    margin-top: 40px;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-nav button {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-nav button:hover {
    color: var(--primary-dark);
}

.tab-nav button.active {
    color: var(--primary-dark);
}

.tab-nav button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Product Table */
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.product-table th,
.product-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.product-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-dark);
}

.product-table tr:hover {
    background: var(--bg-light);
}

/* PDF Download List */
.pdf-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.pdf-item:hover {
    background: var(--border-color);
}

.pdf-icon {
    width: 40px;
    height: 40px;
    background: #e53e3e;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.75rem;
}

.pdf-item span {
    flex: 1;
    font-weight: 500;
}

/* ---- Search Results ---- */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-item h5 {
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.search-result-item p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

.search-highlight {
    background: rgba(0, 180, 216, 0.2);
    padding: 0 2px;
}

/* ---- Map Section ---- */
.map-container {
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- About Page ---- */
.about-section {
    margin-bottom: 60px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-grid.reverse {
    direction: rtl;
}

.about-grid.reverse > * {
    direction: ltr;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-gradient);
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--primary-light);
    border-radius: 50%;
}

.timeline-item .year {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

/* ---- Responsive Design ---- */
@media (max-width: 1024px) {
    .logo-company {
        font-size: 1.1rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-products-grid {
        grid-template-columns: 1fr;
    }

    .footer-products-grid a {
        white-space: normal;
    }

    .about-preview,
    .product-detail-header,
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .hero {
        min-height: 80vh;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .materials-card-grid,
    .material-gallery,
    .material-video-grid,
    .material-child-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 25px;
    }

    .search-box input {
        width: 150px;
    }

    .search-box input:focus {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 10px 15px;
    }

    .logo img {
        height: 36px;
        width: auto;
    }


    .logo-company {
        display: none;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .nav-actions {
        flex-direction: column;
    }
}

/* ---- Animation Classes ---- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Loading State ---- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Alert Messages ---- */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
}

/* ---- Back to Top Button ---- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ---- Product Detail Page Styles ---- */
.product-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.product-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.product-hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    height: auto;
}

.product-hero-content {
    padding: 20px 0;
}

.product-hero-content .product-tags {
    margin-bottom: 20px;
}

.product-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.product-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.product-section:last-child {
    border-bottom: none;
}

.section-heading {
    color: var(--primary-dark);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-light);
    display: inline-block;
}

.product-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-content-grid.full-width {
    grid-template-columns: 1fr;
}

.product-text {
    line-height: 1.8;
}

.product-text h4 {
    color: var(--primary-dark);
    margin: 25px 0 15px;
    font-size: 1.1rem;
}

.product-text p {
    color: var(--text-dark);
    margin-bottom: 15px;
}

.product-image-side img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    height: auto;
}

/* Download List */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.download-list.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.download-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.download-item:hover {
    background: var(--bg-white);
    border-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateX(5px);
}

.download-item svg {
    flex-shrink: 0;
    color: var(--primary-dark);
}

/* Feature List */
.feature-list {
    list-style: none;
    margin: 15px 0;
    padding: 0;
}

.feature-list li {
    position: relative;
    padding: 10px 0 10px 30px;
    border-bottom: 1px solid var(--border-color);
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 50%;
}

.feature-list li::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translateY(-55%) rotate(45deg);
}

/* Featured Page Header */
.page-header.featured-header {
    background: linear-gradient(135deg, rgba(26, 68, 128, 0.95) 0%, rgba(0, 180, 216, 0.9) 100%);
}

.featured-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Highlight Text */
.highlight-text {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-light);
    margin: 20px 0;
}

.highlight-text a {
    font-weight: 600;
}

.product-material-note {
    color: var(--text-light);
    margin-bottom: 24px;
}

.materials-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.material-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.material-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-light);
}

.material-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    cursor: zoom-in;
}

.material-card-body {
    padding: 20px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

.tag-industrial {
    background: #e8f4fd;
    color: #1565c0;
}

.tag-grid {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-container {
    background: #fff3e0;
    color: #e65100;
}

.tag-category {
    background: #f3e5f5;
    color: #7b1fa2;
}

.material-card-body h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-size: 1.15rem;
}

.material-card-body p {
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.75;
}

.material-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-dark);
    font-weight: 600;
}

.material-link:hover {
    color: var(--primary-light);
}

.material-detail {
    max-width: 1080px;
    margin: 0 auto;
}

.material-section {
    margin-bottom: 48px;
}

.material-text-block + .material-text-block {
    margin-top: 24px;
}

.material-text-block h2 {
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.material-text-block p {
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.85;
}

.material-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.material-gallery-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
}

.material-gallery-item img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    padding: 8px;
    background: #f5f7fa;
    cursor: zoom-in;
}

.material-gallery-item figcaption {
    padding: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.material-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.material-video-item video {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.material-video-item p {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.material-child-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.material-child-link {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    padding: 16px;
}

.material-child-link h3 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.material-child-link p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.92rem;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.gallery-item {
    text-align: center;
}

.gallery-item h4 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.gallery-item img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    height: auto;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.product-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.product-table thead th {
    background: var(--primary-dark);
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.product-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.product-table tbody tr:hover {
    background: var(--bg-light);
}

/* ---- Material Detail Page Styles (3-level product pages) ---- */
.material-section-heading {
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-light);
    display: inline-block;
    font-size: 1.35rem;
}

.material-story-block {
    display: grid;
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
}

.material-story-block.with-visuals {
    grid-template-columns: 1.15fr 0.85fr;
}

.material-story-block.with-visuals.with-table {
    grid-template-columns: 1fr;
}

.material-story-text {
    line-height: 1.85;
    color: var(--text-dark);
}

.material-story-text p {
    margin-bottom: 14px;
}

.material-story-text-rich {
    line-height: 1.85;
    color: var(--text-dark);
}

.material-rich-content h4 {
    color: var(--primary-dark);
    margin: 24px 0 12px;
    font-size: 1.1rem;
}

.material-rich-content p {
    margin-bottom: 14px;
    line-height: 1.85;
}

.material-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.material-rich-content table th,
.material-rich-content table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.material-rich-content table th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
}

.material-rich-content table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.material-rich-content table tbody tr:hover {
    background: rgba(0, 180, 216, 0.06);
}

/* Material Rich Table */
.material-rich-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.material-rich-table th,
.material-rich-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.material-rich-table th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
}

.material-rich-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.material-rich-table tbody tr:hover {
    background: rgba(0, 180, 216, 0.06);
}

/* Material Table Context Callout */
.material-table-context {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-light);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Material Story Visuals */
.material-story-visuals {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.material-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.material-visual-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.material-visual-card img {
    width: 100%;
    height: auto;
    display: block;
}

.material-visual-card figcaption {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
}

.material-visual-trigger {
    cursor: zoom-in;
    border: none;
    background: none;
    padding: 0;
    display: block;
    width: 100%;
}

.material-visual-trigger img {
    transition: var(--transition);
}

.material-visual-trigger:hover img {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Material Nested Group */
.material-nested-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.material-nested-group h3 {
    color: var(--primary-dark);
    margin-bottom: 16px;
    font-size: 1.15rem;
}

/* Material Download List */
.material-download-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.material-download-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.material-download-item:hover {
    background: var(--bg-white);
    border-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateX(5px);
}

.material-download-item svg {
    flex-shrink: 0;
    color: var(--primary-dark);
}

/* ---- Lightbox Styles ---- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-dialog {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.lightbox-caption {
    color: #fff;
    margin-top: 16px;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0.9;
}

.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    background: var(--bg-light);
    transform: scale(1.1);
}

body.lightbox-open {
    overflow: hidden;
}

.zoomable-image {
    cursor: zoom-in;
}

.lightbox-auto-target {
    cursor: zoom-in;
}

/* Responsive Styles for Product Detail */
@media (max-width: 768px) {
    .product-hero {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .product-content-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .download-list.two-columns {
        grid-template-columns: 1fr;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-section {
        margin-bottom: 40px;
        padding-bottom: 30px;
    }

    /* Material detail responsive */
    .material-story-block.with-visuals {
        grid-template-columns: 1fr;
    }

    .material-visual-grid {
        grid-template-columns: 1fr;
    }

    .materials-card-grid {
        grid-template-columns: 1fr;
    }

    /* Lightbox responsive */
    .lightbox-dialog {
        max-width: 95vw;
    }

    .lightbox-image {
        max-height: 70vh;
        border-radius: var(--radius-sm);
    }

    .lightbox-close {
        top: -12px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
