/* tectyl-downloads.css */

/* ── Access form ──────────────────────────────────────────────────────────── */
.tectyl-access-form {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 32px;
}

.tectyl-access-form form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tectyl-access-form input[type="email"] {
    flex: 1;
    min-width: 240px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.tectyl-message { margin-top: 10px; font-size: 14px; }
.tectyl-message--success { color: #2e7d32; }
.tectyl-message--error   { color: #c62828; }

/* ── Language filter ──────────────────────────────────────────────────────── */
.tectyl-language-filter {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tectyl-language-filter select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* ── SDS market (country) filter ───────────────────────────────────────────── */
.tectyl-country-filter {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tectyl-country-filter select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 220px;
}

/* ── Category accordion ───────────────────────────────────────────────────── */
.tectyl-category {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.tectyl-category__toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    transition: background 0.15s;
}

.tectyl-category__toggle:hover { background: #f0f0f0; }

.tectyl-category__toggle svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tectyl-category__toggle[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.tectyl-category__products { padding: 4px 0; }

/* ── Product rows ─────────────────────────────────────────────────────────── */
.tectyl-product {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tectyl-product:last-child { border-bottom: none; }

.tectyl-product__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tectyl-product__name {
    font-weight: 500;
    font-size: 15px;
    flex: 1;
    min-width: 160px;
    padding-top: 2px;
}

.tectyl-product__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Locale badges ────────────────────────────────────────────────────────── */
.tectyl-locale-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    text-decoration: none;
    color: inherit;
    line-height: 1.5;
    user-select: none;
}

.tectyl-locale-badge input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.tectyl-locale-badge--ds {
    background: #f0f7ff;
    border-color: #90c0f0;
    color: #1565c0;
    text-decoration: none;
}

.tectyl-locale-badge--ds:hover { background: #e0efff; }

.tectyl-locale-badge--ds small {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ── SDS download links (revealed after token) ────────────────────────────── */
.tectyl-product__sds-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Hidden state — JS removes this class when token is available */
.tectyl-locked { display: none !important; }

/* ── Download selected bar ────────────────────────────────────────────────── */
.tectyl-download-selected {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.tectyl-selected-count {
    color: #646970;
    font-size: 13px;
}

/* ── Product page — file service downloads (AG / DS) ─────────────────────── */
.tectyl-product-downloads {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tectyl-product-download__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
}

/* Theme .download-btn uses display:flex (block-level), which stretches to full width and can stack/wrap with the preview. */
.tectyl-product-download__row .download-btn {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

.tectyl-product-download-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 0;
    color: inherit;
    text-decoration: none;
}

.tectyl-product-download-preview:hover {
    color: var(--accent, #e12610);
}

/* ── Product page — inline SDS section ───────────────────────────────────── */

.tectyl-sds-section { margin-top: 16px; }

.tectyl-sds-note {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.tectyl-token-form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.tectyl-token-form-inline input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.tectyl-sds-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
