/* ===== CSS Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s;
}

body.dark-mode a {
    color: #60a5fa;
}

a:hover {
    color: #1d4ed8;
}

body.dark-mode a:hover {
    color: #93c5fd;
}

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

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s, box-shadow 0.3s;
}

body.dark-mode header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo svg {
    width: 40px;
    height: 40px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav ul li a {
    color: #fff;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s, color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    border-bottom-color: #facc15;
    color: #facc15;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: 0.3s;
}

.dark-toggle {
    background: none;
    border: 2px solid #fff;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}

.dark-toggle:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        background: #1e3a5f;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    body.dark-mode nav ul {
        background: #0f172a;
    }
    nav ul.open {
        display: flex;
    }
    .menu-toggle {
        display: flex;
    }
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #0b2b44 0%, #1a4b6b 50%, #2d6a9f 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e3a5f 100%);
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero .btn-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero .btn {
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s;
    display: inline-block;
}

.hero .btn-primary {
    background: #facc15;
    color: #1e293b;
}

.hero .btn-primary:hover {
    background: #eab308;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(250,204,21,0.3);
}

.hero .btn-secondary {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

.hero .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

.hero .carousel {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.hero .carousel-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 280px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: 0.3s;
}

.hero .carousel-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15);
}

.hero .carousel-item svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.hero .carousel-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.hero .carousel-item p {
    font-size: 14px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .hero .carousel-item { width: 100%; max-width: 300px; }
}

/* ===== Sections ===== */
section {
    padding: 70px 0;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e3a5f;
}

body.dark-mode .section-title {
    color: #93c5fd;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: #64748b;
    margin-bottom: 50px;
}

body.dark-mode .section-subtitle {
    color: #94a3b8;
}

.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}

body.dark-mode .card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

body.dark-mode .card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.card svg {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1e3a5f;
}

body.dark-mode .card h3 {
    color: #93c5fd;
}

.card p {
    color: #475569;
}

body.dark-mode .card p {
    color: #cbd5e1;
}

/* ===== FAQ ===== */
.faq-item {
    background: #fff;
    border-radius: 15px;
    margin-bottom: 15px;
    padding: 20px 25px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
}

body.dark-mode .faq-item {
    background: #1e293b;
}

.faq-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.faq-question {
    font-weight: 600;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    transition: 0.3s;
}

.faq-item.open .faq-question::after {
    content: '−';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    color: #475569;
}

body.dark-mode .faq-answer {
    color: #cbd5e1;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-top: 15px;
}

/* ===== Footer ===== */
footer {
    background: #1e3a5f;
    color: #e2e8f0;
    padding: 50px 0 20px;
}

body.dark-mode footer {
    background: #0f172a;
}

footer .grid-4 {
    gap: 30px;
}

footer h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #facc15;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 8px;
}

footer ul li a {
    color: #cbd5e1;
    transition: 0.3s;
}

footer ul li a:hover {
    color: #facc15;
}

footer .copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    font-size: 14px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Back to top ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e3a5f;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
}

.back-to-top:hover {
    transform: scale(1.1);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: #f1f5f9;
    padding: 12px 0;
    font-size: 14px;
}

body.dark-mode .breadcrumb {
    background: #1e293b;
}

.breadcrumb a {
    color: #2563eb;
}

.breadcrumb span {
    color: #64748b;
}

/* ===== Number animation ===== */
.number {
    font-size: 36px;
    font-weight: 800;
    color: #facc15;
}

/* ===== Search ===== */
.search-box {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 30px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

body.dark-mode .search-box input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.search-box input:focus {
    border-color: #2563eb;
}

.search-box button {
    padding: 12px 25px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.search-box button:hover {
    background: #1d4ed8;
}

/* ===== Additional styles for consistency ===== */
#products {
    background: #f1f5f9;
}

body.dark-mode #products {
    background: #0f172a;
}

#cases {
    background: #f1f5f9;
}

body.dark-mode #cases {
    background: #0f172a;
}

#faq {
    background: #f1f5f9;
}

body.dark-mode #faq {
    background: #0f172a;
}

#contact {
    background: #f1f5f9;
}

body.dark-mode #contact {
    background: #0f172a;
}

/* ===== Responsive fine-tune ===== */
@media (max-width: 480px) {
    .hero h1 { font-size: 26px; }
    .section-title { font-size: 28px; }
    .card { padding: 20px; }
    .faq-item { padding: 15px 20px; }
    .back-to-top { width: 40px; height: 40px; font-size: 20px; bottom: 20px; right: 20px; }
}