/* ============================================================
   home.css — 首页布局 + Hero / Categories / Footer / Cart Bar
   (与 base.css CSS 变量保持一致)
   Navbar 样式已移至 sg-common.css（全局加载）
   ============================================================ */

/* ========================================================== */
/* HERO BANNER                                                */
/* ========================================================== */
.sg-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.sg-hero-carousel {
    position: relative;
    width: 100%;
    height: 420px;
}

.sg-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    pointer-events: none;
}
.sg-hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide backgrounds */
.sg-hero-slide-1 {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}
.sg-hero-slide-2 {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
}

.sg-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
}

.sg-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding: 0 24px;
    max-width: 720px;
}

.sg-hero-title {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.sg-hero-sub {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    opacity: 0.9;
}

.sg-hero-desc {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 28px;
    opacity: 0.75;
}

.sg-hero-btn {
    display: inline-block;
    padding: 14px 36px;
    background: var(--sg-primary, #2d8a4e);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, transform 0.15s;
}
.sg-hero-btn:hover {
    background: var(--sg-primary-hover, #1e6b3a);
    transform: translateY(-1px);
}

/* Carousel controls */
.sg-hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.sg-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.sg-hero-dot.active {
    background: #ffffff;
    transform: scale(1.3);
}

.sg-hero-prev,
.sg-hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #ffffff;
    font-size: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.sg-hero-prev { left: 16px; }
.sg-hero-next { right: 16px; }
.sg-hero-prev:hover,
.sg-hero-next:hover {
    background: rgba(255,255,255,0.3);
}

/* ========================================================== */
/* CATEGORY QUICK ENTRY (Icon Grid)                           */
/* ========================================================== */
.sg-categories {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

.sg-categories-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.sg-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 16px 14px;
    min-width: 110px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.sg-cat-item:hover {
    background: #ffffff;
    border-color: var(--sg-primary, #2d8a4e);
    box-shadow: 0 4px 16px rgba(4,107,210,0.1);
    transform: translateY(-2px);
}

.sg-cat-icon {
    font-size: 28px;
    line-height: 1;
}

.sg-cat-name {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    text-align: center;
    line-height: 1.3;
}
.sg-cat-item:hover .sg-cat-name {
    color: var(--sg-primary, #2d8a4e);
}

/* ========================================================== */
/* FOOTER — Universal                                         */
/* ========================================================== */
.sg-footer {
    background: #0f172a;
    color: rgba(255,255,255,0.7);
    padding: 32px 24px;
    margin-top: 0;
    border: none;
}

.sg-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sg-footer-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.sg-footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 12px;
    transition: color 0.15s;
}
.sg-footer-links a:hover {
    color: #ffffff;
}

.sg-footer-sep {
    color: rgba(255,255,255,0.2);
    font-size: 13px;
}

.sg-footer-copy {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

/* ========================================================== */
/* CATEGORY PAGE - L1 SECTION (breadcrumb merged)             */
/* ========================================================== */
.sg-l1-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px 0;
}
.sg-l1-breadcrumb {
    font-size: 13px;
    color: #94a3b8;
    padding: 8px 0 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}
.sg-l1-breadcrumb a {
    color: var(--sg-primary, #2d8a4e);
    text-decoration: none;
}
.sg-l1-breadcrumb a:hover {
    text-decoration: underline;
}
.sg-bc-sep {
    color: #cbd5e1;
    margin: 0 4px;
}
.sg-bc-current {
    color: #475569;
    font-weight: 600;
}
.sg-l1-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

/* ========================================================== */
/* CART BAR — Universal (page bottom)                         */
/* ========================================================== */
.sg-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 24px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    text-align: left;
}

.sg-cart-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

.sg-cart-info {
    font-weight: 600;
}

.sg-cart-count {
    background: var(--sg-primary, #2d8a4e);
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sg-cart-label {
    color: #94a3b8;
    margin-right: 8px;
}

.sg-cart-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--sg-primary, #2d8a4e);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}
.sg-cart-btn:hover {
    background: var(--sg-primary-hover, #1e6b3a);
}

/* ========================================================== */
/* RESPONSIVE                                                 */
/* ========================================================== */
@media (max-width: 768px) {
    .sg-hero-carousel {
        height: 300px;
    }
    .sg-hero-title {
        font-size: 30px;
    }
    .sg-hero-sub {
        font-size: 16px;
    }
    .sg-hero-desc {
        font-size: 14px;
        margin: 0 0 20px;
    }
    .sg-hero-btn {
        padding: 12px 28px;
        font-size: 14px;
    }
    .sg-hero-prev,
    .sg-hero-next {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    .sg-hero-prev { left: 8px; }
    .sg-hero-next { right: 8px; }

    .sg-categories {
        padding: 24px 16px;
    }
    .sg-categories-inner {
        gap: 8px;
    }
    .sg-cat-item {
        min-width: 80px;
        padding: 12px 10px 10px;
    }
    .sg-cat-icon {
        font-size: 22px;
    }
    .sg-cat-name {
        font-size: 11px;
    }

    .sg-l1-section {
        padding: 8px 16px 0;
    }
    .sg-l1-breadcrumb {
        font-size: 12px;
    }
    .sg-l1-nav {
        gap: 4px;
    }

    .sg-footer {
        padding: 24px 16px;
    }
    .sg-cart-bar {
        padding: 8px 16px;
    }
}

/* ==========================================================
   CATEGORY PAGE — L2 / Products Grid / Filter / Pagination
   ========================================================== */

/* ── L1-L2 Divider ── */
.sg-l1-l2-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 0;
}

/* ── L2 Subcategories ── */
.sg-l2-nav {
    padding: 8px 24px 12px;
}
.sg-l2-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.sg-l2-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sg-l2-chip {
    display: inline-block;
    padding: 5px 14px;
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.sg-l2-chip:hover,
.sg-l2-chip.active {
    background: var(--sg-primary, #2d8a4e);
    color: #fff;
}

/* ── Category Header ── */
.sg-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.sg-cat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sg-cat-header-icon {
    font-size: 28px;
}
.sg-cat-header-text h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}
.sg-cat-header-text p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #64748b;
}
.sg-cat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sg-sort-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    background: #fff;
    cursor: pointer;
}

/* ── Category Content: Sidebar + Grid ── */
.sg-cat-content {
    display: flex;
    gap: 24px;
    padding: 20px 24px 70px;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 400px;
}

/* ── Filter Sidebar ── */
.sg-filter-sidebar {
    width: 200px;
    flex-shrink: 0;
}
.sg-filter-section {
    margin-bottom: 20px;
}
.sg-filter-section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.sg-filter-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sg-filter-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}
.sg-filter-options input[type="checkbox"] {
    accent-color: var(--sg-primary, #2d8a4e);
}
.sg-count {
    color: #94a3b8;
    font-size: 12px;
}

/* ── Products Grid ── */
.sg-products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── Product Card ── */
.sg-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
}
.sg-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.sg-product-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8fafc;
}
.sg-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sg-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 48px;
}
.sg-badge-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    pointer-events: none;
}
.sg-version-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sg-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.sg-product-secondary {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sg-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-product-tags {
    margin-top: 2px;
    line-height: 1;
}
.sg-custom-tag {
    font-size: 11px;
    color: var(--sg-accent, #e74c3c);
    font-weight: 500;
}
.sg-product-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
    margin-top: 4px;
}
.sg-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}
.sg-product-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.sg-btn-add-quote {
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-primary, #2d8a4e);
    cursor: pointer;
}
.sg-btn-wishlist {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #cbd5e1;
    padding: 2px;
    line-height: 1;
}
.sg-btn-wishlist:hover {
    color: #ef4444;
}

/* ── Pagination ── */
.sg-pagination {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}
.sg-pagination a,
.sg-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.sg-pagination a:hover {
    background: #f1f5f9;
    color: var(--sg-primary, #2d8a4e);
}
.sg-pagination .current {
    background: var(--sg-primary, #2d8a4e);
    color: #fff;
    border-color: var(--sg-primary, #2d8a4e);
}

.sg-empty-msg {
    grid-column: 1 / -1;
    color: #94a3b8;
    padding: 40px;
    text-align: center;
    font-size: 14px;
}

/* ── Category Page Responsive ── */
@media (max-width: 768px) {
    .sg-cat-content {
        flex-direction: column;
        padding: 16px;
    }
    .sg-filter-sidebar {
        width: 100%;
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .sg-filter-section {
        min-width: 160px;
        flex-shrink: 0;
    }
    .sg-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .sg-cat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
