/*
    Public Rod Finder page.

    Activity-log note:
    This stylesheet has no logging. Durable catalogue/product changes that
    affect the rod finder should be logged where those changes are saved.
*/

.rod-finder-page {
    /*
        Staff adjustment point: page footprint.
        Keep this at 100% to match the broad catalogue-page / Salmon Fly
        Order Form layout. Lower it slightly, such as 95%, if this tool ever
        needs to be inset again without changing the result-card rules below.
    */
    --rod-finder-page-width: 100%;

    box-sizing: border-box;
    width: var(--rod-finder-page-width, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.rod-finder-header {
    margin-bottom: 1rem;
}

.rod-finder-header h1 {
    margin-bottom: 0.35rem;
}

.rod-finder-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 0.85rem;
    align-items: end;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #c8cdd5;
    background: #FFFFFF;
}

.rod-finder-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.rod-finder-field select {
    width: 100%;
}

.rod-finder-actions {
    /*
        The stock-only checkbox and submit controls form one full-width action
        row beneath the four specification selectors.
    */
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}

.rod-finder-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    font-weight: bold;
    cursor: pointer;
}

.rod-finder-checkbox input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    cursor: pointer;
}

.rod-finder-action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rod-finder-count {
    margin-bottom: 0.75rem;
    font-weight: bold;
}

.rod-finder-empty {
    padding: 1rem;
    border: 1px solid var(--wwd-colour-dark-blue, #213663);
    background: #fff;
}

.rod-finder-results {
    display: grid;
    gap: 0.75rem;
}

.rod-finder-result {
    display: grid;
    grid-template-columns: 300px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid #c8cdd5;
    background: #fff;
}

.rod-finder-result[data-rod-finder-card-href] {
    cursor: pointer;
}

.rod-finder-result[data-rod-finder-card-href]:hover,
.rod-finder-result[data-rod-finder-card-href]:focus-within {
    background: #f7f8fa;
}

.rod-finder-image {
    /*
        Center narrow rod/reel-style images inside the full reserved image
        column. Staff may widen the column without narrow images sticking to
        the left edge.
    */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 95px;
}

.rod-finder-image img {
    display: block;
    max-width: 300px;
    max-height: 95px;
    object-fit: contain;
}

.rod-finder-result h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
}

.rod-finder-series {
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
}

.rod-finder-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    margin: 0;
}

.rod-finder-specs div {
    display: flex;
    gap: 0.25rem;
}

.rod-finder-specs dt {
    font-weight: bold;
}

.rod-finder-specs dd {
    margin: 0;
}

.rod-finder-purchase {
    text-align: right;
}

.rod-finder-price {
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 1.05rem;
}

@media (max-width: 800px) {
    .rod-finder-form {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .rod-finder-result {
        grid-template-columns: 90px 1fr;
    }

    .rod-finder-purchase {
        grid-column: 1 / -1;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .rod-finder-page {
        width: 100%;
        padding: 0;
    }

    .rod-finder-form {
        grid-template-columns: 1fr;
    }

    .rod-finder-actions {
        align-items: stretch;
    }

    .rod-finder-checkbox,
    .rod-finder-action-buttons {
        width: 100%;
    }

    .rod-finder-action-buttons .button {
        flex: 1 1 auto;
        text-align: center;
    }

    .rod-finder-result {
        grid-template-columns: 1fr;
    }

    .rod-finder-image img {
        max-width: 100%;
        max-height: 160px;
        margin: 0 auto;
    }
}
