/**
 * Frontend styles for Size Guide
 */

/* Size Guide Link */
.hsg-size-guide-link {
    display: inline-block;
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.hsg-size-guide-link:hover {
    opacity: 1;
}

/* Overlay */
.hsg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hsg-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.hsg-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
}

.hsg-panel.is-open {
    transform: translateX(0);
}

/* Panel Header */
.hsg-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.hsg-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hsg-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #666;
    transition: color 0.2s ease;
}

.hsg-panel-close:hover {
    color: #000;
}

.hsg-panel-close svg {
    display: block;
}

/* Panel Content */
.hsg-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Section Title */
.hsg-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e5e5;
}

/* Measurement Guide */
.hsg-measurement-guide {
    margin-bottom: 2rem;
}

.hsg-measurement-image {
    margin-bottom: 1rem;
}

.hsg-measurement-image img {
    width: 100%;
    height: auto;
    display: block;
}

.hsg-measurement-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #555;
}

.hsg-measurement-description p {
    margin: 0 0 1em 0;
}

.hsg-measurement-description p:last-child {
    margin-bottom: 0;
}

/* Size Table */
.hsg-size-table-section {
    margin-bottom: 2rem;
}

.hsg-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hsg-size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 400px;
}

.hsg-size-table th,
.hsg-size-table td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e5e5;
}

.hsg-size-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.hsg-size-table tbody th {
    background: #fafafa;
    font-weight: 600;
}

.hsg-size-table tbody td {
    background: #fff;
}

.hsg-size-table tbody tr:hover td {
    background: #f9f9f9;
}

.hsg-corner-cell {
    background: #eee !important;
}

/* Inline Guide (for shortcode) */
.hsg-inline-guide {
    margin: 2rem 0;
}

.hsg-inline-guide h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Body class when panel is open */
body.hsg-panel-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .hsg-panel {
        max-width: 100%;
    }
    
    .hsg-panel-content {
        padding: 1rem;
    }
    
    .hsg-size-table {
        font-size: 0.75rem;
    }
    
    .hsg-size-table th,
    .hsg-size-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hsg-panel {
        background: #1a1a1a;
        color: #fff;
    }
    
    .hsg-panel-header {
        border-color: #333;
    }
    
    .hsg-panel-close {
        color: #999;
    }
    
    .hsg-panel-close:hover {
        color: #fff;
    }
    
    .hsg-section-title {
        border-color: #333;
    }
    
    .hsg-measurement-description {
        color: #aaa;
    }
    
    .hsg-size-table th,
    .hsg-size-table td {
        border-color: #333;
    }
    
    .hsg-size-table thead th {
        background: #2a2a2a;
    }
    
    .hsg-size-table tbody th {
        background: #222;
    }
    
    .hsg-size-table tbody td {
        background: #1a1a1a;
    }
    
    .hsg-size-table tbody tr:hover td {
        background: #222;
    }
    
    .hsg-corner-cell {
        background: #333 !important;
    }
}
