/* Category Page Styles - MattressCalc Pro */

/* Breadcrumb Navigation */
.breadcrumb {
    background-color: var(--background-light);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
    font-size: 13px;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-light);
}

.breadcrumb-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
    color: var(--primary-dark);
}

/* Category Hero Section */
.category-hero {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-white) 100%);
    padding: 50px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-hero .hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.category-hero .hero-text h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.category-hero .hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 600px;
}

/* Category Hero Stats - PC端居左对齐 */
.category-hero .hero-stats {
    display: flex;
    gap: 30px;
    justify-content: flex-start; /* PC端默认居左 */
    margin-top: 30px;
}

.category-hero .stat {
    text-align: center;
}

.category-hero .stat-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.category-hero .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-hero .hero-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

/* Calculator Grid Section */
.calculators-grid-section {
    padding: 60px 0;
    background-color: var(--background-white);
}

.calculators-grid-section .section-header {
    text-align: center;
    margin-bottom: 50px;
}

.calculators-grid-section .section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.calculators-grid-section .section-header p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Grid - Fixed 3-column layout */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* Calculator Card */
.calculator-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.calculator-card.featured {
    border: 2px solid var(--primary-color);
    position: relative;
}

.calculator-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

/* Card Header */
.card-header {
    padding: 20px 20px 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-bottom: 16px;
}

.card-badge {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Content */
.card-content {
    padding: 0 20px 20px;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.feature i {
    color: var(--accent-color);
    font-size: 10px;
}

/* Card Footer */
.card-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.usage-count {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.usage-count i {
    color: var(--primary-color);
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 40px;
}

.load-more-section .btn {
    padding: 14px 28px;
}

/* Educational Content */
.educational-content {
    padding: 60px 0;
    background-color: var(--background-light);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.content-main h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.content-main h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 16px;
}

.content-main p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Dimensions Table */
.dimensions-table {
    margin: 24px 0;
    overflow-x: auto;
}

.dimensions-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--background-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dimensions-table th,
.dimensions-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.dimensions-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.dimensions-table td {
    font-size: 13px;
    color: var(--text-secondary);
}

.dimensions-table tr:last-child td {
    border-bottom: none;
}

/* Content Sidebar */
.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.sidebar-widget h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 13px;
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
}

.sidebar-widget ul li::before {
    content: '•';
    color: var(--primary-color);
    margin-right: 8px;
}

.related-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--background-light);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.related-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.related-link i {
    color: var(--primary-color);
    width: 20px;
}

.related-link:hover i {
    color: white;
}

/* FAQ Section */
.faq-section {
    padding: 60px 0;
    background-color: var(--background-white);
}

.faq-section h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
}

/* FAQ Accordion Styles */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-light);
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: var(--background-white);
}

.faq-item.active .faq-question {
    background-color: var(--primary-color);
    color: white;
}

.faq-question h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.faq-item.active .faq-question h3 {
    color: white;
}

.faq-question i {
    color: var(--primary-color);
    font-size: 14px;
    transition: transform 0.3s ease, color 0.3s ease;
    margin-left: 16px;
}

.faq-item.active .faq-question i {
    color: white;
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 20px 24px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid var(--border-light);
}

/* Ad Section Styles */
.ad-section {
    padding: 40px 0;
    background-color: var(--background-light);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.ad-section .container {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet styles */
    .category-hero .hero-stats {
        justify-content: flex-start;
        gap: 25px;
    }

    .calculators-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .category-hero .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .category-hero .hero-text h1 {
        font-size: 24px;
    }
    
    .category-hero .hero-stats {
        justify-content: center;
        gap: 20px;
    }
    
    .category-hero .hero-icon {
        width: 100px;
        height: 100px;
        font-size: 40px;
        margin: 0 auto;
    }
    
    .calculators-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .faq-accordion {
        margin: 0 16px;
    }

    .faq-question {
        padding: 16px 20px;
    }

    .faq-question h3 {
        font-size: 15px;
    }

    .faq-answer p {
        padding: 16px 20px;
        font-size: 13px;
    }
    
    .dimensions-table {
        font-size: 12px;
    }
    
    .dimensions-table th,
    .dimensions-table td {
        padding: 8px 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .calculators-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .category-hero .hero-content {
        gap: 30px;
    }
    
    .category-hero .hero-text h1 {
        font-size: 26px;
    }
    
    .content-grid {
        gap: 30px;
    }
}

/* Animation for calculator cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    animation: fadeInUp 0.6s ease forwards;
}

.calculator-card:nth-child(1) { animation-delay: 0.1s; }
.calculator-card:nth-child(2) { animation-delay: 0.2s; }
.calculator-card:nth-child(3) { animation-delay: 0.3s; }
.calculator-card:nth-child(4) { animation-delay: 0.4s; }
.calculator-card:nth-child(5) { animation-delay: 0.5s; }
.calculator-card:nth-child(6) { animation-delay: 0.6s; }

/* Hidden calculators for load more functionality */
.calculator-card.hidden {
    display: none;
}

.calculator-card.show {
    display: flex;
    animation: fadeInUp 0.6s ease forwards;
}
