/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --primary-color: #c0242d;
    --primary-light-color: #f8d7da; /* Lighter tint of the primary red */
    --dark-color: #333;
    --light-color: #f4f4f4;
    --white-color: #fff;
    --text-color: #555;
    --section-padding: 60px 0;
}
/* --- Global Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Base font size for desktop */
    font-size: 14px;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--dark-color);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.8rem; }
h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3.5rem; /* Increased margin for more space */
    position: relative;
    padding-bottom: 1rem; /* Space for the line */
}

.home-page h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

h3 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; color: var(--primary-color); margin-top: 1rem; }
p { margin-bottom: 1rem; }
a { text-decoration: none; color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; } /* Added display: block */
section { padding: var(--section-padding); }

/* Adds space above anchor-linked sections to account for the sticky navbar */
section[id], footer[id] {
    scroll-margin-top: 100px;
}

/* Accessibility helper class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.visually-hidden {
    position: absolute;
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* --- Navbar --- */
.navbar {
    background: var(--white-color);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    line-height: 1; 
}

.logo img {
    height: 55px; 
    width: auto; 
    vertical-align: middle; 
}

.navbar nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* Vertically align items */
}

.navbar nav ul li {
    margin-left: 20px;
    position: relative; /* Needed for dropdown positioning */
}

.navbar nav ul li a {
    color: var(--dark-color);
    font-weight: 600;
    transition: color 0.3s;
    padding: 5px 0;
}

.navbar nav ul li a:hover {
    color: var(--primary-color);
}

/* --- REFINED DROPDOWN MENU STYLES --- */
.dropbtn {
    cursor: pointer;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 260px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 5px 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
    z-index: 1001;
    list-style: none;
    padding: 0;
    border: 1px solid #ddd;
    border-top: none;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(8px);
}

.dropdown-content a {
    display: block;
    padding: 12px 20px !important;
    color: var(--dark-color);
    font-weight: 400;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none; /* Hidden by default */
    position: relative;
    z-index: 9999;
    background: transparent;
    border: 0;
    width: 1.0rem;
    aspect-ratio: 1;
    cursor: pointer;
}

.mobile-nav-toggle::before,
.mobile-nav-toggle::after,
.mobile-nav-toggle span {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, opacity 0.2s linear;
}

.mobile-nav-toggle::before { top: 20%; }
.mobile-nav-toggle span { top: 50%; transform: translateY(-50%); }
.mobile-nav-toggle::after { bottom: 20%; }

.mobile-nav-toggle[aria-expanded="true"]::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] span {
    opacity: 0;
}
.mobile-nav-toggle[aria-expanded="true"]::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}


/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('img/main_banner.avif') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 120px 0;
}

.hero h1 {
    color: var(--white-color);
}

.hero .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn:hover {
    background: #a01c24;
}

/* --- About Section --- */
.about-section { background: var(--light-color); } 
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem; 
    align-items: center;
}
.about-image img {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* --- Culture Section --- */
.culture-section { background: var(--white-color); } 
.culture-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.card {
    background: transparent; 
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e7e7e7;
    transition: background 0.3s;
}
.card:hover {
    background: #fdfdfd;
}

.card-icon {
    height: 80px;
    width: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* --- Products Section --- */
.products-section { background: var(--white-color); }
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.product-card {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 12px; 
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e7e7e7;
    display: flex; 
    flex-direction: column; 
}

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

.product-card p {
    flex-grow: 1; 
}

.btn-secondary {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-secondary:hover {
    color: #a01c24; 
}

/* --- Footer --- */
.footer {
    background: linear-gradient(135deg, #333333, #2c2c2c); 
    color: #ccc;
    padding: 40px 0 20px 0;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-about, .footer-contact {
    flex: 1;
    min-width: 250px;
}
.logo-footer {
    margin-bottom: 1rem;
    display: inline-block;
}

.logo-footer img {
    height: 60px; 
    width: auto;
    vertical-align: middle;
}
.footer p { margin-bottom: 0.5rem; }
.footer h3 { color: var(--white-color); }
.footer-bottom {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 1rem;
    font-size: 0.9rem;
}

/* --- PALMFAITH PAGE STYLES --- */
.product-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('img/palmfaith-sentinel-02.png') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 120px 0;
}
.product-hero h1, .product-hero .tagline {
    color: var(--white-color);
}
.footnote { 
    font-size: 0.9em; 
    color: #777; 
    margin-top: 1.5rem; 
    text-align: left; 
    margin-left: 40px;
}
.features-section { background: var(--white-color); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 1.5rem;
    margin-left: 40px;
}
.comparison-section { background: var(--white-color); }
.table-container { 
    overflow-x: auto; 
    margin-left: 40px; 
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th, td {
    padding: 14px 15px;
    border-bottom: 1px solid #ddd;
}
thead th {
    background-color: #fcebeb;
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f0d8d8;
}

.comparison-section th,
.comparison-section td {
    font-size: 1.1rem;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
tbody tr.highlight {
    background-color: #fef4f4; 
    font-weight: 600;
}
tbody tr.highlight td:first-child {
    color: var(--primary-color);
}
tbody td:first-child {
    font-weight: 600;
    color: var(--dark-color);
}
.application-section { background: var(--light-color); }
.app-scenarios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-left: 40px;
}
.scenario-card {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
}
.scenario-card ul {
    list-style: none; 
    padding-left: 0;  
}
.scenario-card ul li {
    position: relative;
    padding-left: 1.6em; 
    margin-bottom: 0.5rem; 
}
.scenario-card ul li::before {
    content: '✓'; 
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}
.tab-container {
    padding-top: 40px;
    padding-bottom: 40px;
}
.tab-nav {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 2rem;
    flex-wrap: wrap; 
}
.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    position: relative;
    top: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease-in-out;
}
.tab-btn:hover {
    color: #e57373;
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}
.tab-content.active {
    display: block;
}
.tab-content section {
    padding: 0; 
    background: none; 
}

/* FIX 1: This is now the SINGLE, UNIFIED rule for ALL tab content headings on desktop */
.tab-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-left: 0; /* No longer needed for centered text */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
#product-showcase {
    padding: 2rem 0;
}
.showcase-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
    align-items: center;
}
.showcase-image {
    text-align: center;
}
.showcase-image img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.15));
}
/* REMOVED the conflicting .showcase-details h2 rule here */
.product-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #333;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}
.detail-block,
.feature-item {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

.detail-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.detail-block h4,
.feature-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.detail-block p,
.feature-item p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.feature-item h4 {
    margin-bottom: 0.5rem;
}

#lang-selector-li {
    margin-left: 40px; 
    display: flex; 
    align-items: center; 
}

/* --- Language Selector --- */
#lang-selector {
    display: none;
}
.custom-select-wrapper {
    position: relative;
}
.custom-select-trigger {
    padding: 5px 12px;
    border-radius: 5px;
    border: 2px solid var(--primary-light-color);
    background-color: var(--white-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-select-trigger::after {
    content: '▾';
    display: inline-block;
}
.custom-select-trigger:hover {
    background-color: var(--primary-light-color);
    border-color: var(--primary-color);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--white-color);
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}
.custom-select-wrapper.is-open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-select-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}
.custom-select-option:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}


/* --- Responsive Design --- */

/* Tablet Styles */
@media (max-width: 992px) {
    .culture-grid, .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .about-image { margin-top: 2rem; }
    
    .features-grid, .app-scenarios-grid {
        grid-template-columns: 1fr;
        margin-left: 0; /* Remove indentation on smaller screens */
    }
    .footnote, .table-container {
        margin-left: 0; /* Remove indentation on smaller screens */
    }
}

/* Mobile Styles */
@media (max-width: 768px) {

    html {
        font-size: 16px;
    }

    section { padding: 40px 0; }
    
    h1 { font-size: 2rem; } 
    h2 { font-size: 1.6rem; margin-bottom: 2rem; } 
    h3 { font-size: 1.3rem; }
    
    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
    }
    .primary-navigation {
        position: fixed;
        inset: 0 0 0 50%; 
        flex-direction: column;
        padding: 8rem 2em;
        background: hsl(0 0% 100% / 0.9);
        backdrop-filter: blur(1rem);
        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }
    .primary-navigation[data-visible="true"] {
        transform: translateX(0%);
    }
    .primary-navigation ul {
        flex-direction: column;
        align-items: center;
        text-align: center; 
        gap: 2rem;
    }
    .primary-navigation ul li {
        margin-left: 0;
    }
    .primary-navigation ul li a {
        font-size: 1.0rem; 
        padding: 8px 16px; 
        border-radius: 5px;
        transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    }
    .primary-navigation ul li a:active {
        color: var(--primary-color);
        background-color: var(--primary-light-color);
    }
    #lang-selector-li { margin-left: 0; }
    
    /* Mobile Dropdown Styles */
    .dropdown .dropdown-content {
        position: static; 
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        opacity: 1; 
        visibility: visible; 
        transform: none; 
        transition: max-height 0.3s ease-in-out;
    }
    .dropdown.is-open .dropdown-content {
        max-height: 200px;
        padding-top: 1rem;
    }
    .dropdown .dropdown-content a {
        padding: 8px 16px !important;
        font-size: 1rem; 
        font-weight: 400;
        border-radius: 5px;
        transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    }
    .dropdown .dropdown-content a:active {
        color: var(--primary-color);
        background-color: var(--primary-light-color);
    }

    /* Hero */
    .hero { padding: 80px 0; }
    .hero .tagline { font-size: 1.1rem; }
    .btn { font-size: 1rem; padding: 10px 24px; }

    /* Grids */
    .culture-grid, .product-grid, .showcase-grid, .detail-grid {
        grid-template-columns: 1fr;
    }
    .showcase-image { margin-bottom: 2rem; }
    /* REMOVED the conflicting .showcase-details h2 rule here */
    .product-description {
        font-size: 0.9rem;
    }

    /* Tabs */
    .tab-nav {
        border-bottom: none;
        gap: 0.5rem;
    }
    .tab-btn {
        flex-grow: 1;
        border: 1px solid #ddd;
        border-radius: 5px;
        top: 0;
        font-size: 0.95rem;
    }
    .tab-btn.active {
        background-color: var(--primary-light-color);
        border-color: var(--primary-color);
    }
    /* FIX 2: This is now the SINGLE, UNIFIED rule for ALL tab content headings on mobile */
    .tab-content h2 {
        padding-left: 0;
        text-align: center;
        font-size: 1.1rem;
        font-weight: 700; /* Bolder for mobile titles */
    }
    
    /* Adjust font sizes within all tabs for mobile */
    .tab-content .comparison-section th,
    .tab-content .comparison-section td {
        font-size: 0.9rem;
    }
    .tab-content .detail-block h4,
    .tab-content .feature-item h4,
    .tab-content .scenario-card h4 {
        font-size: 0.95rem;
        font-weight: 600;
    }
    .tab-content .detail-block p,
    .tab-content .feature-item p,
    .tab-content .scenario-card p,
    .tab-content .scenario-card ul li {
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-content { text-align: center; }
    .footer-about, .footer-contact {
        flex-basis: 100%;
    }
}