/**
 * HockeySweaters Product Customizer - Frontend Styles v2.0
 *
 * Stepped customizer with font previews, method toggles, and logo selection.
 * Google Fonts are loaded via wp_enqueue_style in the plugin.
 */

/* ─── Wrapper ─── */
.hs-customizer-wrap {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
}

.hs-customizer-wrap h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #009ee0;
    color: #081F2C;
}

/* ─── Steps ─── */
.hs-customizer-step {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.hs-customizer-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.hs-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.hs-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #009ee0;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.hs-step-header label {
    font-weight: 700;
    font-size: 15px;
    color: #081F2C;
    margin: 0;
}

/* ─── Logo options (Stap 1) ─── */
.hs-logo-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.hs-logo-option {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    position: relative;
}

.hs-logo-option:hover {
    border-color: #009ee0;
    box-shadow: 0 2px 8px rgba(0, 158, 224, 0.15);
}

.hs-logo-option.selected {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.04);
    box-shadow: 0 0 0 1px #009ee0;
}

/* Logo image wrapper with color overlay. */
.hs-logo-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    overflow: hidden;
    border-radius: 3px;
}

.hs-logo-option img {
    max-width: 100%;
    height: 60px;
    object-fit: contain;
    border-radius: 3px;
}

.hs-logo-color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    mix-blend-mode: color;
    pointer-events: none;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.hs-logo-color-overlay.active {
    opacity: 1;
}

.hs-logo-icon {
    font-size: 26px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    line-height: 1;
}

.hs-logo-option.selected .hs-logo-icon {
    color: #009ee0;
}

.hs-logo-option .label {
    font-size: 12px;
    margin-top: 6px;
    color: #555;
    font-weight: 500;
}

.hs-logo-option .hs-surcharge-badge {
    position: absolute;
    top: -6px;
    right: -6px;
}

/* ─── Inline SVG logos (verborgen databron voor overlay) ─── */
/* De inline SVG is niet zichtbaar; de <img> dient als thumbnail.
   De SVG wordt alleen door print-overlay.js gekloond naar de productafbeelding. */

/* Uploaded SVG preview in the dropzone. */
.hs-uploaded-svg svg {
    max-width: 120px;
    max-height: 80px;
}

/* ─── Upload area ─── */
.hs-upload-area {
    margin-top: 12px;
}

.hs-logo-upload {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fff;
}

.hs-logo-upload:hover,
.hs-logo-upload.dragover {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.03);
}

.hs-logo-upload p {
    margin: 4px 0;
    color: #666;
    font-size: 13px;
}

.hs-logo-upload .preview {
    margin: 12px auto 0;
}

.hs-logo-upload .preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.hs-logo-upload.has-file {
    border-style: solid;
    border-color: #009ee0;
}

/* ─── Method selector (bedrukken / borduren) ─── */
.hs-method-row {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.hs-method-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.hs-method-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hs-method-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}

.hs-method-option:hover {
    border-color: #009ee0;
}

.hs-method-option input[type="radio"] {
    margin: 0;
    accent-color: #009ee0;
}

.hs-method-option:has(input:checked) {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.05);
}

.hs-method-option.hs-method-disabled {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
}

.hs-method-option.hs-method-disabled::after {
    content: 'Niet beschikbaar bij eigen logo';
    display: block;
    font-size: 10px;
    color: #999;
    position: absolute;
    bottom: -16px;
    left: 0;
    white-space: nowrap;
}

/* ─── Toggle options (Stap 2: name/number) ─── */
.hs-option-toggle {
    margin-bottom: 12px;
}

.hs-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s, background 0.2s;
}

.hs-toggle-label:hover {
    border-color: #009ee0;
}

.hs-toggle-label:has(input:checked) {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.04);
}

.hs-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #009ee0;
    flex-shrink: 0;
}

.hs-toggle-content {
    padding: 12px 0 0 0;
}

.hs-toggle-content input[type="text"],
.hs-toggle-content input[type="number"] {
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.hs-toggle-content input:focus {
    border-color: #009ee0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 158, 224, 0.15);
}

/* ─── Font grid (Stap 3) ─── */
.hs-font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.hs-font-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 10px 10px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    overflow: hidden;
}

.hs-font-card:hover {
    border-color: #009ee0;
    box-shadow: 0 2px 8px rgba(0, 158, 224, 0.15);
}

.hs-font-card.selected {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.04);
    box-shadow: 0 0 0 1px #009ee0;
}

.hs-font-card-preview {
    display: block;
    font-size: 20px;
    line-height: 1.3;
    min-height: 34px;
    color: #081F2C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-font-card-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Live preview ─── */
.hs-live-preview {
    margin-top: 16px;
    padding: 16px 20px;
    background: #081F2C;
    border-radius: 8px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.hs-preview-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hs-preview-name {
    font-size: 28px;
    color: #FFFFFF;
    letter-spacing: 4px;
    line-height: 1.2;
    word-break: break-all;
}

.hs-preview-number {
    font-size: 64px;
    color: #FFFFFF;
    letter-spacing: 2px;
    line-height: 1.1;
    margin-top: 4px;
}

/* ─── Color swatches (Stap 4) ─── */
.hs-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 12px 8px;
}

.hs-color-swatch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 4px 6px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.hs-color-swatch-wrap:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #e0e0e0;
}

.hs-color-swatch-wrap.hs-selected {
    border-color: #009ee0;
    background: rgba(0, 158, 224, 0.04);
}

.hs-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.hs-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hs-color-swatch.active {
    border-color: #009ee0;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #009ee0;
}

/* Color name below swatch. */
.hs-color-name {
    display: block;
    font-size: 10px;
    color: #555;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
    width: 100%;
    max-width: 72px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hs-color-swatch-wrap.hs-neon .hs-color-name {
    color: #BA0C2F;
    font-weight: 600;
}

/* Neon surcharge badge on swatch. */
.hs-neon-badge {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: #BA0C2F;
    text-align: center;
    white-space: nowrap;
}

/* Neon notice below swatches. */
.hs-neon-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 4px;
    font-size: 13px;
    color: #E65100;
    font-weight: 500;
}

/* ─── Surcharge badge ─── */
.hs-surcharge-badge {
    display: inline-block;
    background: #BA0C2F;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .hs-customizer-wrap {
        padding: 16px;
    }

    .hs-logo-options {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .hs-font-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hs-font-card-preview {
        font-size: 16px;
    }

    .hs-preview-name {
        font-size: 20px;
    }

    .hs-preview-number {
        font-size: 44px;
    }

    .hs-color-swatches {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 8px 4px;
    }

    .hs-color-swatch-wrap {
        padding: 6px 2px 4px;
    }

    .hs-color-swatch {
        width: 34px;
        height: 34px;
    }

    .hs-color-name {
        font-size: 9px;
        max-width: 72px;
    }

    .hs-method-options {
        flex-direction: column;
    }
}

/* ─── Winkelwagen: personalisatie-overzicht ─── */
.hs-cart-customization {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    padding: 8px 0 4px;
}

.hs-cart-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.hs-cart-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.hs-cart-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #081F2C;
    margin-bottom: 2px;
}

.hs-cart-line {
    display: block;
    color: #444;
}

.hs-cart-line strong {
    color: #111;
}

.hs-cart-surcharge {
    color: #BA0C2F;
    font-size: 11px;
    font-weight: 600;
}

.hs-cart-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid transparent;
    vertical-align: middle;
    margin-right: 4px;
}

.hs-cart-total {
    padding-top: 4px;
    border-top: 1px solid #ddd;
    font-size: 12px;
    color: #333;
}

.hs-cart-edit-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #009ee0;
    text-decoration: underline;
    font-weight: 500;
}

.hs-cart-edit-link:hover {
    color: #007bb5;
}
