/* Style dla tabeli rozmiarów na stronie produktu */
.size-table-button-container {
    margin: 20px 0;
    text-align: left;
}

.size-table-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.size-table-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.size-table-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal z tabelą rozmiarów */
.size-table-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: popupSlideIn 0.3s ease-out;
    border: 1px solid #e9ecef;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    background: white;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}


.popup-close {
    font-size: 24px;
    font-weight: 400;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.popup-close:hover {
    color: #495057;
    background: #f8f9fa;
}

.popup-description {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.popup-description p {
    margin: 0;
    color: #666;
    font-style: italic;
}

.popup-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.size-table-display {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.size-table-display th,
.size-table-display td {
    padding: 16px 20px;
    text-align: left;
    border: none;
    font-weight: 400;
    line-height: 1.4;
}

.size-table-display th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.size-table-display tbody tr {
    background: white;
    transition: background-color 0.2s ease;
}

.size-table-display tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.size-table-display tbody tr:hover {
    background: #e9ecef;
}

.size-table-display td {
    color: #495057;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.size-table-display tbody tr:last-child td {
    border-bottom: none;
}

/* Style dla tabeli generowanej przez edytor */
.size-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.size-table th,
.size-table td {
    padding: 16px 20px;
    text-align: left;
    border: none;
    font-weight: 400;
    line-height: 1.4;
}

.size-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

.size-table tbody tr {
    background: white;
    transition: background-color 0.2s ease;
}

.size-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.size-table tbody tr:hover {
    background: #e9ecef;
}

.size-table td {
    color: #495057;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.size-table tbody tr:last-child td {
    border-bottom: none;
}

.popup-footer {
    padding: 20px 24px 24px 24px;
    background: white;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.popup-close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.popup-close-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsywność */
@media (max-width: 768px) {
    .size-table-popup {
        padding: 10px;
    }
    
    .popup-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .popup-header h3 {
        font-size: 20px;
    }
    
    .popup-body {
        padding: 15px;
    }
    
    .size-table-display th,
    .size-table-display td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .size-table-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .size-table-display {
        font-size: 11px;
    }
    
    .size-table-display th,
    .size-table-display td {
        padding: 6px 8px;
    }
    
    .popup-header {
        padding: 15px;
    }
    
    .popup-body {
        padding: 10px;
    }
    
    .popup-footer {
        padding: 15px;
    }
}

/* Animacje ładowania */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Style dla WooCommerce */
.woocommerce .size-table-button-container {
    margin: 15px 0;
}

.woocommerce div.product .size-table-button-container {
    margin-top: 20px;
}

/* Integracja z motywami */
.theme-twentyseventeen .size-table-button-container,
.theme-twentysixteen .size-table-button-container,
.theme-twentyfifteen .size-table-button-container {
    margin: 20px 0;
    text-align: left;
}

/* Dostępność */
.size-table-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.popup-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .size-table-popup {
        display: none !important;
    }
    
    .size-table-button {
        display: none !important;
    }
}

/* Help text expandable content */
.help-text-link {
    transition: all 0.3s ease;
    cursor: pointer;
}

.help-text-link:hover {
    color: #005a87 !important;
    text-decoration: none !important;
}

.help-expandable-content {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.help-expandable-content h4 {
    margin-top: 0 !important;
    color: #333 !important;
    font-weight: 600 !important;
}

.help-expandable-content ul {
    margin-bottom: 0 !important;
}

.help-expandable-content li {
    margin-bottom: 8px;
}

.help-expandable-content li:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for help content */
@media (max-width: 768px) {
    .help-image-container img {
        max-height: 300px !important;
    }
    
    .help-expandable-content {
        padding: 15px !important;
    }
    
    .help-expandable-content h4 {
        font-size: 16px !important;
    }
    
    .help-expandable-content ul {
        font-size: 14px;
    }
}
