/**
 * Baike Biotech (Shanghai) Company Limited
 * English Website Styles
 * Theme: Dark Navigation with Purple Gradient (#667eea → #764ba2)
 */

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

:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --card-bg: #ffffff;
    --text-dark: #2d3748;
    --text-light: #f7fafc;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-hover: 0 20px 40px rgba(102, 126, 234, 0.3);
    --transition: all 0.3s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-color: #f8f9fa;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-wrap: break-word;
    word-break: break-word;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* ==================== Navigation ==================== */
.navbar {
    background: var(--primary-gradient);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    height: 100px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.navbar-brand img {
    height: 160px;
    width: auto;
    vertical-align: middle;
}

.navbar-brand span {
    font-size: 16px;
    line-height: 1.2;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-light);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-dropdown { position: relative; }
.nav-dropdown > .nav-link { cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 126px;
    z-index: 9999;
    overflow: hidden;
    padding: 6px 0;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 10px 18px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.dropdown-item:hover { background: #f0f4ff; color: #667eea; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-light);
    border-radius: 2px;
    transition: var(--transition);
}

/* ==================== Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.2rem;
    width: 100%;
}

/* ==================== Hero Section ==================== */
.hero {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='even'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--text-light);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--text-light);
    color: var(--primary-end);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

.btn-outline:hover {
    background: var(--text-light);
    color: var(--primary-end);
}

.btn-secondary {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ==================== Sections ==================== */
.section {
    padding: 4rem 0;
}

.section-dark {
    background: var(--dark-bg);
    color: var(--text-light);
}

.section-dark h2,
.section-dark h3 {
    color: var(--text-light);
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-header p {
    color: rgba(255,255,255,0.7);
}

/* ==================== Products Grid ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

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

.product-image {
    height: 180px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    padding: 1rem;
}

.product-image .placeholder {
    color: var(--text-muted);
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-info h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-cas {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.product-formula {
    font-size: 0.875rem;
    color: var(--primary-end);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.product-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-end);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== Search Bar ==================== */
.search-section {
    background: var(--darker-bg);
    padding: 2.5rem 0;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.25rem;
    padding-left: 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.search-input:focus {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.search-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    background: var(--primary-gradient);
    color: var(--text-light);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* ==================== Category Filter ==================== */
.filter-section {
    padding: 1.2rem 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.filter-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-color: transparent;
}

/* ==================== Product Detail ==================== */
.product-detail-container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.product-detail-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.product-detail-header {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 2rem;
}

.product-detail-header h1 {
    color: var(--text-light);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.product-detail-header .en-name {
    opacity: 0.9;
    font-size: 1.125rem;
}

.product-detail-body {
    padding: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.product-structure {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.product-structure img {
    max-width: 300px;
    margin: 0 auto;
}

/* ==================== About Page ==================== */
.about-hero {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 4rem 0;
    text-align: center;
    margin-top: 70px;
}

.about-content {
    padding: 4rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.about-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.about-card .icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.about-card h3 {
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--text-muted);
}

.features-list {
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.feature-item .icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.feature-item p {
    color: var(--text-muted);
    margin: 0;
}

/* ==================== Contact Page ==================== */
.contact-section {
    padding: 4rem 0;
}

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

.contact-info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.contact-info-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info-card h3 .icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item .label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 70px;
}

.contact-item .value {
    color: var(--text-muted);
}

.contact-form-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==================== Loading States ==================== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-start);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.75rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-color: transparent;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
}

/* ==================== Footer ==================== */
.footer {
    background: var(--darker-bg);
    color: var(--text-light);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-col p,
.footer-col a {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    line-height: 1.8;
}

.footer-col a:hover {
    color: var(--text-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

/* ==================== Breadcrumb ==================== */
.breadcrumb {
    padding: 1rem 0;
    background: #f8f9fa;
    margin-bottom: 0;
    margin-top: 70px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary-end);
}

.breadcrumb span {
    color: var(--text-muted);
}

/* ==================== Responsive ==================== */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary-gradient);
        flex-direction: column;
        padding: 0.5rem 0;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu .nav-link {
        display: block;
        padding: 1rem 1.2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px,5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px,-5px);
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .navbar {
        height: 56px;
        padding: 0 1rem;
    }

    .navbar .container {
        justify-content: center;
    }

    .navbar-brand {
        margin: 0 auto;
    }

    .navbar-brand img {
        height: 180px;
    }

    .navbar-brand span {
        display: none;
    }


    .nav-menu {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--primary-gradient);
        flex-direction: column;
        padding: 0.5rem 0;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 999;
    }


    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 1000;
    }


    .nav-menu .nav-link {
        display: block;
        padding: 1rem 1.2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.85);
        font-size: 1rem;
    }

    .nav-toggle {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        padding: 0.8rem 1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 0.5rem;
    }

    .filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 0.6rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
}

/* ==================== Utilities ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.visible { display: block !important; }
