/**
 * Fix for tab spacing issue - Tabs taking too much horizontal space
 * This CSS ensures tabs only take the space they need for their content
 */

/* Container: Full width tabs in single line */
.wcc-steps-tabs {
    display: flex !important;
    flex-wrap: nowrap !important; /* Force single line */
    gap: 0 !important; /* No gap between tabs */
    overflow-x: auto !important; /* Allow horizontal scroll if needed */
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #ddd !important;
    /* Full width alignment */
    justify-content: stretch !important;
    align-items: stretch !important;
    /* Ensure proper width calculation */
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important; /* Don't exceed container */
    padding: 0 !important; /* No padding */
}

/* Tablet and mobile: Maintain single line with smaller text */
@media (max-width: 1024px) {
    .wcc-step-tab {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 768px) {
    .wcc-step-tab {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
    
    .wcc-step-title {
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .wcc-step-tab {
        padding: 8px 8px !important;
        font-size: 12px !important;
    }
    
    .wcc-step-title {
        font-size: 12px !important;
    }
}

/* Individual tabs: Equal width to fill container */
.wcc-step-tab {
    /* Equal width for all tabs */
    flex: 1 1 0 !important; /* Grow equally to fill space */
    width: auto !important;
    max-width: none !important; /* Remove max width restriction */
    min-width: 0 !important; /* Allow tabs to shrink as needed */
    
    /* Consistent padding */
    padding: 12px 20px !important;
    margin: 0 !important;
    
    /* Text properties */
    white-space: nowrap !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    
    /* Visual styling */
    background-color: #f0f0f0 !important;
    color: #333 !important;
    border-radius: 0 !important; /* Remove rounded corners for seamless connection */
    cursor: pointer !important;
    border-right: 1px solid #ddd !important;
    
    /* Display properties */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Ensure visibility */
    visibility: visible !important;
    opacity: 1 !important;
}

/* Remove border from the last tab */
.wcc-step-tab:last-child {
    border-right: none !important;
}

/* Active tab styling - make it stand out */
.wcc-step-tab.wcc-tab-active {
    background-color: #2271b1 !important;
    color: #fff !important;
    border-bottom: none !important;
    box-shadow: inset 0 -3px 0 #135e96 !important; /* Use shadow instead of border */
}

/* Height is already set in main .wcc-step-tab rule above */

/* Tab container bottom spacing is already set above */

/* Mobile responsive: Allow scrolling if tabs overflow */
@media (max-width: 768px) {
    .wcc-steps-tabs {
        /* Add visual indicator for scrollable area */
        position: relative;
        padding-bottom: 5px;
    }
    
    /* Optional: Add scroll indicators */
    .wcc-steps-tabs::-webkit-scrollbar {
        height: 6px;
    }
    
    .wcc-steps-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .wcc-steps-tabs::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .wcc-steps-tabs::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* High specificity overrides to ensure full width tabs */
body .wcc-customization-container .wcc-steps-tabs {
    justify-content: stretch !important;
    flex-wrap: nowrap !important;
}

body .wcc-customization-container .wcc-step-tab {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* For product pages specifically */
body.single-product .wcc-steps-tabs {
    justify-content: stretch !important;
    flex-wrap: nowrap !important;
}

body.single-product .wcc-step-tab {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* First and last tab border radius */
.wcc-step-tab:first-child {
    border-radius: 5px 0 0 0 !important;
}

.wcc-step-tab:last-child {
    border-radius: 0 5px 0 0 !important;
}