/* Voltride brand colors */
:root {
    --voltride-primary: #ADFF60;
    --voltride-secondary: #0F3F36;
    --volt-pink-dark: #FF3366;
    --voltride-text: #333333;
    --voltride-text-light: #666666;
    --voltride-border: #E5E5E5;
    --voltride-background: #FFFFFF;
    --voltride-hover: #F5F5F5;
    --voltride-shadow: rgba(0, 0, 0, 0.08);
    --voltride-radius: 8px;
    --voltride-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --category-header-height: 56px;
}

.voltride-specs-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 2em auto;
    max-width: 1400px;
}

.specs-category {
    background: var(--voltride-secondary);
    border-radius: var(--voltride-radius);
    overflow: hidden;
    height: fit-content;
    box-shadow: 0 2px 4px var(--voltride-shadow);
}

.category-header {
    height: var(--category-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--voltride-secondary);
    color: var(--voltride-background);
    position: relative;
}

.category-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    background: var(--voltride-primary);
    transition: background-color var(--voltride-transition);
}

.voltride-specs-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding-left: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--voltride-background);
    flex: 1;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--voltride-background);
}

.spec-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px 20px;
    min-height: 48px;
    border-bottom: 1px solid var(--voltride-border);
    background: var(--voltride-background);
}

.spec-card:nth-child(odd) {
    background: #F8F9FA;
}

.spec-card:last-child {
    border-bottom: none;
}

.spec-card:hover {
    background: var(--voltride-hover);
}

.spec-card-prominent {
    background: rgba(173, 255, 96, 0.1) !important;
}

.spec-card-prominent:hover {
    background: rgba(173, 255, 96, 0.15) !important;
}

.spec-label {
    color: var(--voltride-text);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.spec-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
    justify-content: flex-end;
    color: var(--voltride-secondary);
    font-weight: 600;
    min-width: 90px;
}

.spec-number {
    font-size: 15px;
}

.spec-unit {
    color: var(--voltride-text-light);
    font-size: 13px;
    font-weight: normal;
}

/* Category toggle button - Only visible on mobile */
button.category-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--voltride-background);
    cursor: pointer;
}

.toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    fill: currentColor;
}

.toggle-icon svg path {
    fill: currentColor;
}

.is-collapsed .toggle-icon svg {
    transform: rotate(-135deg);
}

/* Active category styling */
.specs-category:not(.is-collapsed) .category-header::before {
    background: var(--volt-pink-dark);
}

/* Desktop optimization */
@media screen and (min-width: 1200px) {
    .voltride-specs-wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet adjustments */
@media screen and (min-width: 769px) and (max-width: 1199px) {
    .voltride-specs-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .voltride-specs-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 1em 0;
    }

    .specs-category {
        margin-bottom: 0;
    }

    button.category-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        padding: 0;
        width: 32px;
        height: 32px;
        color: var(--voltride-background);
        cursor: pointer;
    }

    .category-header {
        padding: 0 16px;
        cursor: pointer;
        transition: background-color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .category-header:active {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .toggle-icon svg {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .is-collapsed .toggle-icon svg {
        transform: rotate(-180deg);
    }

    .specs-grid {
        transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        height: auto;
        visibility: visible;
        opacity: 1;
    }

    .is-collapsed .specs-grid {
        height: 0 !important;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        transition:
            height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.2s ease,
            visibility 0s linear 0.4s;
    }

    .voltride-specs-title {
        font-size: 16px;
    }

    .spec-card {
        padding: 12px 16px;
    }
}

/* Remove any conflicting styles */
.specs-category:not(.is-collapsed) {
    transform: none;
}

.category-toggle {
    background: transparent !important;
    outline: none !important;
}

/* WooCommerce tab specific overrides */
.woocommerce-Tabs-panel .voltride-specs-wrapper {
    margin-top: 0;
}

/* Empty state styling */
.spec-value:empty::before {
    content: "—";
    color: var(--voltride-text-light);
    font-weight: normal;
}

/* Specific value styling overrides */
.spec-value[data-value="Yes"],
.spec-value[data-value="No"] {
    font-weight: normal;
    color: var(--voltride-text);
}