/* Shared CSS for global styles, common components, and layout utilities */

/* --- Variables --- */
:root {
    --primary-color: #007bff; /* Blue */
    --secondary-color: #6c757d; /* Gray */
    --accent-color: #28a745; /* Green */
    --text-color: #343a40; /* Dark text */
    --light-text-color: #f8f9fa; /* Light text */
    --background-color: #f8f9fa; /* Light background */
    --dark-background-color: #343a40; /* Dark background */
    --border-color: #dee2e6;
    --font-family-sans-serif: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
}

/* --- Base Styles & Resets --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling on landscape */
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--dark-background-color);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: #0056b3; /* Darker primary color */
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

/* --- Layout Components --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(-1 * var(--spacing-md));
    margin-right: calc(-1 * var(--spacing-md));
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* --- Forms --- */
.search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
}

.search-form input[type="search"] {
    border: none;
    padding: 0.5rem 1rem;
    flex-grow: 1;
    outline: none;
    font-size: var(--font-size-base);
}

.search-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

/* --- Header Specific Styles --- */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.header-topbar {
    background-color: var(--dark-background-color);
    color: var(--light-text-color);
    padding: 8px 0;
    font-size: 0.875rem;
}

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

.header-topbar .contact-info span {
    margin-right: 20px;
}

.header-topbar .contact-info i {
    margin-right: 5px;
    color: var(--primary-color);
}

.header-topbar .social-media a {
    color: var(--light-text-color);
    margin-left: 15px;
    transition: color 0.3s ease;
}

.header-topbar .social-media a:hover {
    color: var(--primary-color);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.navbar-brand .logo-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand .logo-img {
    height: 40px;
    margin-right: 10px;
}

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

.main-navigation .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    position: relative;
}

.main-navigation .nav-link:hover,
.main-navigation .nav-link.active {
    color: var(--primary-color);
}

.nav-item.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0.25rem;
    padding: 10px 0;
    display: none; /* Hidden by default, shown with JS or CSS :hover */
    z-index: 1001;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-color);
}

.dropdown-menu li a:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
    text-decoration: none;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

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

/* --- Footer Specific Styles --- */
.site-footer {
    background-color: var(--dark-background-color);
    color: var(--light-text-color);
    padding: 50px 0 20px;
    font-size: 0.9rem;
}

.footer-widgets {
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-col .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col p {
    margin-bottom: 10px;
}

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

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

.footer-col ul li a {
    color: var(--light-text-color);
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-col .social-links a {
    color: var(--light-text-color);
    font-size: 1.2rem;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-col .social-links a:hover {
    color: var(--primary-color);
}

.footer-col address p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-col address i {
    margin-right: 10px;
    color: var(--primary-color);
    margin-top: 4px; /* Align icon better with text */
}

.newsletter-signup h4 {
    color: #fff;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.newsletter-signup form {
    display: flex;
}

.newsletter-signup input[type="email"] {
    flex-grow: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem 0 0 0.25rem;
    outline: none;
    font-size: var(--font-size-base);
}

.newsletter-signup button {
    border-radius: 0 0.25rem 0.25rem 0;
    padding: 0.6rem 1rem;
    white-space: nowrap;
}

.footer-bottom {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom .copyright {
    margin-bottom: 10px; /* For mobile stacking */
    flex-grow: 1;
}

.footer-bottom .copyright i {
    color: #dc3545; /* Red heart */
}

.footer-bottom .copyright a {
    color: var(--light-text-color);
    margin: 0 5px;
}

.footer-bottom .payment-methods {
    display: flex;
    gap: 10px;
}

.footer-bottom .payment-methods img {
    height: 25px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.footer-bottom .payment-methods img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .main-navigation .nav-menu {
        display: none; /* Hide main menu on smaller screens */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 10px 0;
        border-top: 1px solid var(--border-color);
    }

    .main-navigation .nav-menu.active {
        display: flex; /* Show when active */
    }

    .main-navigation .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .main-navigation .nav-item:last-child {
        border-bottom: none;
    }

    .main-navigation .nav-link {
        padding: 15px 20px;
        width: 100%;
    }

    .main-navigation .menu-toggle {
        display: block; /* Show toggle button */
    }

    .header-actions {
        display: none; /* Hide actions on small screens, or re-arrange */
    }

    .footer-row {
        flex-direction: column;
    }

    .footer-col {
        margin-bottom: 30px;
    }

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

    .footer-bottom .copyright {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .header-topbar .container {
        flex-direction: column;
        text-align: center;
    }
    .header-topbar .contact-info,
    .header-topbar .social-media {
        margin-bottom: 10px;
    }
    .main-header .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .navbar-brand {
        margin-bottom: 15px;
    }
    .newsletter-signup form {
        flex-direction: column;
        gap: 10px;
    }
    .newsletter-signup input[type="email"] {
        border-radius: 0.25rem;
    }
    .newsletter-signup button {
        border-radius: 0.25rem;
    }
    .footer-bottom .payment-methods {
        margin-top: 15px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
