/* Modern E-commerce Style for Solar Industry Directory */

.solar-directory-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    background-color: #ffffff;
}

.solar-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-button {
    background-color: #f5f5f5;
    border: 2px solid transparent;
    padding: 14px 40px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 50px;
    color: #666;
}

.tab-button:hover {
    background-color: #e8f4f8;
    color: #0073aa;
}

.tab-button.active {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #ffffff;
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.solar-categories-container {
    min-height: 200px; /* To prevent layout shifts during AJAX loading */
    position: relative;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -15px;
    margin-left: -15px;
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.solar-category-accordion {
    margin-bottom: 25px;
    border: none;
    border-radius: 12px;
    background-color: #fafafa;
    overflow: hidden;
}

.accordion-header {
    padding: 20px 25px;
    cursor: pointer;
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: linear-gradient(to right, #e8f4f8 0%, #f0f8ff 100%);
    color: #0073aa;
}

.accordion-header .arrow {
    border: solid #0073aa;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 5px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.accordion-header.active .arrow {
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
}

.accordion-content {
    padding: 25px;
    display: none;
    background-color: #ffffff;
}

.accordion-content.active {
    display: block;
}

.solar-subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.subcategory-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subcategory-card:hover {
    box-shadow: 0 8px 20px rgba(0, 115, 170, 0.15);
    transform: translateY(-4px);
    border-color: #0073aa;
}

.subcategory-card.active {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    border-color: #0073aa;
    box-shadow: 0 8px 20px rgba(0, 115, 170, 0.3);
}

.subcategory-card.active span {
    color: #ffffff;
}

.subcategory-card img {
    max-width: 100%;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
}

.subcategory-card span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.3s ease;
}

/* E-commerce Style Product Grid */
.solar-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.solar-item-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.solar-item-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
    border-color: #0073aa;
}

.solar-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f5f5f5;
}

.solar-item-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.solar-item-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.solar-item-company {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    overflow: visible;
}

.solar-item-company-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background-color: #fafafa;
    padding: 6px;
    flex-shrink: 0;
}

.solar-item-company-name {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.solar-item-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.solar-item-button {
    display: inline-block;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #ffffff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

.solar-item-button:hover {
    background: linear-gradient(135deg, #005177 0%, #003d5c 100%);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

.no-items-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Single Company Page Styles */
.single-solar_company .entry-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
}

.single-solar_company .post-thumbnail img {
    max-width: 200px;
    height: auto;
    border-radius: 12px;
    border: none;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.single-solar_company .entry-content {
    line-height: 1.8;
    font-size: 17px;
    color: #2c3e50;
}

.company-products-services {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f4f8 100%);
    padding: 30px;
    border-radius: 16px;
    margin-top: 40px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.company-products-services h2 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.company-products-services ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.company-products-services li {
    padding: 0;
    border-bottom: none;
}

.company-products-services a {
    display: block;
    padding: 16px 20px;
    background: #ffffff;
    color: #0073aa;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.company-products-services a:hover {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #ffffff;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Single Item Page Styles */
.single-solar_item .entry-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
}

.single-solar_item .post-thumbnail img {
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    border: none;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.single-solar_item .entry-content {
    line-height: 1.8;
    font-size: 17px;
    color: #2c3e50;
}

.single-solar_item .item-company-name {
    font-size: 16px;
    color: #0073aa;
    margin: 15px 0;
    font-style: normal;
    font-weight: 600;
}

.single-solar_item .external-url-button {
    display: inline-block;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    padding: 16px 40px;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 30px;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.single-solar_item .external-url-button:hover {
    background: linear-gradient(135deg, #005177 0%, #003d5c 100%);
    box-shadow: 0 8px 20px rgba(0, 115, 170, 0.5);
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .solar-directory-wrapper {
        padding: 20px 15px;
    }

    .solar-tabs {
        flex-direction: row;
        gap: 8px;
    }

    .tab-button {
        padding: 12px 24px;
        font-size: 15px;
        flex: 1;
    }

    .solar-subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .accordion-header {
        font-size: 18px;
        padding: 16px 18px;
    }

    .solar-items-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .solar-item-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .solar-tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .solar-subcategories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
