/**
 * Size Charts Frontend Styles
 *
 * @package PrintShopStudio
 */

/* Size Chart Link */
.pss-size-chart-link {
    margin: 15px 0;
}

.pss-open-size-chart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid #2271b1;
    border-radius: 4px;
    transition: all 0.2s;
}

.pss-open-size-chart:hover {
    background: #2271b1;
    color: #fff;
}

.pss-open-size-chart .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal */
.pss-size-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pss-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.pss-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 95%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pss-modal-fade-in 0.3s ease-out;
}

@keyframes pss-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pss-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 1;
}

.pss-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.pss-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

/* Size Chart Content */
.pss-size-chart-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #1d2327;
}

.pss-diagram {
    text-align: center;
    margin-bottom: 25px;
}

.pss-diagram img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* Size Chart Table */
.pss-chart-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.pss-size-chart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pss-size-chart-table th,
.pss-size-chart-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e2e4e7;
}

.pss-size-chart-table thead th {
    background: #1d2327;
    color: #fff;
    font-weight: 600;
}

.pss-size-chart-table tbody th {
    background: #f8f9fa;
    text-align: left;
    font-weight: 600;
}

.pss-size-chart-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.pss-size-chart-table tbody tr:hover {
    background: #f0f6fc;
}

/* Measurement Note */
.pss-measurement-note {
    font-size: 13px;
    color: #666;
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #2271b1;
}

/* Loading State */
.pss-modal-body.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.pss-modal-body.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: pss-spin 0.8s linear infinite;
}

@keyframes pss-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .pss-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .pss-modal-body {
        padding: 20px;
        max-height: calc(100vh - 50px);
    }

    .pss-size-chart-content h2 {
        font-size: 20px;
        padding-right: 40px;
    }

    .pss-size-chart-table th,
    .pss-size-chart-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .pss-diagram img {
        max-height: 200px;
    }
}

