/* Location Grid Plugin CSS */
.location-grid {
    width: 100%;
    margin: 0 auto;
    padding: 1em;
    display: flex;
    flex-direction: column;
}

.location-grid button {
    border-radius: 20px;
    background-color: #00003e;
    fill: #ffffff;
    color: #ffffff;
}

.location-grid button:hover {
    background-color: #FA2231;
    color: #fff;
}

.location-grid-header {
    background: none;
    display: flex;
    flex-direction: column;
    gap: 2em;
    align-items: center;
    padding: 1em 0;
}

.location-grid-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
    margin: auto;
}

.location-grid-search-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}

/* Search section */
.location-grid-search {
    flex: 0 0 400px;
    position: relative;
    color: #333;
}

.location-grid-search:before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    z-index: 1;
}

.location-grid-search-group > .location-grid-search input {
    width: 100%;
    padding: 18px 18px 18px 38px;
    font-size: 14px;
    outline: none;
    background-color: white;
    border-radius: 20px;
}

.location-grid-search-group > .location-grid-search input::placeholder {
    font-style: italic;
    color: #545454;
}

.location-grid-state {
    padding: 0.5em 1em;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #f9f9f9;
    margin-right: 0.5em;
}

.location-grid-search-group > button.location-grid-nearest {
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    padding: 12px 28px 12px 28px;
}

.location-list-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    width: auto;
    max-width: 100%;
    margin: 20px 100px;
    transition: opacity 0.3s cubic-bezier(.4, 0, .2, 1), filter 0.3s cubic-bezier(.4, 0, .2, 1);
    opacity: 1;
    filter: blur(0);
    border: none;
    position: relative;
    min-height: 300px;
}


@media screen and (max-width: 1240px) {
    .location-list-area {
        grid-template-columns: repeat(auto-fill, 100%);
    }
}

@media (max-width: 480px) {
    .location-list-area {
        grid-template-columns: 1fr;
    }
}

.location-card {
    background: #fafafa;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    transition: box-shadow 0.3s ease;
    height: 230px;
    position: relative;
    z-index: 1;
}

.location-card:has(.location-actions.active) {
    z-index: 101;
}

.location-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.location-hero-container {
    position: relative;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

.location-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.location-hero .location-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.location-hero .location-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, rgba(0, 0, 62, 0.7) 0%, rgba(0, 0, 62, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

.location-bg > .location-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.location-hero > .location-hero-content {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px 20px 22px 20px;
    z-index: 2;
}

.location-hero-content > .location-name {
    font-family: "Anton", Sans-serif;
    text-transform: uppercase;
    font-size: clamp(1.1em, 2.5vw, 1.4em);
    color: #ffffff;
    font-weight: 500;
    margin: 0;
    text-align: left;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    word-break: break-word;
    hyphens: auto;
    max-width: 90%;
}

.state-badge {
    position: absolute;
    top: 13px;
    right: 13px;
    padding: 4px 15px;
    border-radius: 20px;
    background-color: #00003e;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    font-weight: 600;
    z-index: 1;
}

.location-info {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: visible;
    border-radius: 20px;
    background: #fafafa;
}

.location-details {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 50%;
    justify-content: space-between;
    padding: 20px;
    overflow: visible;
}

.location-hours {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.status-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.location-day {
    text-transform: uppercase;
    font-weight: 600;
}

.location-status {
    font-weight: 600;
    font-size: 14px;
}

.location-status.open {
    color: #22c55e;
}

.location-status.closed {
    color: #ef4444;
}

.location-status.coming-soon {
    color: #f59e0b;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.open {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-dot.open::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.3);
    animation: pulse 2s infinite;
}

.status-dot.closed {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-dot.coming-soon {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot.coming-soon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.location-address {
    display: inline-block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.location-address svg {
    width: 14px;
    height: 14px;
    min-width: 14px;
    fill: currentColor;
}

.location-actions {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.location-actions.active {
    z-index: 50;
}

.location-actions .btn-order-now {
    width: 100%;
    display: flex;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    padding: 10px 14px;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    fill: #fff;
    background-color: #00003e;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    white-space: nowrap;
}

.location-actions .btn-order-now:hover {
    background-color: #FA2231;
    color: #fff;
}

.location-actions .btn-order-now::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid currentColor;
    transition: transform 0.2s ease;
}

.location-actions.active .btn-order-now::after {
    transform: rotate(180deg);
}

.order-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
    overflow: hidden;
}

.location-actions.active .order-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.order-dropdown .order-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    color: #00003e;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.order-dropdown .order-option:last-child {
    border-bottom: none;
}

.order-dropdown .order-option:hover {
    background-color: #f5f5f5;
    color: #00003e;
}

.location-closing {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Show me more button for coming soon locations */
.location-actions.coming-soon {
    display: flex;
    width: 100%;
}

.location-grid a.btn {
    display: flex;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    padding: 10px 14px;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    fill: #00003e;
    background-color: #00003e;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    white-space: nowrap;
    min-width: 0;
}

.location-grid a.btn:hover {
    background-color: #FA2231;
    color: #fff;
}

@keyframes fadeInGrid {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card {
    /* start hidden and slightly translated so the fadeInGrid animation can reveal it */
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
}

.location-card.animated {
    /* use the defined keyframes name (fadeInGrid) so the animation actually runs */
    animation: fadeInGrid 0.5s ease forwards;
}

.location-grid-states {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 0.5em;
}

.location-grid-state-checkbox {
    display: none;
}

.location-grid-state-btn {
    display: inline-block;
    padding: 0.5em 1.2em;
    border-radius: 20px;
    background: #f2f2f2;
    color: #00003e;
    font-weight: 600;
    border: 2px solid #00003e;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin: 0;
    user-select: none;
    font-size: 14px;
}

.location-grid-state-checkbox:checked + .location-grid-state-btn {
    background: #00003e;
    color: #fff;
    border-color: #00003e;
}

.location-grid-state-btn:hover {
    background: #FA2231;
    color: #fff;
    border-color: #FA2231;
}

.location-grid-states-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    gap: 0.5em;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.location-grid-states-scroll::-webkit-scrollbar {
    display: none;
}

.location-grid-states-scroll > button.location-grid-state-pill {
    flex: 0 0 auto;
    display: inline-block;
    padding: 0.5em 1.2em;
    background: #fff;
    color: #00003e;
    font-weight: 600;
    border: 2px solid #00003e;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin: 0;
    user-select: none;
    font-size: 18px;
    outline: none;
    white-space: nowrap;
}

.location-grid-states-scroll > button.location-grid-state-pill.active,
.location-grid-states-scroll > button.location-grid-state-pill:focus {
    background: #FA2231;
    color: #fff;
    border-color: #FA2231;
}

.location-grid-states-scroll > button.location-grid-state-pill:hover {
    background: #FA2231;
    color: #fff;
    border-color: #FA2231;
}

@media (max-width: 768px) {

    .location-list-area {
        margin: 20px 0;
        gap: 15px;
    }

    .location-grid-header {
        flex-direction: column;
        align-items: stretch;
        gap: 2em;
        padding: 0.5em 0;
    }
    .location-grid-state,
    .location-grid-search,
    .location-grid-nearest {
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
    }
    .location-grid-search {
        flex: 0 0 100%;
    }
    .location-grid-search-group > .location-grid-search input {
        padding: 8px 16px 8px 38px;
        font-size: 16px;
    }
    .location-grid-search:before {
        left: 12px;
    }
    .location-grid-states {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25em;
    }
    .location-grid-state-btn {
        width: 100%;
        text-align: center;
    }
    .location-grid-filters {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* Mobile vertical layout */
    .location-card {
        height: auto;
    }

    .location-info {
        flex-direction: column;
    }

    .location-hero-container {
        width: 100%;
        height: auto;
        order: -1;
    }

    .location-hero {
        min-height: 60px;
        background-color: #fafafa;
    }

    /* Hide background image and overlay on mobile */
    .location-hero .location-bg {
        display: none;
    }

    .location-hero > .location-hero-content {
        position: relative;
        padding: 15px 20px;
        align-items: center;
        justify-content: space-between;
        flex-direction: row;
    }

    .location-hero-content > .location-name {
        color: #00003e;
        font-size: 1.5em;
        text-shadow: none;
        max-width: calc(100% - 80px);
        flex: 1;
    }

    .location-details {
        width: 100%;
        padding: 15px 20px 20px 20px;
    }
}

/* Loading spinner */
.location-grid-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}

.location-grid-spinner.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-list-area:has(.location-card) .location-grid-spinner {
    display: none;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #00003e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.location-grid {
    position: relative;
}