/* Size Guide Button */
.wc-size-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #ddd;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: underline;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    margin-top: 10px;
    transition: all 0.3s ease;
}

/* .wc-size-guide-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    text-decoration: none;
} */

.wc-size-guide-btn:focus {
    outline: none;
    outline-offset: 2px;
}

.wc-size-guide-btn svg {
    flex-shrink: 0;
}

/* Prevent body scroll when modal is open */
body.wc-size-chart-open {
    overflow: hidden;
}

/* Modal Overlay */
.wc-size-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.wc-size-chart-modal.show {
    display: flex;
}

/* Modal Content */
.wc-size-chart-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.wc-size-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wc-size-chart-back {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.wc-size-chart-back:hover {
    background: #f0f0f0;
}

.wc-size-chart-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex: 1;
}

.wc-size-chart-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.wc-size-chart-close:hover {
    background: #f0f0f0;
}

/* Tabs */
.wc-size-chart-tabs {
    display: flex;
    border-bottom: none;
    justify-content: center;
    align-items: center;
    max-width: 132px;
    padding: 3px;
    background-color: #fff;
    margin-inline: auto;
    width: 100%;
    box-shadow: 0px 0px 16px rgba(24, 27, 62, 0.08);
    border-radius: 100px;
}
.wc-size-chart-tab:focus-visible {
    outline: none;
}
.wc-size-chart-tab {
    flex: 1;
    padding: 7px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    text-align: center;
    position: relative;
    transition: all 0.2s;
    font-family: 'Roboto';
    border-radius: 100px;
}
/* 
.wc-size-chart-tab:hover {
    background: rgba(255, 255, 255, 0.5);
} */

.wc-size-chart-tab.active {
    color: #333;
    background: #DDDEE4;
}

.wc-size-chart-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #333;
    opacity: 0;
}

/* Table Container */
.wc-size-chart-table-container {
    padding: 24px;
    overflow: auto;
    max-height: calc(90vh - 140px);
}

/* Table */
.wc-size-chart-table {
    width: 100%;
    font-size: 14px;
    min-width: 600px;
    border: 1px solid #DDDEE4;
    border-radius: 15px;
    border-spacing: 0px;
    overflow: hidden;
}

.wc-size-chart-table th, .wc-size-chart-table td {
    text-align: left;
    border-right: 1px solid #DDDEE4;
    vertical-align: middle;
    border-bottom: 1px solid #DDDEE4;
}

.wc-size-chart-table th {
    padding: 22px 16px;
}
 .wc-size-chart-table td {
    padding: 30px 16px;
}

.wc-size-chart-table th:last-child {
    border-right: none;
}
.wc-size-chart-table tr:last-child td {
    border-bottom: none;
}
.wc-size-chart-table td:last-child {
    border-right: none;
}

.wc-size-chart-table th {
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 5;
}

.wc-size-chart-table th:first-child,
.wc-measurement-label {
    text-align: left;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 6;
    padding-left: 16px;
}

.wc-size-chart-table th:first-child {
    z-index: 7;
    font-weight: 600;
}
.wc-size-chart-table tbody tr:nth-child(odd) {
    background: #eef0f5;
}

/* Size headers styling */
.wc-size-header {
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

/* Loading and error states */
.wc-size-chart-loading,
.wc-size-chart-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.wc-size-chart-error {
    color: #d63638;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-size-chart-modal {
        padding: 10px;
    }
    
    .wc-size-chart-modal-content {
        max-height: 95vh;
        border-radius: 4px;
    }
    
    .wc-size-chart-header {
        padding: 15px 16px;
    }
    
    .wc-size-chart-title {
        font-size: 16px;
    }
    
    .wc-size-chart-table-container {
        padding: 16px;
        max-height: calc(95vh - 120px);
    }
    
    .wc-size-chart-table {
        font-size: 12px;
        min-width: 500px;
    }
    
    .wc-size-chart-table th,
    .wc-size-chart-table td {
        padding: 8px 4px;
    }
    
    .wc-measurement-label {
        padding-left: 12px;
    }
    
    .wc-size-guide-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wc-size-chart-header {
        padding: 12px;
    }
    
    .wc-size-chart-title {
        font-size: 14px;
    }
    
    .wc-size-chart-table-container {
        padding: 12px;
    }
    
    .wc-size-chart-table {
        min-width: 450px;
    }
    
    .wc-size-chart-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Accessibility improvements */
.wc-size-chart-modal:focus {
    outline: none;
}

.wc-size-chart-tab:focus,
.wc-size-chart-close:focus,
.wc-size-chart-back:focus {
    outline: none;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wc-size-chart-table th {
        border-bottom: 3px solid #000;
    }
    
    .wc-size-chart-table td {
        border-bottom: 1px solid #333;
    }
    
    .wc-measurement-label {
        border-right: 2px solid #333;
    }
}

/* Print styles */
@media print {
    .wc-size-chart-modal {
        position: static;
        background: none;
        padding: 0;
    }
    
    .wc-size-chart-modal-content {
        box-shadow: none;
        max-height: none;
        border-radius: 0;
    }
    
    .wc-size-chart-header {
        border-bottom: 2px solid #000;
    }
    
    .wc-size-chart-close,
    .wc-size-chart-back,
    .wc-size-chart-tabs {
        display: none;
    }
}