/**
 * Any Size Steel — Product Configurator Styles v1.6.7
 *
 * Clean, modern design. Complements Woodmart theme.
 * All classes prefixed with .asc- to avoid conflicts.
 */

/* ─── Container ──────────────────────────────────────────────── */

.asc-configurator {
    margin: 1.5rem 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.asc-disabled-notice {
    padding: 1rem 1.25rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ─── Product Info Bar ───────────────────────────────────────── */

.asc-product-info {
    display: flex;
    gap: 1.25rem;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.asc-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    color: #374151;
}

/* ─── Separator ─────────────────────────────────────────────── */

.asc-separator {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.25rem 0;
}

/* ─── Field Groups ───────────────────────────────────────────── */

.asc-field-group {
    margin-bottom: 1.25rem;
}

.asc-field-group > label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.asc-required {
    color: #ef4444;
    font-weight: 400;
    text-transform: none;
}

/* ─── Tooltip ────────────────────────────────────────────────── */

.asc-tooltip {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    margin-left: 5px !important;
    border-radius: 50% !important;
    background: #d1d5db !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: help !important;
    vertical-align: middle !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
}

.asc-tooltip:hover {
    background: #f97316 !important;
}

.asc-tooltip .asc-tooltip__text {
    display: none !important;
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 240px !important;
    padding: 10px 12px !important;
    background: #1f2937 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    border-radius: 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    white-space: normal !important;
}

.asc-tooltip .asc-tooltip__text::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 5px solid transparent !important;
    border-top-color: #1f2937 !important;
}

.asc-tooltip:hover .asc-tooltip__text {
    display: block !important;
}

/* ─── Side-by-Side Field Row ─────────────────────────────────── */

.asc-field-row {
    display: flex;
    gap: 0.75rem;
}

.asc-field-half {
    flex: 1;
    min-width: 0;
}

/* ─── Inputs ─────────────────────────────────────────────────── */

.asc-input-wrap {
    position: relative;
}

.asc-input {
    width: 100%;
    padding: 0.8125rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box;
}

.asc-input:hover {
    border-color: #9ca3af;
}

.asc-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.08);
}

.asc-input--small {
    width: 4.5rem;
    text-align: center;
}

.asc-input--select {
    padding-right: 2.75rem;
    min-height: 3rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.asc-input--readonly {
    background: #f9fafb;
    color: #6b7280;
    cursor: default;
    border-color: #e5e7eb;
}

.asc-input--readonly:hover {
    border-color: #e5e7eb;
}

.asc-input-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

/* Remove spinner for number inputs */
.asc-input[type="number"]::-webkit-outer-spin-button,
.asc-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Toggle Switches ────────────────────────────────────────── */

.asc-toggle-group {
    margin-bottom: 1.25rem;
}

/* Inline toggles row (primed + galvanised side by side) */
.asc-toggles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.asc-toggles-row .asc-toggle-group {
    margin-bottom: 0;
}

.asc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
    padding: 0.375rem 0;
}

.asc-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.asc-toggle-switch {
    position: relative;
    width: 2.5rem;
    height: 1.375rem;
    background: #d1d5db;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.asc-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.125rem;
    height: 1.125rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.asc-toggle-input:checked + .asc-toggle-switch {
    background: #f97316;
}

.asc-toggle-input:checked + .asc-toggle-switch::after {
    transform: translateX(1.125rem);
}

.asc-toggle-input:focus-visible + .asc-toggle-switch {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.asc-toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.asc-toggle-content {
    margin-top: 0.625rem;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* ─── Radio Buttons ──────────────────────────────────────────── */

.asc-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.asc-radio-group--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
}

.asc-radio-group--visual {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.asc-radio-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
    background: #fff;
    min-width: 90px;
}

.asc-radio-visual:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.asc-radio-visual:has(input:checked) {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 1px #f97316;
}

.asc-radio-visual input[type="radio"] {
    display: none;
}

.asc-radio-visual__diagram {
    display: flex;
    align-items: center;
    justify-content: center;
}

.asc-radio-visual__label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

.asc-radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    font-size: 0.8125rem;
    user-select: none;
    background: #fff;
}

.asc-radio-label:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.asc-radio-label:has(input:checked) {
    border-color: #f97316;
    background: #fff7ed;
    font-weight: 600;
}

.asc-radio-label input[type="radio"] {
    accent-color: #f97316;
    margin: 0;
    width: 14px;
    height: 14px;
}

.asc-radio-text {
    font-size: 0.8125rem;
    color: #374151;
}

/* ─── Checkboxes ─────────────────────────────────────────────── */

.asc-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.asc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
    background: #fff;
}

.asc-checkbox-label:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.asc-checkbox-label:has(input:checked) {
    border-color: #f97316;
    background: #fff7ed;
}

.asc-checkbox-label input[type="checkbox"] {
    accent-color: #f97316;
    margin: 0;
}

.asc-checkbox-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

/* ─── Flange Diagram ─────────────────────────────────────────── */

.asc-flange-diagram-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.875rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 0.375rem;
}

.asc-flange-svg {
    width: 120px;
    height: auto;
    flex-shrink: 0;
}

.asc-flange-checkboxes {
    flex-direction: column;
    gap: 0.375rem;
}

.asc-flange-checkboxes .asc-checkbox-label {
    min-width: 3rem;
    justify-content: center;
}

/* ─── Plate Sections (Posts) ─────────────────────────────────── */

.asc-plate-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.asc-section-title {
    margin: 0 0 0.875rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.asc-plate-details {
    margin-top: 0.875rem;
}

/* ─── Price Display ──────────────────────────────────────────── */

.asc-price-display {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #f97316;
    border-radius: 4px 8px 8px 4px;
}

.asc-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.asc-price-label {
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.asc-price-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: -0.02em;
    transition: color 0.2s ease, opacity 0.15s ease;
    line-height: 1;
}

.asc-price-value--has-price {
    color: #1e293b;
}

.asc-price-value.asc-loading {
    opacity: 0.4;
}

.asc-price-vat {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.asc-weight-row {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    margin-top: 0.125rem;
}

.asc-weight-label {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.asc-weight-value {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 700;
}

/* ─── Display Values ─────────────────────────────────────────── */

.asc-display-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4375rem 0.75rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    min-width: 2.25rem;
}

/* ─── Validation ─────────────────────────────────────────────── */

.asc-validation {
    margin-bottom: 0.75rem;
}

.asc-validation-error {
    margin: 0 0 0.25rem 0;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 500;
}

.asc-clamp-warning {
    display: block;
    margin-top: 0.25rem;
    color: #b45309;
    font-size: 0.8125rem;
    font-weight: 500;
    animation: asc-fade-in 0.15s ease-out;
}

@keyframes asc-fade-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Add to Cart Button Override ────────────────────────────── */

.asc-btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ─── From Price (Archive Pages) ─────────────────────────────── */

.asc-from-price {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (min-width: 768px) {
    .asc-radio-group--grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .asc-field-row {
        flex-direction: column;
        gap: 0;
    }

    .asc-flange-diagram-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .asc-flange-svg {
        width: 100%;
        max-width: 160px;
        margin: 0 auto;
    }

    .asc-flange-checkboxes {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .asc-product-info {
        flex-direction: column;
        gap: 0.125rem;
    }

    .asc-radio-group {
        flex-direction: column;
    }

    .asc-radio-group--grid {
        grid-template-columns: 1fr 1fr;
    }

    .asc-price-value {
        font-size: 1.5rem;
    }

    .asc-toggles-row {
        flex-direction: column;
        gap: 0.375rem;
    }

    .asc-plate-section {
        padding: 0.75rem;
    }
}

/* ─── Description Card (below product summary) ──────────────── */

.asc-description-card {
    max-width: 1200px;
    margin: 2.5rem auto 0;
    padding: 24px 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.asc-description-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c8802a;
    color: #1a2744;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.asc-description-card__content {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #4b5563;
}

.asc-description-card__content p {
    margin: 0 0 0.75rem;
}

.asc-description-card__content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .asc-description-card {
        margin: 1.5rem 15px 0;
        padding: 16px 18px;
    }
}
