:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --accent-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 4px 20px -1px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.8px;
}

.logo-img {
    height: 52px;
    width: auto;
    transition: transform 0.3s ease;
}

.footer-text-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

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

/* Removed duplicate .logo */

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

nav a:hover {
    color: var(--accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

nav a:hover {
    color: var(--accent);
}

nav a:hover::after {
    width: 100%;
}

/* Mega Menu Desktop */
.nav-links li:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 900px;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
}

.mega-column h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.mega-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.mega-links a:hover {
    background: #f1f5f9;
    padding-left: 1rem;
}

.mega-links a::after { display: none; }

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 2100;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 50px rgba(0,0,0,0.1);
}

.mobile-drawer.active {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2050;
}

.mobile-nav-list {
    list-style: none;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-list > li > a {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}

.mobile-sub-menu {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-sub-menu a {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 160px 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    color: white;
    text-align: left;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

/* Grids & Cards */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 4rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-main-image-container {
    height: 550px;
}

.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--accent);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.product-card:hover::before {
    height: 100%;
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.product-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-hero {
    padding: 100px 0;
    background: linear-gradient(180deg, #F1F5F9 0%, #FFFFFF 100%);
}

.header-group {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .header-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .category-hero {
        padding: 60px 0;
        text-align: center;
    }
    
    .category-hero h1 {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .category-hero p {
        font-size: 1.1rem !important;
        margin-left: auto;
        margin-right: auto;
    }
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: left; /* Prevent centered text from breaking UI in lists */
    }
    
    .product-detail-grid > div:nth-child(2) h1 {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .product-detail-grid > div:nth-child(2) div[contenteditable] {
        font-size: 1rem !important;
    }

    .product-main-image-container {
        height: 350px;
    }
}

@media (max-width: 640px) {
    .product-main-image-container {
        height: 280px;
    }
}

.case-study-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .case-study-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .case-study-grid > div {
        padding: 0 !important;
    }
    .case-study-grid > div:nth-child(even) {
        order: -1;
    }
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: start;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .spec-key {
        width: 140px !important;
        padding: 1rem !important;
        font-size: 0.85rem !important;
    }
    .spec-val {
        padding: 1rem !important;
        font-size: 0.85rem !important;
    }
    .list-grid {
        grid-template-columns: 1fr;
    }
}

.list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    list-style: none;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.4);
}

/* Editor & Auth Buttons */
.btn-editor {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-editor:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-save {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

.btn-save:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

.btn-cancel {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fecaca !important;
}

.btn-cancel:hover {
    background: #fecaca !important;
}

.btn-auth {
    width: 100%;
    padding: 1.25rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.2);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.3);
}

/* Form Styles */
.contact-form {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Auth Styling */
.auth-wrapper {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
}

.auth-card {
    background: white;
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .hero { padding: 120px 0; }
    .hero h1 { font-size: 3.5rem; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2.75rem; text-align: center; }
    .hero p { text-align: center; margin-left: auto; margin-right: auto; }
    
    .mobile-toggle { display: block; }
    
    .grid { grid-template-columns: 1fr; gap: 1.5rem; }
    
    .section-title { margin-bottom: 2.5rem; }
    
    .product-card { padding: 2rem; }
    
    footer .container > div { grid-template-columns: 1fr !important; gap: 3rem !important; }
}

/* Modern Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Editor Visual Indicators */
.edit-mode-active [contenteditable="true"] {
    outline: 2px dashed rgba(37, 99, 235, 0.3) !important;
    outline-offset: 4px;
    background: rgba(37, 99, 235, 0.02);
    min-height: 1.2em;
    cursor: text;
    border-radius: 8px;
    transition: var(--transition);
}
.edit-mode-active [contenteditable="true"]:hover {
    background: rgba(37, 99, 235, 0.05);
    outline-color: var(--accent) !important;
}

[x-cloak] { display: none !important; }

/* Modal Styling Redesign */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 40px;
    width: 100%;
    max-width: 1000px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.2);
    display: flex;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 4rem;
    scrollbar-width: thin;
}

.modal-info-pane {
    flex: 0 0 350px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 900px) {
    .modal-content { flex-direction: column; max-height: 90vh; }
    .modal-info-pane { display: none; }
    .modal-body { padding: 2.5rem; }
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: white;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.modal-close:hover {
    background: #f1f5f9;
    transform: rotate(90deg);
    color: var(--accent);
}

/* Editor Toolbar */
.editor-toolbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    z-index: 3000;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 2rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.thumb-item {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.thumb-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.thumb-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
