/* shared.css - Global styles for AwesomeCo website */

/* Universal Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body and Typography */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 0.5em;
    color: #212529;
}

p {
    margin-bottom: 1em;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Container for Centering Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.logo img {
    margin-right: 10px;
    height: 40px; /* Adjusted from width for better control */
    width: auto;
}

.logo-text {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
}

.main-nav .nav-list {
    display: flex;
    gap: 25px;
}

.nav-link {
    font-weight: 500;
    color: #555;
    padding: 10px 0;
    position: relative;
}

.nav-link:hover {
    color: #007bff;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

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

/* Dropdown Menu */
.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    border-radius: 4px;
    padding: 10px 0;
}

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

.dropdown-menu li a {
    display: block;
    padding: 8px 15px;
    color: #555;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f2f2f2;
    color: #007bff;
    text-decoration: none;
}

/* Header Actions (Search, Login, Signup) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
}

.search-form input[type="search"] {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 180px;
    font-size: 0.9em;
}

.search-form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: #fff;
    text-decoration: none;
}

.btn-subscribe {
    background-color: #28a745;
    color: #fff;
    border-radius: 0 4px 4px 0;
    padding: 10px 15px;
    border: none;
}

.btn-subscribe:hover {
    background-color: #218838;
}

/* Footer Styles */
.main-footer {
    background-color: #212529;
    color: #f8f9fa;
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section {
    flex: 1;
    min-width: 220px;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-section p, .footer-section address {
    color: #ced4da;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: #ced4da;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #007bff;
    text-decoration: underline;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.social-icons a {
    color: #fff;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

.newsletter-signup form {
    display: flex;
    margin-top: 10px;
}

.newsletter-signup input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.footer-bottom {
    border-top: 1px solid #343a40;
    padding-top: 20px;
    text-align: center;
    color: #adb5bd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom p {
    margin-bottom: 0;
    flex-grow: 1;
    text-align: left;
}

.footer-bottom .legal-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-bottom .legal-links a {
    color: #adb5bd;
}

.footer-bottom .legal-links a:hover {
    color: #007bff;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    font-size: 1.8em;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
        order: 3; /* Push nav below logo and actions */
    }

    .main-nav .nav-list {
        flex-direction: column;
        width: 100%;
        display: none; /* Hidden by default on mobile */
        margin-top: 15px;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }

    .main-nav .nav-list.active {
        display: flex;
    }

    .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    .nav-link::after {
        display: none; /* Hide hover underline on mobile */
    }

    .nav-item.dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        border-top: 1px solid #eee;
        padding-left: 20px;
        background-color: #f9f9f9;
        margin-top: 5px;
    }

    .menu-toggle {
        display: block;
        order: 2; /* Place toggle button near actions */
        margin-left: auto; /* Push to the right */
    }

    .header-actions {
        order: 1;
        width: 100%;
        justify-content: flex-end;
        margin-bottom: 15px;
    }

    .search-form {
        flex-grow: 1;
        margin-right: 10px;
    }

    .btn {
        width: auto;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 20px;
        width: 100%;
    }

    .social-icons {
        justify-content: center;
    }

    .newsletter-signup form {
        max-width: 300px;
        margin: 10px auto 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
    }

    .footer-bottom p {
        text-align: center;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .search-form {
        width: 100%;
        margin-right: 0;
    }
    .btn {
        width: 100%;
    }
    .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }
    .menu-toggle {
        margin-left: 0;
        width: 100%;
        text-align: right;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
