/**
 * Polski frontend styles.
 *
 * Minimal footprint - only structural styles.
 * Colors inherit from the theme. No render-blocking impact.
 *
 * Presentation tokens live on :root so themes can override them without
 * editing this file. Logical properties (margin-block, etc.) keep spacing
 * correct in RTL contexts. No computed values or strings live here -
 * markup and amounts are produced server-side; this file is look-and-feel only.
 */

:root {
    --polski-fs-meta: clamp(0.78em, 0.74em + 0.2vw, 0.85em);
    --polski-color-meta: #666;
    --polski-color-meta-soft: #888;
    --polski-color-meta-strong: #555;
    --polski-color-exempt: #b36b00;
    --polski-color-link: #666;
    --polski-color-link-hover: #333;
    --polski-surface-soft: #f8f8f8;
    --polski-surface-card: #fafafa;
    --polski-line-soft: #eee;
    --polski-radius-xs: 3px;
    --polski-radius-sm: 4px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --polski-color-meta: #b8bbc4;
        --polski-color-meta-soft: #9aa0aa;
        --polski-color-meta-strong: #c4c8d0;
        --polski-color-exempt: #e0a040;
        --polski-color-link: #b8bbc4;
        --polski-color-link-hover: #eceae7;
        --polski-surface-soft: #26282e;
        --polski-surface-card: #1e1f24;
        --polski-line-soft: #3a3d45;
    }
}

/* === Product display elements === */

.polski-unit-price {
    font-size: var(--polski-fs-meta);
    color: var(--polski-color-meta);
    margin-block: 4px;
}

.polski-omnibus-price {
    font-size: var(--polski-fs-meta);
    color: var(--polski-color-meta-soft);
    margin-block: 4px;
    padding: 4px 8px;
    background: var(--polski-surface-soft);
    border-radius: var(--polski-radius-xs);
}

.polski-delivery-time {
    font-size: var(--polski-fs-meta);
    color: var(--polski-color-meta-strong);
    margin-block: 6px;
}

.polski-delivery-time__text::before {
    content: "\1F4E6"; /* package emoji */
    margin-inline-end: 4px;
}

.polski-tax-info {
    font-size: var(--polski-fs-meta);
    color: var(--polski-color-meta-soft);
    display: block;
    margin-block: 2px;
}

.polski-tax-info--exempt {
    color: var(--polski-color-exempt);
    font-style: italic;
}

.polski-shipping-notice {
    font-size: var(--polski-fs-meta);
    display: block;
    margin-block: 2px;
}

.polski-shipping-notice a {
    color: var(--polski-color-link);
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: color 0.15s ease;
}

.polski-shipping-notice a:hover {
    color: var(--polski-color-link-hover);
}

@media (prefers-reduced-motion: reduce) {
    .polski-shipping-notice a {
        transition: none;
    }
}

/* === Manufacturer / GPSR === */

.polski-manufacturer,
.polski-gpsr,
.polski-safety-docs,
.polski-safety-instructions,
.polski-power-supply,
.polski-defect-description {
    font-size: var(--polski-fs-meta);
    color: var(--polski-color-meta-strong);
    margin-block: 4px;
}

.polski-manufacturer__label,
.polski-gpsr__label,
.polski-safety-docs__label,
.polski-safety-instructions__label,
.polski-power-supply__label,
.polski-defect-description__label {
    font-weight: 600;
}

.polski-safety-docs ul {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}

.polski-safety-docs ul li {
    padding: 2px 0;
}

.polski-safety-docs ul li a::before {
    content: "\1F4CE"; /* paperclip */
    margin-inline-end: 4px;
}

.polski-safety {
    margin-block: 12px;
    padding: 10px;
    background: var(--polski-surface-card);
    border: 1px solid var(--polski-line-soft);
    border-radius: var(--polski-radius-sm);
}

/* === Food module === */

.polski-food-info {
    margin-block: 12px;
    padding: 10px;
    background: var(--polski-surface-card);
    border: 1px solid var(--polski-line-soft);
    border-radius: var(--polski-radius-sm);
}

.polski-ingredients,
.polski-allergens,
.polski-alcohol,
.polski-origin,
.polski-distributor,
.polski-net-filling {
    font-size: 0.85em;
    color: #555;
    margin: 4px 0;
}

.polski-ingredients__label,
.polski-allergens__label,
.polski-alcohol__label,
.polski-origin__label,
.polski-distributor__label,
.polski-net-filling__label {
    font-weight: 600;
}

.polski-nutrients__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin: 8px 0;
}

.polski-nutrients__table caption {
    text-align: left;
    font-weight: 600;
    padding: 4px 0;
    font-size: 0.95em;
}

.polski-nutrients__table th,
.polski-nutrients__table td {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.polski-nutrients__table th {
    font-weight: 600;
    background: #f5f5f5;
}

.polski-nutri-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    font-size: 0.85em;
}

.polski-nutri-score__grade {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
}

.polski-nutri-score--a .polski-nutri-score__grade { background: #038141; }
.polski-nutri-score--b .polski-nutri-score__grade { background: #85bb2f; }
.polski-nutri-score--c .polski-nutri-score__grade { background: #fecb02; color: #333; }
.polski-nutri-score--d .polski-nutri-score__grade { background: #ee8100; }
.polski-nutri-score--e .polski-nutri-score__grade { background: #e63e11; }

/* === Checkout === */

.polski-legal-checkboxes {
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid #eee;
}

.polski-checkbox {
    margin-bottom: 8px;
}

.polski-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.4;
    cursor: pointer;
}

.polski-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.polski-checkbox .required {
    color: #c00;
    font-weight: 700;
}

.polski-checkbox--error {
    background: #fff5f5;
    border-left: 3px solid #c00;
    padding-left: 8px;
    border-radius: 3px;
}

.polski-checkbox--error label {
    color: #900;
}

/* === Withdrawal form === */

.polski-withdrawal-form {
    max-width: 700px;
    margin: 20px 0;
}

.polski-withdrawal-form__info {
    margin-bottom: 10px;
}

.polski-withdrawal-form__notice {
    padding: 10px;
    background: #fff8e5;
    border-left: 4px solid #ffc107;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.polski-withdrawal-form__items {
    margin-bottom: 16px;
}

.polski-withdrawal-form__item--exempt {
    opacity: 0.6;
}

/* === Dispute resolution === */

.polski-dispute-resolution {
    font-size: 0.8em;
    color: #888;
    margin: 10px 0;
}

/* === Pay now (contract helper) === */

.polski-pay-now {
    margin: 20px 0;
    text-align: center;
}

/* === Invoice gateway === */

.polski-invoice-instructions {
    margin: 16px 0;
}

.polski-invoice-instructions h3 {
    margin-bottom: 8px;
}

/* === Small business notice === */

.polski-small-business-notice {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

/* === Loop/archive page === */

.products .polski-unit-price,
.products .polski-omnibus-price {
    font-size: 0.75em;
}
