/**
 * GPSR for WooCommerce - Frontend Styles
 *
 * Minimal, non-opinionated styles that complement any WooCommerce theme.
 * All rules are scoped to plugin-specific class names to avoid bleed.
 */

/* ==========================================================================
   Product Safety Info Tab
   ========================================================================== */

.gpsr-product-safety-info {
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* Group (Manufacturer / EU Representative / Importer / Product Information)
   ========================================================================== */

.gpsr-group {
    margin-bottom: 2em;
}

.gpsr-group:last-of-type {
    margin-bottom: 0;
}

.gpsr-group__heading {
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
    opacity: 0.65;
    margin: 0 0 0.75em;
    padding: 0 0 0.4em;
    border-bottom: 1px solid currentColor;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* Field list (definition list)
   ========================================================================== */

.gpsr-field-list {
    margin: 0;
    padding: 0;
}

.gpsr-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gpsr-field:last-child {
    border-bottom: none;
}

.gpsr-field-label {
    flex: 0 0 180px;
    min-width: 0;
    font-weight: 600;
    color: inherit;
    opacity: 0.7;
    font-size: 0.9em;
    padding-top: 0.1em;
}

.gpsr-field-value {
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
    font-weight: 400;
    font-size: 0.9em;
    word-break: break-word;
}

.gpsr-field-value a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gpsr-field-value a:hover,
.gpsr-field-value a:focus {
    opacity: 0.75;
}

/* Checkbox checkmark
   ========================================================================== */

.gpsr-checkmark {
    color: #4caf50;
    font-style: normal;
    margin-right: 0.2em;
}

/* Safety information (wysiwyg) - basic rhythm
   ========================================================================== */

.gpsr-field-value p:first-child {
    margin-top: 0;
}

.gpsr-field-value p:last-child {
    margin-bottom: 0;
}

/* CE mark indicator
   ========================================================================== */

.gpsr-ce-mark {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-top: 1.5em;
    padding: 0.75em 1em;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    border-left: 3px solid #1976d2;
}

.gpsr-ce-mark__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.2em;
    height: 2.2em;
    border: 2px solid #1976d2;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75em;
    letter-spacing: 0.02em;
    color: #1976d2;
    line-height: 1;
}

.gpsr-ce-mark__label {
    font-size: 0.85em;
    color: inherit;
    opacity: 0.75;
}

/* ==========================================================================
   Compliance Badge
   ========================================================================== */

.gpsr-compliance-badge-wrapper {
    margin: 0.6em 0;
    line-height: 1;
}

.gpsr-compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.3em 0.7em;
    background-color: #4caf50;
    color: #fff;
    border-radius: 100px;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.gpsr-compliance-badge__icon {
    flex-shrink: 0;
    width: 0.9em;
    height: 0.9em;
    vertical-align: middle;
}

.gpsr-compliance-badge__label {
    vertical-align: middle;
}

/* ==========================================================================
   Safety Documents list
   ========================================================================== */

.gpsr-group--documents .gpsr-documents-list-frontend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gpsr-document-link {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.9em;
}

.gpsr-document-link:last-child {
    border-bottom: none;
}

.gpsr-document-type-label {
    font-weight: 600;
    opacity: 0.7;
    margin-right: 6px;
}

.gpsr-document-link a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gpsr-document-link a:hover,
.gpsr-document-link a:focus {
    opacity: 0.75;
}

/* ==========================================================================
   Responsive - stack labels above values on small screens
   ========================================================================== */

@media (max-width: 480px) {
    .gpsr-field {
        flex-direction: column;
        gap: 0.15em;
    }

    .gpsr-field-label {
        flex: none;
        width: 100%;
        opacity: 0.6;
    }

    .gpsr-field-value {
        flex: none;
        width: 100%;
    }

    .gpsr-ce-mark {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
}
