/* mall-new-ui theme — migrated for FreeMarker shell */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}

body.joyee-mall-v2 {
    color: var(--text-light);
    line-height: 1.6;
    background-color: var(--secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Color Palette */
:root {
    --primary: #121212;
    --secondary: #1a1a1a;
    --accent: #d4af37;
    --light: #2c2c2c;
    --dark: #f5f5f5;
    --medium: #b0b0b0;
    --highlight: #d4af37;
    --success: #27ae60;
    --text-dark: #121212;
    --text-light: #f5f5f5;
    /* Added variable for header height */
    --header-height: 120px; /* Default desktop height */
}

/* Header Styles */
.header {
    background-color: var(--primary);
    color: var(--text-light);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 30px rgba(0,0,0,0.3);
    transform: translateY(0);
}

.header.scrolled {
    padding: 5px 0;
    background-color: rgba(18, 18, 18, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.header.hidden {
    transform: translateY(-100%);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.header.scrolled .header-top {
    padding: 10px 5%;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1px;
    position: relative;
    z-index: 1001;
}

.logo span {
    color: var(--highlight);
    font-weight: 800;
}

.logo:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--highlight), transparent);
    opacity: 0.7;
}

.search-box {
    flex-grow: 1;
    margin: 0 40px;
    position: relative;
    min-width: 300px;
    max-width: 600px;
}

.search-box input {
    width: 100%;
    padding: 12px 25px;
    border: 1px solid #444;
    border-radius: 30px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: rgba(40, 40, 40, 0.8);
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.search-box input:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
    background-color: rgba(50, 50, 50, 0.9);
}

.search-box input::placeholder {
    color: #777;
    letter-spacing: 0.5px;
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium);
}

.header-actions {
    display: flex;
    gap: 25px;
}

.header-actions a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    position: relative;
    color: var(--text-light);
    transition: all 0.3s;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header-actions a:hover {
    color: var(--highlight);
    transform: translateY(-2px);
}

.header-actions i {
    font-size: 22px;
    margin-bottom: 5px;
}

/* Products Dropdown in Header */
.products-dropdown {
    position: relative;
}

.products-dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    background-color: rgba(30, 30, 30, 0.98);
    min-width: 260px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    z-index: 100;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 15px 0;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.products-dropdown-content a {
    color: var(--text-light);
    padding: 12px 25px;
    display: block;
    border-bottom: 1px solid rgba(68, 68, 68, 0.3);
    transition: all 0.2s;
    font-size: 14px;
}

.products-dropdown-content a:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--highlight);
    padding-left: 30px;
}

.products-dropdown-content .sub-dropdown {
    position: relative;
}

.products-dropdown-content .sub-dropdown:after {
    content: '‹';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium);
    font-size: 18px;
}

.products-dropdown-content .sub-dropdown-content {
    display: none;
    position: absolute;
    left: -260px;
    top: 0;
    background-color: rgba(30, 30, 30, 0.98);
    min-width: 260px;
    box-shadow: 15px 15px 35px rgba(0,0,0,0.3);
    border-radius: 8px 0 8px 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.products-dropdown-content .sub-dropdown:hover .sub-dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* L1 类目名允许换行，避免窄宽度下出现省略号（对齐 mall-new-ui） */
.products-dropdown-content .sub-dropdown > .joyee-products-l1 {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-left: 36px;
    padding-right: 16px;
}

.joyee-mobile-category-teleport {
    margin-bottom: 8px;
}

/* Quick Links Navigation */
.quick-links-nav {
    background-color: rgba(20, 20, 20, 0.95);
    color: white;
    padding: 15px 5%;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(68, 68, 68, 0.2);
}

.header.scrolled .quick-links-nav {
    padding: 10px 5%;
}

.quick-links-nav::-webkit-scrollbar {
    display: none;
}

.quick-links {
    display: flex;
    gap: 15px;
    padding: 5px 0;
    max-width: 1600px;
    margin: 0 auto;
}

.quick-link {
    padding: 10px 20px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 30px;
    white-space: nowrap;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--medium);
    border: 1px solid rgba(68, 68, 68, 0.3);
}

.quick-link:hover {
    background-color: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
    color: var(--highlight);
    border-color: rgba(212, 175, 55, 0.3);
}

/* Main Content */
.container {
    padding: 40px 5%;
    max-width: 1600px;
    margin: 0 auto;
    /* Added margin-top to prevent content overlapping */
    /*margin-top: var(--header-height);*/
}

.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-light);
    position: relative;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--highlight), transparent);
}

/* Improved Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

/* Large screens - 4 columns */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium screens - 3 columns */
@media (max-width: 1199px) and (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small screens - 2 columns */
@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    border: 1px solid rgba(68, 68, 68, 0.3);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: rgba(26, 26, 26, 0.8);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.product-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border-color: rgba(212, 175, 55, 0.5);
}

.product-card:hover:before {
    opacity: 1;
}

.product-image {
    height: 220px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
    pointer-events: none;
    z-index: 0;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

.product-card:hover .product-image img {
    transform: scale(1.1) translateY(-5px);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.product-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-light);
    font-size: 18px;
    letter-spacing: 0.5px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    color: var(--medium);
    font-size: 14px;
    margin-bottom: 20px;
}

.inquiry-btn {
    display: block;
    width: fit-content;
    max-width: 100%;
    align-self: center;
    padding: 14px 28px;
    box-sizing: border-box;
    text-align: center;
    background: linear-gradient(135deg, var(--highlight), #e8c252);
    color: var(--text-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: auto;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.inquiry-btn:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.inquiry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.inquiry-btn:hover:after {
    transform: translateX(0);
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, #1a1a1a, #121212);
    color: white;
    padding: 80px 5% 40px;
    margin-top: 80px;
    position: relative;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-column h3 {
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 12px;
    color: var(--text-light);
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--highlight), transparent);
}

.footer-column ul li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.footer-column ul li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--highlight);
}

.footer-column ul li a {
    color: var(--medium);
    transition: all 0.3s;
    font-size: 15px;
    display: inline-block;
}

.footer-column ul li a:hover {
    color: var(--highlight);
    transform: translateX(5px);
}

.footer-column ul li {
    color: var(--medium);
    font-size: 15px;
    line-height: 1.8;
}

/* Categories：胶囊标签 + flex 换行，随栏宽自动列数（对齐 quick-link 风格） */
.footer-column-categories .footer-category-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: clamp(7px, 1.8vw, 11px) clamp(8px, 2vw, 14px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-column-categories .footer-category-list li {
    margin-bottom: 0;
    padding-left: 0;
    line-height: 1.2;
    flex: 0 1 auto;
    max-width: 100%;
}

.footer-column-categories .footer-category-list li:before {
    display: none;
}

.footer-column-categories .footer-category-list li a {
    display: inline-block;
    padding: clamp(7px, 1.6vw, 10px) clamp(11px, 2.5vw, 18px);
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    border: 1px solid rgba(68, 68, 68, 0.4);
    color: var(--medium);
    font-size: clamp(12px, 2.9vw, 14px);
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    transform: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-column-categories .footer-category-list li a:hover {
    color: var(--highlight);
    background-color: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    transform: translateY(-2px);
}

.copyright {
    text-align: center;
    padding-top: 50px;
    margin-top: 50px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #777;
    font-size: 14px;
    max-width: 1600px;
    margin: 40px auto 0;
    letter-spacing: 0.5px;
}

/* Mobile Styles */
@media (max-width: 992px) {
    .header-top {
        padding: 15px 5%;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .search-box {
        min-width: 200px;
        margin: 0 20px;
    }
    
    .header-actions {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    /* Updated for mobile header height */
    :root {
        --header-height: 90px; /* Mobile header height */
    }
    
    .header-top {
        padding: 12px 5%;
    }
    
    .logo {
        font-size: 22px;
    }
    
    /* Search Box */
    .search-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(26, 26, 26, 0.98);
        padding: 15px;
        z-index: 100;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    .search-container.active {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .search-container input {
        flex: 1;
        padding: 12px 20px;
        border: 1px solid #444;
        border-radius: 30px;
        background-color: rgba(40, 40, 40, 0.8);
        color: white;
    }
    
    .search-submit {
        padding: 12px 20px;
        background: linear-gradient(135deg, var(--highlight), #e8c252);
        color: var(--text-dark);
        border: none;
        border-radius: 30px;
        cursor: pointer;
        white-space: nowrap;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }
    
    /* Hide desktop elements */
    .header-actions, 
    .search-box {
        display: none;
    }
    
    /* Mobile actions */
    .mobile-actions {
        display: flex;
        gap: 20px;
        margin-left: 20px;
    }
    
    .mobile-actions a {
        font-size: 20px;
        display: flex;
        align-items: center;
        color: white;
        transition: all 0.3s;
    }
    
    .mobile-actions a:hover {
        color: var(--highlight);
        transform: scale(1.1);
    }
    
    /* Mobile Menu */
    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(20, 20, 20, 0.98);
        z-index: 1000;
        padding: 80px 25px 30px;
        overflow-y: auto;
        color: white;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    .mobile-menu.active {
        display: block;
        animation: fadeIn 0.4s ease-out;
    }
    
    .mobile-menu .products-dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        animation: none;
        background-color: transparent;
    }
    
    .mobile-menu .sub-dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 25px;
        background-color: rgba(0,0,0,0.2);
        margin: 10px 0;
        border-left: 2px solid rgba(212, 175, 55, 0.3);
        display: block !important;
    }

    .mobile-menu .products-dropdown-content .sub-dropdown:after {
        display: none;
    }
    
    .menu-close {
        position: absolute;
        top: 25px;
        right: 25px;
        font-size: 28px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
        color: white;
        transition: all 0.3s;
    }
    
    .menu-close:hover {
        color: var(--highlight);
        transform: rotate(90deg);
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.7);
        z-index: 999;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    
    .overlay.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }
    
    .section-title {
        font-size: 26px;
        margin-bottom: 30px;
    }
    
    .container {
        padding: 30px 5%;
    }
}

@media (min-width: 769px) {
    .mobile-actions,
    .mobile-menu,
    .overlay,
    .search-container {
        display: none !important;
    }
}

/* Added spacer for header */
.header-spacer {
    height: var(--header-height);
    width: 100%;
}

/* ---- FreeMarker / legacy integration (mall-app-web) ---- */
a.logo {
    display: block;
    color: inherit;
}

.joyee-header-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.joyee-header-link i {
    font-size: 22px;
    margin-bottom: 5px;
}

.joyee-header-link:hover {
    color: var(--highlight);
    transform: translateY(-2px);
}

.joyee-header-link.joyee-active {
    color: var(--highlight);
    position: relative;
}

.joyee-header-link.joyee-active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--highlight);
    opacity: 0.95;
}

.joyee-header-product-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joyee-mall-v2 #product.joyee-header-product > a span {
    color: var(--text-light);
}

.joyee-search-desktop {
    position: relative;
    flex-grow: 1;
    margin: 0 40px;
    min-width: 200px;
    max-width: 600px;
}

.joyee-minisearch {
    margin: 0;
}

.joyee-search-input {
    width: 100%;
    padding: 12px 48px 12px 25px;
    border: 1px solid #444;
    border-radius: 30px;
    font-size: 15px;
    background-color: rgba(40, 40, 40, 0.8);
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.joyee-search-input:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.joyee-search-trigger {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--medium);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
}

.joyee-search-trigger:hover {
    color: var(--highlight);
}

.joyee-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.joyee-mobile-nav a {
    color: var(--text-light);
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 16px;
}

.joyee-mobile-nav a:hover {
    color: var(--highlight);
}

.joyee-page-main {
    margin-top: 0;
    width: 100%;
}

.joyee-view-more-wrap {
    text-align: center;
    padding: 24px 16px 80px;
}

.joyee-view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--highlight), #e8c252);
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.joyee-view-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* 当前浏览商品卡片：与 hover 区分但不抢戏 */
.joyee-mall-v2 .product-card.activeGoods {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(212, 175, 55, 0.25) !important;
}

.joyee-mall-v2 .product-card.activeGoods:before {
    opacity: 0.55;
}

.joyee-mall-v2 .page-wrapper {
    min-height: 100vh;
}

.joyee-mall-v2 .footer {
    position: relative;
}

/* Vue header categories: trigger 与 Home/Profile 一致 */
.joyee-mall-v2 #product.joyee-header-product .joyee-header-link.joyee-active {
    color: var(--highlight);
}
