.distillery-directory {
    width: 100%;
    padding: clamp(1rem, 2.5vw, 2.25rem);
    color: var(--text);
}

.distillery-directory [hidden] {
    display: none !important;
}

.distillery-directory .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.distillery-directory-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.distillery-directory-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.34fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
    min-height: 315px;
    padding: clamp(1.5rem, 4vw, 3.75rem);
    overflow: hidden;
    border: 1px solid rgba(185, 154, 104, 0.36);
    border-radius: clamp(1rem, 2vw, 1.75rem);
    background:
        radial-gradient(circle at 85% 15%, rgba(212, 175, 55, 0.2), transparent 34%),
        linear-gradient(135deg, var(--surface) 0%, var(--bg-darker) 100%);
    box-shadow: var(--shadow-lg);
}

.distillery-directory-hero::after {
    content: "";
    position: absolute;
    right: -7rem;
    bottom: -10rem;
    width: 24rem;
    height: 24rem;
    border: 1px solid rgba(185, 154, 104, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 2.5rem rgba(185, 154, 104, 0.035),
        0 0 0 5rem rgba(185, 154, 104, 0.025);
    pointer-events: none;
}

.distillery-directory-hero-copy,
.distillery-directory-hero-mark {
    position: relative;
    z-index: 1;
}

.distillery-directory-eyebrow {
    margin: 0 0 0.55rem;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.distillery-directory-hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--text);
    font-size: clamp(2.15rem, 6vw, 4.75rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.distillery-directory-lead {
    max-width: 680px;
    margin: 1.25rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.7vw, 1.17rem);
    line-height: 1.65;
}

.distillery-directory-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    margin-top: 1.7rem;
}

.distillery-directory-hero-actions .btn {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding-inline: 1.15rem;
}

.distillery-directory-hero-actions .btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

.distillery-directory-total {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    max-width: 250px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.25;
}

.distillery-directory-total strong {
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 600;
}

.distillery-directory-hero-mark {
    display: grid;
    place-items: center;
    width: min(240px, 100%);
    aspect-ratio: 1;
    margin-left: auto;
    color: var(--gold);
    border: 1px solid rgba(185, 154, 104, 0.28);
    border-radius: 50%;
    background: rgba(185, 154, 104, 0.055);
    box-shadow: inset 0 0 45px rgba(185, 154, 104, 0.08);
}

.distillery-directory-hero-mark svg {
    width: 72%;
    height: 72%;
    stroke-width: 2.2;
}

.distillery-explorer {
    position: relative;
    z-index: 10;
    margin: clamp(1rem, 2.5vw, 1.75rem) 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid rgba(185, 154, 104, 0.25);
    border-radius: clamp(0.9rem, 2vw, 1.35rem);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.distillery-search-wrap {
    position: relative;
}

.distillery-search-icon {
    position: absolute;
    top: 50%;
    left: 1.05rem;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gold);
    transform: translateY(-50%);
    pointer-events: none;
}

.distillery-search-input {
    width: 100%;
    min-height: 56px;
    padding: 0.8rem 3.1rem 0.8rem 3.15rem;
    color: var(--text);
    font: inherit;
    font-size: 1.04rem;
    border: 1px solid rgba(185, 154, 104, 0.42);
    border-radius: 0.9rem;
    outline: none;
    background: var(--bg-darker);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.distillery-search-input::placeholder {
    color: var(--muted);
    opacity: 0.9;
}

.distillery-search-input:focus {
    border-color: var(--gold);
    box-shadow: var(--gold-glow);
}

.distillery-search-input::-webkit-search-cancel-button {
    display: none;
}

.distillery-search-clear {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--muted);
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: translateY(-50%);
}

.distillery-search-clear:hover,
.distillery-search-clear:focus-visible {
    color: var(--text);
    background: rgba(185, 154, 104, 0.12);
}

.distillery-search-clear svg {
    width: 1.1rem;
    height: 1.1rem;
}

.distillery-filter-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.distillery-filter-heading {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.distillery-filter-heading svg {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--gold);
}

.distillery-filter-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.65rem;
}

.distillery-filter-control {
    position: relative;
    min-width: 0;
}

.distillery-filter-button,
.distillery-reset-button {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    border: 1px solid rgba(185, 154, 104, 0.35);
    border-radius: 0.7rem;
    background: transparent;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.distillery-filter-button:hover,
.distillery-filter-button:focus-visible,
.distillery-filter-button[aria-expanded="true"] {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(185, 154, 104, 0.09);
    outline: none;
}

.distillery-filter-button > svg {
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    transition: transform 0.18s ease;
}

.distillery-filter-button[aria-expanded="true"] > svg {
    transform: rotate(180deg);
}

.distillery-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding-inline: 0.3rem;
    color: var(--bg-darker);
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 999px;
    background: var(--gold);
}

.distillery-reset-button {
    width: auto;
    color: var(--gold);
}

.distillery-reset-button svg {
    width: 1rem;
    height: 1rem;
}

.distillery-reset-button:not(:disabled):hover,
.distillery-reset-button:not(:disabled):focus-visible {
    border-color: var(--gold);
    background: rgba(185, 154, 104, 0.09);
}

.distillery-reset-button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.45;
}

.distillery-directory .filter-dropdown {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    display: none;
    width: max(100%, 260px);
    max-width: min(360px, 88vw);
    max-height: 330px;
    margin: 0;
    padding: 0.75rem !important;
    overflow-y: auto;
    color: var(--text);
    border: 1px solid var(--gold);
    border-radius: 0.8rem;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.distillery-directory .filter-dropdown .form-check {
    min-height: 42px;
    margin: 0;
    padding: 0.55rem 0.5rem 0.55rem 2rem;
    border-radius: 0.5rem;
}

.distillery-directory .filter-dropdown .form-check:hover {
    background: rgba(185, 154, 104, 0.1);
}

.distillery-directory .filter-dropdown .form-check-label {
    width: 100%;
    margin: 0;
    color: var(--text) !important;
    cursor: pointer;
}

.distillery-results-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(185, 154, 104, 0.16);
}

.distillery-results-bar p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.distillery-results-bar strong {
    color: var(--gold);
    font-size: 1.08rem;
}

.distillery-results {
    min-height: 320px;
}

.distillery-list,
.distillery-loading {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.distillery-list[aria-busy="true"] {
    opacity: 0.35;
    pointer-events: none;
}

.distillery-skeleton {
    min-height: 152px;
    padding: 1.4rem;
    border: 1px solid rgba(185, 154, 104, 0.18);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.distillery-skeleton span {
    display: block;
    width: 72%;
    height: 0.82rem;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(185, 154, 104, 0.06), rgba(185, 154, 104, 0.22), rgba(185, 154, 104, 0.06));
    background-size: 200% 100%;
    animation: distillery-shimmer 1.4s infinite linear;
}

.distillery-skeleton span:first-child {
    width: 48%;
    height: 1.3rem;
}

.distillery-skeleton span:last-child {
    width: 35%;
}

@keyframes distillery-shimmer {
    to { background-position: -200% 0; }
}

.distillery-card {
    align-self: start;
    overflow: hidden;
    border: 1px solid rgba(185, 154, 104, 0.25) !important;
    border-radius: 1rem;
    background: var(--surface) !important;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.distillery-card:hover,
.distillery-card:focus-within {
    border-color: rgba(185, 154, 104, 0.7) !important;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.distillery-card-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    width: 100%;
    min-height: 126px;
    padding: 1.25rem;
    color: var(--text);
    text-align: left;
    border: 0;
    background:
        linear-gradient(135deg, rgba(185, 154, 104, 0.085), transparent 55%),
        var(--surface);
}

.distillery-card-trigger:focus-visible {
    outline: 3px solid rgba(212, 175, 55, 0.45);
    outline-offset: -3px;
}

.distillery-card-heading {
    min-width: 0;
}

.distillery-card-kicker {
    display: block;
    margin-bottom: 0.32rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.distillery-card .distillery-card-title {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
    font-size: clamp(1.2rem, 2.1vw, 1.5rem);
    font-weight: 600;
    line-height: 1.15;
}

.distillery-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.distillery-card-meta span {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(185, 154, 104, 0.18);
    border-radius: 999px;
    background: rgba(185, 154, 104, 0.055);
}

.distillery-card-alias {
    margin-top: 0.65rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.distillery-card-alias strong {
    color: var(--gold);
}

.distillery-card-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--gold);
    border: 1px solid rgba(185, 154, 104, 0.35);
    border-radius: 50%;
    background: rgba(185, 154, 104, 0.07);
}

.distillery-card-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
    transition: transform 0.25s ease;
}

.distillery-card-trigger[aria-expanded="true"] .distillery-card-toggle svg {
    transform: rotate(180deg);
}

.distillery-card-details {
    max-height: 0;
    overflow: hidden;
    border-top: 0 solid rgba(185, 154, 104, 0.18);
    transition: max-height 0.35s ease, border-width 0.2s ease;
}

.distillery-card-details.open {
    border-top-width: 1px;
}

.distillery-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1.25rem;
    padding: 1.2rem 1.25rem 0;
}

.distillery-detail-item {
    min-width: 0;
    margin: 0;
}

.distillery-detail-item strong {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--gold);
    font-size: 0.73rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.distillery-detail-item span {
    color: var(--text) !important;
    overflow-wrap: anywhere;
}

.distillery-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 1.2rem 1.25rem 1.25rem;
}

.distillery-card-actions .btn {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    white-space: normal;
}

.distillery-card-actions .btn svg {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
}

.distillery-empty-state {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 300px;
    padding: 2rem;
    color: var(--muted);
    text-align: center;
    border: 1px dashed rgba(185, 154, 104, 0.45);
    border-radius: 1rem;
    background: rgba(185, 154, 104, 0.04);
}

.distillery-list > .alert {
    grid-column: 1 / -1;
}

.distillery-empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: var(--gold);
}

.distillery-empty-state h2 {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-size: 1.35rem;
}

.distillery-empty-state p {
    max-width: 470px;
    margin: 0;
}

.distillery-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0 2rem;
}

.distillery-pagination .btn {
    min-width: 150px;
    min-height: 44px;
}

@media (max-width: 900px) {
    .distillery-directory-hero {
        grid-template-columns: minmax(0, 1fr) 150px;
        min-height: 285px;
    }

    .distillery-filter-bar {
        grid-template-columns: 1fr;
    }

    .distillery-filter-heading {
        margin-bottom: -0.25rem;
    }
}

@media (max-width: 700px) {
    .distillery-directory {
        padding: 0.75rem;
    }

    .distillery-directory-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 1.5rem 1.2rem;
    }

    .distillery-directory-hero-mark {
        position: absolute;
        top: -2.5rem;
        right: -2.7rem;
        width: 9rem;
        opacity: 0.16;
    }

    .distillery-directory-hero h1 {
        max-width: 85%;
        font-size: clamp(2.25rem, 13vw, 3.45rem);
    }

    .distillery-directory-lead {
        margin-top: 1rem;
        font-size: 0.98rem;
    }

    .distillery-directory-hero-actions {
        align-items: stretch;
        margin-top: 1.35rem;
    }

    .distillery-directory-hero-actions .btn {
        width: 100%;
    }

    .distillery-directory-total {
        max-width: none;
    }

    .distillery-explorer {
        margin-block: 0.75rem 1rem;
        padding: 0.85rem;
    }

    .distillery-filter-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .distillery-reset-button {
        width: 100%;
    }

    .distillery-directory .filter-dropdown {
        width: min(330px, calc(100vw - 2.5rem));
    }

    #whisky_type-dropdown-menu,
    #other-dropdown-menu {
        right: 0;
        left: auto;
    }

    .distillery-results-bar {
        align-items: flex-start;
    }

    .distillery-results-bar p:last-child {
        text-align: right;
    }

    .distillery-list,
    .distillery-loading {
        grid-template-columns: 1fr;
    }

    .distillery-card-trigger {
        min-height: 116px;
        padding: 1.1rem;
    }

    .distillery-detail-grid {
        grid-template-columns: 1fr;
        padding: 1rem 1.1rem 0;
    }

    .distillery-card-actions {
        padding: 1rem 1.1rem 1.1rem;
    }
}

@media (max-width: 430px) {
    .distillery-directory-hero h1 {
        max-width: 100%;
        font-size: 2.25rem;
    }

    .distillery-filter-button,
    .distillery-reset-button {
        padding-inline: 0.65rem;
        font-size: 0.84rem;
    }

    .distillery-card-actions {
        grid-template-columns: 1fr;
    }

    .distillery-pagination {
        flex-direction: column;
    }

    .distillery-pagination .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .distillery-directory *,
    .distillery-directory *::before,
    .distillery-directory *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
