/* =====================================================
   Frens Forever Welded — Frontend
   Palette:
     cream:      #f5ede1
     ink:        #383838
     accent:     #da962f
     subtle:     #ffffff9e
   ===================================================== */

.ffw-configurator {
    margin: 24px 0;
    font-family: 'Montserrat', inherit;
    color: #222;
}

.ffw-configurator * {
    box-sizing: border-box;
}

.ffw-configurator .ffw-group {
    margin-bottom: 24px;
}

.ffw-configurator .ffw-group.ffw-hidden {
    display: none;
}

/* Kill default browser focus rings (pink/blue/orange) on all configurator buttons,
   inputs, and the range slider. We add explicit focus-visible styles below. */
.ffw-configurator button,
.ffw-configurator input,
.ffw-configurator [role="button"] {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.ffw-configurator button:focus,
.ffw-configurator button:active,
.ffw-configurator input:focus {
    outline: none;
    box-shadow: none;
}

/* Subtle keyboard-only focus ring (only on actual keyboard nav, not click) */
.ffw-configurator button:focus-visible {
    outline: 2px solid rgba(218, 150, 47, 0.5);
    outline-offset: 2px;
}

/* ---------- Group label ---------- */
.ffw-group-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
    color: #383838;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.ffw-group-label .ffw-required {
    color: #c00;
}

.ffw-group-selected {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #888;
    font-size: 13px;
}

/* ---------- Slider container ---------- */
.ffw-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.ffw-track-wrap {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.ffw-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.ffw-track::-webkit-scrollbar { display: none; }

/* ---------- Arrows (borderless) ---------- */
button.ffw-arrow.ffw-arrow-prev,
button.ffw-arrow.ffw-arrow-next {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #383838;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
}

button.ffw-arrow:hover:not(.is-disabled) {
    color: #da962f;
}

button.ffw-arrow.is-disabled {
    opacity: 0.25;
    cursor: default;
}

button.ffw-arrow.is-hidden {
    visibility: hidden;
}

/* ---------- Text capsule options ---------- */
button.ffw-option.ffw-option-text {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid #35343426;
    background-color: #f5ede1;
    color: #000000;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
}

button.ffw-option.ffw-option-text:hover:not(.is-sold-out):not(.is-selected) {
    border-color: rgba(218, 150, 47, 0.6);
}

button.ffw-option.ffw-option-text.is-selected {
    background-color: #da962f7d;
    color: #000000;
    border-color: rgba(218, 150, 47, 0.8);
}

.ffw-option-text em {
    font-style: normal;
    margin-left: 6px;
    opacity: 0.65;
    font-size: 12px;
}

button.ffw-option.ffw-option-text.is-sold-out {
    cursor: not-allowed;
    color: #aaa;
    text-decoration: line-through;
    background-color: #efe9df;
    border-color: rgba(0, 0, 0, 0.08);
}

.ffw-option-text.is-sold-out .ffw-text-sold {
    text-decoration: none;
    margin-left: 6px;
    color: #c00;
    font-size: 11px;
}

/* ---------- Image swatch options ---------- */
button.ffw-option.ffw-option-image {
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #ffffff9e;
    border-radius: 500px;
    background: transparent;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: border-color 0.15s, transform 0.15s;
}

.ffw-option-img-wrap {
    display: block;
    width: 56px;
    height: 56px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
}

.ffw-option-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

button.ffw-option.ffw-option-image:hover:not(.is-sold-out):not(.is-selected) {
    background-color: #ffffff00 !important;
    border: 1px solid #da962f9e;
}

/* IMPORTANT: matches the specificity of the base + hover rules above
   so it wins on first paint (when defaults are pre-selected) without
   needing !important. */
button.ffw-option.ffw-option-image.is-selected {
    border: 2px solid #da962f;
    padding: 0;
}

/* Sold out image */
button.ffw-option.ffw-option-image.is-sold-out {
    cursor: not-allowed;
}

.ffw-option-image.is-sold-out img {
    opacity: 0.4;
}

.ffw-soldout-slash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ffw-soldout-slash::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 2px;
    background: #c00;
    transform: rotate(-45deg);
    transform-origin: center;
}

/* ---------- Tooltip on image hover ---------- */
/* Uses position: fixed so it escapes the slider's overflow:hidden clip.
   JS positions it relative to the hovered swatch. */
.ffw-option-tooltip {
    position: fixed;
    background: #383838;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 99999;
    line-height: 1.4;
    font-family: inherit;
    /* Off-screen until JS positions it */
    top: -9999px;
    left: -9999px;
}

.ffw-option-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #383838;
}

.ffw-option-tooltip.ffw-tip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #383838;
}

.ffw-tooltip-name {
    display: block;
    font-weight: 600;
}

.ffw-option-tooltip em {
    font-style: normal;
    opacity: 0.85;
    font-size: 11px;
}

.ffw-option-tooltip .ffw-tooltip-sold {
    color: #ff8585;
    opacity: 1;
}

.ffw-option-tooltip.is-visible {
    opacity: 1;
}

/* ---------- Size picker ---------- */
.ffw-size-picker {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f5ede1;
    border-radius: 8px;
}

.ffw-size-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #383838;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ffw-size-value {
    color: #da962f;
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.ffw-size-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

button.ffw-size-step-btn.ffw-size-down,
button.ffw-size-step-btn.ffw-size-up {
    flex-shrink: 0;
    padding: 6px;
    border: none;
    color: #383838;
    background-color: #d0d0d0;
    font-size: 23px;
    line-height: 1em;
    border-radius: 50px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, color 0.15s;
}

button.ffw-size-step-btn.ffw-size-down:hover:not(:disabled),
button.ffw-size-step-btn.ffw-size-up:hover:not(:disabled) {
    background-color: #da962f;
    color: #fff;
}

button.ffw-size-step-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ffw-size-range {
    flex: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(56, 56, 56, 0.2);
    border-radius: 2px;
    outline: none;
    margin: 0;
    padding: 0;
}

.ffw-size-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #da962f;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.1s;
}

.ffw-size-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ffw-size-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #da962f;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

.ffw-size-range::-moz-range-track {
    background: transparent;
}

/* ---------- Summary panel ---------- */
.ffw-summary {
    margin: 24px 0;
    padding: 16px;
    background: #f5ede1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.ffw-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #383838;
}

.ffw-summary-row.ffw-line {
    color: #555;
    font-size: 13px;
}

.ffw-line-label {
    flex: 1;
    padding-right: 12px;
}

.ffw-line-amount {
    flex-shrink: 0;
    color: #383838;
}

.ffw-summary-row.ffw-total {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
    color: #383838;
}

.ffw-summary-row.ffw-base {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.ffw-summary-lines:empty {
    display: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .ffw-option-img-wrap {
        width: 48px;
        height: 48px;
    }
    button.ffw-option.ffw-option-text {
        font-size: 13px;
        padding: 4px 12px;
    }
    button.ffw-arrow.ffw-arrow-prev,
    button.ffw-arrow.ffw-arrow-next {
        width: 24px;
        height: 24px;
    }
    button.ffw-size-step-btn.ffw-size-down,
    button.ffw-size-step-btn.ffw-size-up {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}
