/* ============================================================
   Ninj Frontend Styles
   海洋钓鱼主题 - 深蓝 + 金色 + 白色
   高级感、有细节感、大海钓鱼氛围
   ============================================================ */

/* Variables */
:root {
    --primary: #0c2340;
    --primary-light: #1a4a7a;
    --gold: #c9a84c;
    --gold-light: #f0d68a;
    --accent: #2196F3;
    --bg: #ffffff;
    --bg-alt: #f7f9fc;
    --text: #333333;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'Noto Sans', Arial, sans-serif;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

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

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.site-logo:hover { opacity: 0.9; }
.site-logo-img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 160px;
}
.site-logo--footer .site-logo-img {
    height: 32px;
    margin-bottom: 12px;
}
.header-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Navigation */
.main-nav { display: flex; align-items: center; gap: 0; }
.main-nav a {
    color: rgba(255,255,255,0.8);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    transition: var(--transition);
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}
.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}
.main-nav a:hover::after,
.main-nav a.active::after {
    width: 60%;
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 6px;
    margin-left: 15px;
}
.lang-switch a {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    transition: var(--transition);
}
.lang-switch a:hover,
.lang-switch a.active {
    color: var(--gold);
    border-color: var(--gold);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}
.header-mobile-actions {
    margin-left: auto;
    display: none;
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    align-items: center;
    column-gap: 4px;
    white-space: nowrap;
}
.header-mobile-actions > * {
    width: 44px;
    height: 44px;
    line-height: 1;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    vertical-align: middle;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.header-mobile-actions svg {
    width: 22px;
    height: 22px;
    display: block;
}
.home-icon-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 8px;
    margin: 0;
    flex-shrink: 0;
}
.home-icon-mobile:hover { color: #fff; background: rgba(255,255,255,.12); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    position: relative;
    background: #0c2340 url('../images/hero-bg.png') no-repeat center center;
    background-size: cover;
    color: #fff;
    padding: 100px 0 80px;
    overflow: hidden;
    text-align: center;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(12, 35, 64, 0.35) 0%, rgba(0, 0, 0, 0.3) 100%);
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}
.hero h1 span {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 18px;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.8;
}
.hero-btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}
.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(201,168,76,0.5);
    color: var(--primary);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
    padding: 80px 0;
}
.section-alt {
    background: var(--bg-alt);
}
.section-title {
    text-align: center;
    margin-bottom: 50px;
}
.section-title h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.section-title p {
    color: var(--text-light);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Page Header (inner pages) */
.page-banner {
    position: relative;
    background: #0c2340 url('../images/hero-bg.png') no-repeat center center;
    background-size: cover;
    color: #fff;
    padding: 50px 0;
    text-align: center;
    overflow: hidden;
}
.page-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(12, 35, 64, 0.35) 0%, rgba(0, 0, 0, 0.3) 100%);
}
.page-banner .container {
    position: relative;
    z-index: 1;
}
.page-banner h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}
.page-banner p {
    opacity: 0.7;
    font-size: 15px;
}

/* ============================================================
   CARDS (Products, News, Agents, Gallery)
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
.card-grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}
.front-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.front-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.card-img-wrap { margin: 0; }
.card-img-wrap .card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.img-caption {
    font-size: 12px;
    color: var(--text-muted, #999);
    padding: 6px 12px;
    text-align: center;
}
.front-card .card-img-wrap .img-caption { padding: 8px 16px; font-size: 13px; }
.front-card .card-body {
    padding: 20px;
}
.front-card .card-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
}
.front-card .card-body p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}
.front-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* Front category grid (homepage, 与代理站一致) */
.front-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.front-category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
    min-height: 80px;
}
.front-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary);
}

/* Category icon: landscape rectangle (not square / pill crop) */
.category-icon-rect {
    width: 75px;
    height: 25px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 75px;
    flex-shrink: 0;
}
.category-icon-rect--compact {
    width: 75px;
    height: 25px;
    flex: 0 0 75px;
}

/* Price Display */
.price-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.price-original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 14px;
}
.price-sale {
    color: #dc3545;
    font-size: 20px;
    font-weight: 700;
}
.price-normal {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.contact-info-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}
.contact-info-item .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.contact-info-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}
.contact-info-item p {
    color: var(--text-light);
    font-size: 14px;
}

/* Form */
.front-form .form-group {
    margin-bottom: 18px;
}
.front-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 6px;
}
.front-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    transition: var(--transition);
    background: #fff;
}
.front-form .form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.front-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}
.front-form .btn-submit {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}
.front-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201,168,76,0.4);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: rgba(12,35,64,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
}
.gallery-item:hover .overlay {
    opacity: 1;
}
.gallery-item .img-caption {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-light, #666);
    text-align: center;
}

/* ============================================================
   AGENT LIST
   ============================================================ */
.agent-card {
    text-align: center;
    padding: 30px 20px;
}
.agent-card .agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 15px;
}
.agent-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}
.agent-card p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
}
.agent-card .btn-visit {
    display: inline-block;
    padding: 8px 24px;
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.agent-card .btn-visit:hover {
    background: var(--gold);
    color: var(--primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 2px;
}
.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
}
.footer-links h4,
.footer-contact h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
}
.footer-links a {
    display: block;
    color: rgba(255,255,255,0.6);
    padding: 4px 0;
    font-size: 14px;
}
.footer-links a:hover { color: var(--gold); }
.footer-contact p {
    font-size: 14px;
    margin-bottom: 8px;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-nav { text-align: center; margin-top: 40px; }
.pagination {
    display: inline-flex;
    gap: 4px;
    list-style: none;
}
.pagination li span,
.pagination li a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}
.pagination li a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination li.active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination li.disabled span { color: #ccc; }

/* Alert */
.front-alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}
.front-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.front-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ============================================================
   NAV SEARCH
   ============================================================ */
.nav-search-form {
    display: flex;
    align-items: center;
    margin-right: 8px;
}
.nav-search-input {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px 0 0 20px;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
    width: 160px;
    outline: none;
    transition: width 0.3s, background 0.2s;
}
.nav-search-input::placeholder { color: rgba(255,255,255,0.55); }
.nav-search-input:focus {
    width: 220px;
    background: rgba(255,255,255,0.2);
}
.nav-search-btn {
    background: var(--gold, #b8860b);
    border: none;
    border-radius: 0 20px 20px 0;
    color: #fff;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.nav-search-btn:hover { background: var(--gold-light, #caa433); }

/* Search Results Page */
.front-search-form { margin-bottom: 10px; }
.front-search-row {
    display: flex;
    gap: 0;
    max-width: 600px;
}
.front-search-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.front-search-input:focus { border-color: var(--gold, #b8860b); }
.front-search-btn {
    padding: 12px 22px;
    background: var(--gold, #b8860b);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.front-search-btn:hover { background: var(--gold-light, #caa433); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    html { font-size: 18px; }
    body { font-size: 17px; line-height: 1.8; }
    .header-inner { justify-content: space-between; position: relative; }
    .header-left-group {
        flex: 1 1 auto;
        justify-content: flex-start;
        max-width: calc(50% - 30px);
        overflow: hidden;
    }
    .header-left-group .site-logo-img {
        height: 32px;
        max-width: 120px;
    }
    .home-icon-mobile {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: inline-flex !important;
        z-index: 10;
    }
    .header-mobile-actions {
        display: grid !important;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 3;
    }
    .menu-toggle { display: inline-flex !important; align-items: center; justify-content: center; margin: 0; flex-shrink: 0; }
    .main-nav { 
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 17px; }
    .lang-switch { padding: 10px 20px; margin-left: 0; }
    .nav-search-form { order: -1; padding: 10px 20px; width: 100%; box-sizing: border-box; }
    .nav-search-input { width: 100%; border-radius: 20px 0 0 20px; }
    .nav-search-input:focus { width: 100%; }

    .hero { padding: 60px 0; }
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 18px; }

    .section { padding: 50px 0; }
    .section-title h2 { font-size: 30px; }
    .section-title p { font-size: 17px; }

    .card-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .product-detail-grid { grid-template-columns: 1fr; }

    .page-banner { padding: 35px 0; }
    .page-banner h1 { font-size: 28px; }
}

/* iOS/Safari fallback: ensure mobile controls appear on touch devices */
@media (hover: none) and (pointer: coarse) {
    .home-icon-mobile { display: inline-flex !important; }
    .header-mobile-actions { display: grid !important; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .hero h1 { font-size: 26px; }
    .gallery-grid { grid-template-columns: 1fr 1fr; }
}
