/**
 * Size Chart for WooCommerce - Frontend Styles
 * Design inspired by SSENSE size charts
 */

/* Variables */
:root {
    --scw-primary: #000;
    --scw-secondary: #fff;
    --scw-border: #000;
    --scw-text: #1a1a1a;
    --scw-text-muted: #666;
    --scw-modal-bg: rgb(255 255 255 / 75%);
}

/* Size Guide Button */
.scw-size-guide-btn-wrapper {
    margin: 15px 0;
}

.scw-size-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--scw-primary);
    color: var(--scw-primary);
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.scw-size-guide-btn:hover {
    background: var(--scw-primary);
    color: var(--scw-secondary);
}

.scw-size-guide-btn svg {
    width: 18px;
    height: 18px;
}

/* Size Guide Link (Shortcode) */
.scw-size-guide-wrapper {
    font-size: 11px;
    color: var(--scw-text);
    line-height: 1.5;
}

.scw-model-info-text {
    font-weight: 400;
}

.scw-model-height,
.scw-model-size {
    font-weight: 400;
}

.scw-size-guide-link {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--scw-text);
    text-decoration: underline;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease;
}

.scw-size-guide-link:hover {
    color: var(--scw-text-muted);
}

/* Modal */
.scw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scw-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--scw-modal-bg);
}

.scw-modal-container {
    position: relative;
    background: var(--scw-secondary);
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.scw-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: transform 0.2s ease;
}



.scw-modal-close svg {
    stroke: var(--scw-text);
}

/* Tabs - SSENSE Style */
.scw-tabs {
    display: flex;
    padding: 0 40px;
    gap: 40px;
}

.scw-tab {
    background: transparent;
    border: none;
    padding: 10px 0px 0px 0px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--scw-text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.scw-tab:hover {
    color: var(--scw-text);
}

.scw-tab.active {
    color: var(--scw-text);
}

.scw-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--scw-primary);
}

/* Tab Content */
.scw-tab-content {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.scw-tab-content.active {
    display: block;
}

/* Measurements Layout - SSENSE Style */
.scw-measurements-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Diagram Container */
.scw-diagram-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
}

.scw-diagram {
    position: relative;
    width: 100%;
    max-width: 400px;
}

/* Guide Image Container - SSENSE Style */
.scw-guide-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.scw-product-image {
    width: 100%;
    height: auto;
    display: block;
}

.scw-measurement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: none;
}

/* Measurement Labels on Diagram - SSENSE Style */
.scw-measure-label {
    position: absolute;
    background-color: white;
    color: #000;
    font-size: 12px;
    font-weight: 400;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    z-index: 1;
    transform: translate(-50%, -50%);
}

/* Info Container - Right Side */
.scw-info-container {
    padding: 0;
}

.scw-info-label {
    font-size: 11px;
    color: var(--scw-text);
    margin: 0 0 20px 0;
    font-weight: 400;
}

/* Size Buttons - SSENSE Style */
.scw-size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 20px;
}

.scw-size-btn {
    min-width: 48px;
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--scw-border);
    border-left: none;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.scw-size-btn:first-child {
    border-left: 1px solid var(--scw-border);
}

.scw-size-btn:hover {
    background: #f5f5f5;
}

.scw-size-btn.active {
    background: var(--scw-primary);
    color: var(--scw-secondary);
    border-color: var(--scw-primary);
    border-left: 1px solid var(--scw-primary);
    z-index: 1;
}

/* Unit Toggle - SSENSE Style */
.scw-unit-toggle {
    display: inline-flex;
    margin-bottom: 30px;
}

.scw-unit-btn {
    min-width: 70px;
    height: 40px;
    padding: 0 20px;
    background: transparent;
    border: 1px solid var(--scw-border);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: -1px;
    margin: 0;
}

.scw-unit-btn:first-child {
    margin-left: 0;
}

.scw-unit-btn.active {
    background: var(--scw-primary);
    color: var(--scw-secondary);
    border-color: var(--scw-primary);
}

/* Model Measurements Section - SSENSE Style */
.scw-model-section {
    margin-top: 0px;
}

.scw-model-header-inline {
    margin-bottom: 7px;
    border-bottom:1px solid var(--scw-border);
    padding-bottom:0px;
}

.scw-model-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--scw-text);
    text-transform: uppercase;
}

.scw-model-desc {
    font-size: 11px;
    color: var(--scw-text);
    line-height: 1.5;
    margin:0;
}

.scw-model-desc strong {
    font-weight: 400;
}

.scw-model-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scw-model-stat-row {
    display: flex;
    gap: 20px;
}

.scw-stat-name {
    font-size: 11px;
    color: var(--scw-text);
    min-width: 60px;
}

.scw-stat-val {
    font-size: 11px;
    color: var(--scw-text);
    font-weight: 400;
}

/* Conversion Chart Tab - SSENSE Style */
.scw-conversion-table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
}

.scw-conversion-display-table {
    width: 100%;
    border-collapse: collapse;
}

.scw-conversion-display-table th,
.scw-conversion-display-table td {
    padding: 15px 20px;
    text-align: center;
    font-size: 11px;
    border-bottom: 1px solid var(--scw-border);
}

.scw-conversion-display-table th {
    font-weight: 400;
    color: var(--scw-text);
}

.scw-conversion-display-table thead tr {
    border-bottom: 1px solid var(--scw-border);
}

.scw-system-header {
    text-align: left !important;
    font-weight: 500 !important;
}

.scw-conversion-display-table td {
    color: var(--scw-text);
}

.scw-system-cell {
    text-align: left !important;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 12px !important;
    letter-spacing: 0.5px;
}

.scw-conversion-note {
    font-size: 11px;
    color: var(--scw-text-muted);
    line-height: 1.6;
    margin: 0;
}

.scw-no-data {
    text-align: center;
    padding: 60px 40px;
    color: var(--scw-text-muted);
    font-size: 15px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .scw-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }

    .scw-tabs {
        padding: 0 20px;
        gap: 20px;
    }

    .scw-tab {
        padding: 15px 0;
        font-size: 11px;
    }

    .scw-tab-content {
        padding: 25px 20px;
    }

    .scw-measurements-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .scw-diagram-container {
        order: -1;
    }

    .scw-size-btn {
        min-width: 42px;
        height: 36px;
        font-size: 12px;
    }

    .scw-unit-btn {
        min-width: 60px;
        height: 36px;
        font-size: 11px;
    }

    .scw-conversion-display-table th,
    .scw-conversion-display-table td {
        padding: 10px 8px;
        font-size: 11px;
    }
}

/* Animation */
@keyframes scw-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scw-modal.show .scw-modal-container {
    animation: scw-fadeIn 0.3s ease;
}