/* Global Reset and Base Styles */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f8f8f8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-topbar {
    background-color: #f0f0f0;
    padding: 10px 0;
    font-size: 0.9em;
    color: #555;
}

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

.topbar-left span {
    margin-right: 15px;
}

.topbar-link {
    margin-left: 15px;
    color: #555;
}

.topbar-link:hover {
    color: #007bff;
}

.register-btn {
    background-color: #007bff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
}

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

.language-selector select {
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 0.9em;
}

.header-main {
    padding: 15px 0;
}

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

.logo img {
    display: block;
}

.main-navigation ul {
    display: flex;
}

.main-navigation li {
    position: relative;
    margin-left: 30px;
}

.main-navigation a {
    color: #333;
    font-weight: bold;
    padding: 10px 0;
    display: block;
}

.main-navigation a:hover {
    color: #007bff;
    text-decoration: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-top: 3px solid #007bff;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-box input {
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 20px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
}

.search-box button:hover {
    color: #007bff;
}

.cart-icon {
    position: relative;
    color: #333;
    font-size: 1.2em;
    margin-right: 20px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
    line-height: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.user-profile .avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #eee;
}

.username {
    font-weight: bold;
    color: #333;
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

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

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

.footer-widget {
    flex: 1;
    min-width: 250px;
    margin: 0 15px 30px 15px;
}

.footer-widget h3 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

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

.footer-widget ul {
    list-style: none;
    padding: 0;
}

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

.footer-widget a {
    color: #ccc;
}

.footer-widget a:hover {
    color: #007bff;
    text-decoration: none;
}

.social-links a {
    color: #fff;
    font-size: 1.3em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #007bff;
}

.footer-widget i {
    margin-right: 8px;
    color: #007bff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
}

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

.footer-bottom p {
    margin: 0;
}

.payment-methods img {
    height: 25px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.payment-methods img:hover {
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .main-navigation {
        display: none; /* Hide main nav on smaller screens */
    }
    .mobile-menu-toggle {
        display: block; /* Show mobile toggle */
    }
    .header-main .container {
        justify-content: space-between;
    }
    .header-actions {
        margin-left: auto; /* Push actions to the right */
    }
    .user-profile {
        display: none; /* Hide user profile on smaller screens */
    }
}

@media (max-width: 768px) {
    .header-topbar {
        display: none; /* Hide topbar on very small screens */
    }
    .footer-widgets {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        min-width: unset;
        width: 100%;
        text-align: center;
        margin: 0 0 30px 0;
    }
    .footer-widget ul {
        text-align: center;
    }
    .footer-bottom .container {
        flex-direction: column;
    }
    .footer-bottom p {
        margin-bottom: 15px;
    }
    .social-links {
        justify-content: center;
        display: flex;
    }
}

/* Font Awesome CDN (for icons) - typically linked in HTML, but can be mentioned here for context */
/* @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css'); */
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
