/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a2a4a;
    --primary-light: #2c4a7c;
    --accent: #e8a838;
    --accent-hover: #d4952e;
    --text: #333;
    --text-light: #666;
    --bg: #ffffff;
    --bg-light: #f5f7fa;
    --bg-dark: #0f1a2e;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --turris-color: #00a651;
    --netgate-color: #1a5fb4;
}

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul { list-style: none; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu > li > a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    background: var(--bg-light);
    color: var(--primary);
}

.btn-shop {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
}

.btn-shop:hover {
    background: var(--accent-hover) !important;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.arrow {
    font-size: 0.7rem;
    margin-left: 4px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.88rem;
    color: var(--text);
    transition: background 0.2s;
}

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

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    width: 26px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== HERO ===== */
.hero {
    margin-top: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 48px 20px 40px;
    text-align: center;
}

.hero-content {
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.05rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 10px;
}

.hero-text {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--primary-light);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}

.btn-secondary:hover {
    background: var(--primary);
    border-color: #fff;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.85rem;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    text-align: center;
    line-height: 1;
}

.btn-small:hover {
    background: var(--primary-light);
}

/* ===== SECTIONS ===== */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 48px;
    font-size: 1.05rem;
}

/* ===== CAROUSEL ===== */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.carousel-track-container {
    overflow: hidden;
    border-radius: var(--radius);
    flex: 1;
}

.carousel-track {
    display: flex;
    gap: 0;
    transition: transform 0.5s ease;
}

.carousel-card {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 10px 20px;
}

.carousel-card-inner {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.carousel-card-inner:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--netgate-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.card-badge.turris {
    background: var(--turris-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.carousel-img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-light);
    padding: 10px;
    margin-bottom: 10px;
    display: block;
}

.carousel-card h3 {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.carousel-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.5;
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: var(--primary);
}

/* Brand Cards */
.product-brands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.brand-link {
    display: block;
}

.brand-card {
    padding: 32px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    text-align: center;
    transition: all 0.3s;
}

.brand-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.brand-card h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.brand-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.brand-card-img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 16px;
}

/* ===== STORE LINKS ===== */
.amazon-section {
    background: var(--bg-light);
}

.store-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.store-links.store-links-3 {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 900px;
}

.store-card {
    display: block;
    padding: 32px;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.store-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.store-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
}

.store-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== PAGE HERO (subpages) ===== */
.page-hero {
    margin-top: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 36px 20px;
    text-align: center;
}

.page-hero h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.page-hero p {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CONTENT PAGES ===== */
.page-content {
    padding: 60px 0;
}

.page-content .container {
    max-width: 900px;
}

.content-block {
    margin-bottom: 40px;
}

.content-block h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.content-block h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.content-block p {
    margin-bottom: 14px;
    color: var(--text);
    line-height: 1.7;
}

.content-block ul, .content-block ol {
    margin: 12px 0 20px 24px;
    list-style: disc;
}

.content-block ol {
    list-style: decimal;
}

.content-block li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text);
}

.content-block strong {
    color: var(--primary);
}

.quote-block {
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-light);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 40px;
}

.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: all 0.3s;
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.product-card .card-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 16px;
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: var(--bg-light);
    overflow: hidden;
    cursor: pointer;
}

.product-img-wrapper .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: opacity 0.4s ease;
}

.product-img-wrapper .img-rear {
    opacity: 0;
}

.product-img-wrapper:hover .img-front {
    opacity: 0;
}

.product-img-wrapper:hover .img-rear {
    opacity: 1;
}

.product-card .product-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 16px;
    border-radius: 8px;
    background: var(--bg-light);
    padding: 12px;
}

.variant-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.variant-badge.base {
    background: #e8f4fd;
    color: #1a5fb4;
    border: 1px solid #b8daef;
}

.variant-badge.max {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.product-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.product-card p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.product-card .specs {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.product-card .specs li {
    list-style: none;
    padding: 4px 0;
    font-size: 0.88rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card .specs li::before {
    content: "\2713";
    color: var(--turris-color);
    font-weight: bold;
}

.product-cta {
    text-align: center;
    margin-top: 48px;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.product-cta h3 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.product-cta p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ===== INFO PAGE ===== */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

.info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 1.15rem;
}

.info-card p {
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: var(--text);
}

.amazon-stores-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.amazon-store-link {
    display: block;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.amazon-store-link:hover {
    background: var(--primary);
    color: #fff;
}

/* Amazon subpages nav */
.amazon-subnav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.amazon-subnav a {
    display: block;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.amazon-subnav a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-col p, .footer-col li {
    font-size: 0.88rem;
    margin-bottom: 6px;
    line-height: 1.5;
}

.footer-col a {
    color: var(--accent);
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
}

.footer-col ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ===== BACKGROUND PATTERNS ===== */

/* Hero pattern — circuit/grid dots */
.hero,
.page-hero {
    position: relative;
}

.hero::before,
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* Products section — diagonal dots */
.products-section {
    position: relative;
}

.products-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(26,42,74,0.04) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

/* Amazon/store section — diagonal lines */
.amazon-section {
    position: relative;
    overflow: hidden;
}

.amazon-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(26,42,74,0.03) 10px,
        rgba(26,42,74,0.03) 11px
    );
    pointer-events: none;
    z-index: 0;
}

/* Footer — PCB circuit board pattern */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'%3E%3Cline x1='0' y1='20' x2='40' y2='20'/%3E%3Cline x1='40' y1='20' x2='40' y2='60'/%3E%3Cline x1='40' y1='60' x2='80' y2='60'/%3E%3Cline x1='80' y1='60' x2='80' y2='100'/%3E%3Cline x1='80' y1='100' x2='120' y2='100'/%3E%3Cline x1='60' y1='0' x2='60' y2='40'/%3E%3Cline x1='60' y1='40' x2='100' y2='40'/%3E%3Cline x1='100' y1='40' x2='100' y2='0'/%3E%3Cline x1='20' y1='80' x2='20' y2='120'/%3E%3Cline x1='0' y1='80' x2='20' y2='80'/%3E%3Cline x1='100' y1='80' x2='120' y2='80'/%3E%3Cline x1='0' y1='100' x2='40' y2='100'/%3E%3Cline x1='40' y1='100' x2='40' y2='120'/%3E%3C/g%3E%3Cg fill='rgba(255,255,255,0.06)'%3E%3Ccircle cx='40' cy='20' r='2.5'/%3E%3Ccircle cx='40' cy='60' r='2.5'/%3E%3Ccircle cx='80' cy='60' r='2.5'/%3E%3Ccircle cx='80' cy='100' r='2.5'/%3E%3Ccircle cx='60' cy='40' r='2.5'/%3E%3Ccircle cx='100' cy='40' r='2.5'/%3E%3Ccircle cx='20' cy='80' r='2.5'/%3E%3Ccircle cx='100' cy='80' r='2'/%3E%3Ccircle cx='40' cy='100' r='2'/%3E%3C/g%3E%3Cg fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='0.8'%3E%3Crect x='55' y='15' width='10' height='10' rx='1'/%3E%3Crect x='15' y='55' width='10' height='10' rx='1'/%3E%3Crect x='95' y='95' width='10' height='10' rx='1'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 24px;
        gap: 4px;
        transform: translateX(-100%);
        transition: transform 0.3s;
        overflow-y: auto;
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding-left: 16px;
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .hero {
        padding: 32px 16px 28px;
    }

    .hero h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-text {
        font-size: 0.88rem;
        margin-bottom: 16px;
    }

    .hero-buttons .btn {
        padding: 10px 20px;
        font-size: 0.88rem;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .carousel-wrapper {
        gap: 0;
    }

    .carousel-btn {
        display: none;
    }

    .carousel-track-container {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .carousel-track-container::-webkit-scrollbar {
        display: none;
    }

    .carousel-track {
        transition: none;
        transform: none !important;
    }

    .carousel-card {
        min-width: 85vw;
        padding: 8px;
        scroll-snap-align: center;
    }

    .carousel-img {
        height: 120px;
    }

    .carousel-card h3 {
        font-size: 1rem;
    }

    .carousel-card p {
        font-size: 0.82rem;
    }

    .carousel-dots {
        display: none;
    }

    .product-brands,
    .store-links,
    .store-links.store-links-3 {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 24px 16px;
    }

    .page-hero h1 {
        font-size: 1.4rem;
    }

    .page-hero p {
        font-size: 0.88rem;
    }

    .page-content {
        padding: 32px 0;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card {
        padding: 20px 16px;
    }

    .product-img-wrapper {
        height: 180px;
    }

    .product-cta {
        padding: 24px 16px;
    }

    .store-card {
        padding: 20px;
    }

    .brand-card {
        padding: 24px 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer {
        padding: 40px 0 20px;
    }

    .amazon-subnav {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 20px;
    }
}
