/* =====================================================================
 * 前台店铺样式
 * ===================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

a {
    color: #660099;
    text-decoration: none;
}

a:hover {
    color: #520080;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

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

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.brand img {
    height: 40px;
    width: auto;
    display: block;
}

.main-nav {
    flex: 1;
}

.main-nav > ul {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav > ul > li {
    position: relative;
}

.main-nav > ul > li > a {
    display: block;
    padding: 8px 14px;
    color: #333;
    font-weight: 500;
    border-radius: 4px;
}

.main-nav > ul > li > a:hover {
    background: #f5f7fa;
    color: #660099;
}

/* 下拉子分类 */
.main-nav .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    display: none;
}

.main-nav .has-children:hover .dropdown {
    display: block;
}

.main-nav .dropdown a {
    display: block;
    padding: 8px 16px;
    color: #333;
}

.main-nav .dropdown a:hover {
    background: #f5f7fa;
    color: #660099;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-search input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

.header-search button {
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    background: #660099;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.header-search button:hover {
    background: #520080;
}

.nav-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #f3ecf9 0%, #eadcf7 100%);
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
    color: #1c2b46;
}

.hero p {
    font-size: 18px;
    color: #5a6b85;
}

/* ---------- Section ---------- */
.section {
    padding: 48px 0;
}

.section-title {
    font-size: 26px;
    margin-bottom: 24px;
    text-align: center;
    color: #1c2b46;
}

.section-more {
    text-align: center;
    margin-top: 28px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: #660099;
    color: #fff;
    border-radius: 6px;
    font-weight: 500;
}

.btn:hover {
    background: #520080;
    color: #fff;
}

/* ---------- Category grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    position: relative;
    display: block;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    height: 160px;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card .category-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    font-weight: 500;
}

/* ---------- Product grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    background: #fff;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-card-image {
    display: block;
    height: 200px;
    background: #f5f7fa;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bbb;
}

.product-card-body {
    padding: 14px;
}

.product-name {
    font-size: 16px;
    margin-bottom: 6px;
}

.product-name a {
    color: #1c2b46;
}

.product-name a:hover {
    color: #660099;
}

.product-model {
    color: #999;
    font-size: 13px;
    margin-bottom: 6px;
}

.product-short {
    color: #666;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Page layout ---------- */
.page-layout {
    display: flex;
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 48px;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #1c2b46;
}

.category-nav > li > a {
    display: block;
    padding: 8px 10px;
    color: #333;
    border-radius: 4px;
}

.category-nav > li > a:hover,
.category-nav > li > a.active {
    background: #f3ecf9;
    color: #660099;
}

.category-nav-children {
    margin-left: 14px;
}

.category-nav-children a {
    display: block;
    padding: 6px 10px;
    color: #666;
    font-size: 14px;
    border-radius: 4px;
}

.category-nav-children a:hover,
.category-nav-children a.active {
    color: #660099;
}

.content-area {
    flex: 1;
    min-width: 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
}

.breadcrumb .sep {
    margin: 0 8px;
    color: #ccc;
}

.breadcrumb .current {
    color: #333;
}

/* ---------- List toolbar ---------- */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.list-title {
    font-size: 24px;
    color: #1c2b46;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-form select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.category-description {
    color: #666;
    margin-bottom: 20px;
}

.empty {
    padding: 40px 0;
    text-align: center;
    color: #999;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 32px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    background: #fff;
}

.page-link:hover {
    border-color: #660099;
    color: #660099;
}

.page-link.active {
    background: #660099;
    border-color: #660099;
    color: #fff;
}

.page-link.disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* ---------- Product detail ---------- */
.product-detail {
    padding-top: 24px;
    padding-bottom: 48px;
}

.detail-main {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.gallery {
    flex: 1;
    max-width: 500px;
}

.gallery-main {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
    background: #f5f7fa;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.gallery-thumbs .thumb {
    width: 72px;
    height: 72px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    opacity: 0.7;
}

.gallery-thumbs .thumb.active {
    border-color: #660099;
    opacity: 1;
}

.gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-name {
    font-size: 28px;
    color: #1c2b46;
    margin-bottom: 16px;
}

.detail-model,
.detail-sku {
    color: #666;
    margin-bottom: 8px;
}

.detail-model span,
.detail-sku span,
.detail-categories span {
    font-weight: 600;
    color: #333;
}

.detail-categories {
    margin-bottom: 16px;
}

.detail-short {
    color: #555;
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.detail-description {
    margin-bottom: 40px;
}

.detail-description h2,
.related-section h2 {
    font-size: 22px;
    color: #1c2b46;
    margin-bottom: 16px;
}

.rich-text {
    color: #444;
    line-height: 1.8;
}

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

/* ---------- Single page ---------- */
.page-single {
    padding: 32px 20px;
}

.page-title {
    font-size: 28px;
    color: #1c2b46;
    margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #1c2b46;
    color: #c3cde0;
    margin-top: 48px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding: 48px 20px;
}

.footer-col h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 14px;
}

.footer-col p {
    margin-bottom: 12px;
    font-size: 14px;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: #c3cde0;
}

.footer-links a:hover {
    color: #fff;
}

.footer-links .footer-links {
    margin-left: 14px;
    margin-top: 6px;
}

.subscribe-form input {
    display: block;
    width: 100%;
    height: 38px;
    margin-bottom: 10px;
    padding: 0 12px;
    border: 1px solid #3a4a68;
    border-radius: 6px;
    background: #243452;
    color: #fff;
    font-size: 14px;
}

.subscribe-form input::placeholder {
    color: #8fa0bf;
}

.subscribe-form button {
    height: 38px;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    background: #660099;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.subscribe-form button:hover {
    background: #520080;
}

.subscribe-message {
    margin-top: 10px;
    font-size: 14px;
}

.subscribe-message.success {
    color: #67c23a;
}

.subscribe-message.error {
    color: #f56c6c;
}

.footer-bottom {
    border-top: 1px solid #2b3a56;
    padding: 18px 0;
    text-align: center;
    font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        flex-basis: 100%;
        order: 3;
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav > ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-nav .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 14px;
    }

    .header-search {
        margin-left: auto;
    }

    .header-search input {
        width: 140px;
    }

    .detail-main {
        flex-direction: column;
    }

    .gallery {
        max-width: none;
    }

    .gallery-main {
        height: 300px;
    }

    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* ---------- Inquiry form ---------- */
.inquiry-form .inquiry-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.inquiry-form .inquiry-row .inquiry-field {
    flex: 1;
}

.inquiry-form .inquiry-field {
    margin-bottom: 14px;
}

.inquiry-form .inquiry-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1c2b46;
}

.inquiry-form .inquiry-field input,
.inquiry-form .inquiry-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.inquiry-form .inquiry-field input:focus,
.inquiry-form .inquiry-field textarea:focus {
    outline: none;
    border-color: #660099;
}

.inquiry-form .inquiry-field textarea {
    resize: vertical;
    min-height: 100px;
}

.inquiry-message {
    margin-top: 10px;
    font-size: 14px;
}

.inquiry-message.success {
    color: #67c23a;
}

.inquiry-message.error {
    color: #f56c6c;
}

/* ---------- Inquiry modal ---------- */
.inquiry-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.inquiry-modal.open {
    display: flex;
}

.inquiry-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.inquiry-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.inquiry-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.inquiry-modal-close:hover {
    color: #333;
}

.inquiry-modal-title {
    font-size: 22px;
    color: #1c2b46;
    margin-bottom: 20px;
    padding-right: 24px;
}

/* ---------- Inquiry floating button ---------- */
.inquiry-fab {
    position: fixed;
    right: 0;
    top: 80%;
    transform: translateY(-50%);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #660099;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(102, 0, 153, 0.35);
}

.inquiry-fab:hover {
    background: #520080;
}

/* ---------- Contact page ---------- */
.contact-layout {
    display: flex;
    gap: 40px;
}

.contact-info {
    flex: 1;
    max-width: 340px;
}

.contact-intro {
    color: #666;
    margin-bottom: 20px;
}

.contact-item {
    margin-bottom: 18px;
}

.contact-item h3 {
    font-size: 15px;
    color: #1c2b46;
    margin-bottom: 4px;
}

.contact-item p {
    color: #555;
}

.contact-form {
    flex: 1.4;
    min-width: 0;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 24px;
    background: #fafafa;
}

.contact-form-title {
    font-size: 20px;
    color: #1c2b46;
    margin-bottom: 18px;
}

.detail-actions {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .contact-layout {
        flex-direction: column;
    }

    .contact-info {
        max-width: none;
    }

    .inquiry-form .inquiry-row {
        flex-direction: column;
        gap: 0;
    }
}
