:root {
    --nearby-green: #1B4FD8;
    /* primary */
    --nearby-green-dark: #153aa8;
    /* primary dark */
    --nearby-pink: #F72585;
    /* secondary */
    --nearby-bg: #FAF7F2;
    /* background */
    --nearby-ink: #080d1f;
    --nearby-muted: #5e6472;
    --nearby-line: #edf0ef;
    --nearby-soft: rgba(27, 79, 216, .06);
}

body {
    background: var(--nearby-bg);
    color: var(--nearby-ink);
}

.ends-soon {
    color: var(--nearby-pink);
    font-weight: 700;
}

.header-section,
.slicknav_menu,
#scroll-to-top {
    display: none !important;
}

.footer-section {
    background-color: rgba(255, 253, 250, 1) !important;
}

.nearby-deals-page {
    min-height: 100vh;
    font-family: "Inter", "Nunito", Arial, sans-serif;
    background:
        /* radial-gradient(circle at 12% 12%, rgba(27, 79, 216, .07), transparent 28%), */
        linear-gradient(180deg, rgba(250, 247, 242, 1) 0%, rgba(250, 247, 242, 1) 62%, rgba(250, 247, 242, 1) 100%);
}

.deals-container {
    width: min(100%, 1512px);
    margin: 0 auto;
    padding: 0 28px;
}

.deals-header {
    position: sticky;
    top: 0;
    z-index: 20;
    /* background: var(--nearby-bg); */
    border-bottom: none;
    backdrop-filter: none;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.deals-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-left: 1.5%;
    margin-right: 1.5%;
    /* gap: 28px; */
    min-height: 86px;
    transition: min-height 0.3s ease;
}

.deals-logo img {
    width: 126px;
    max-width: 100%;
    transition: width 0.3s ease;
}

.deals-search {
    width: 55%;
    position: relative;
}

.deals-search-wrapper {
    display: flex;
    align-items: center;
    height: 60px;
    background-color: #fefcfa;
    /* Mockup warm background */
    border: 1px solid #e7e4dc;
    /* Mockup soft border */
    border-radius: 999px;
    /* Pill layout */
    padding: 4px;
    /* Offset categories and search button */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: height 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.deals-search-wrapper:focus-within {
    border-color: rgba(27, 79, 216, 0.36);
    box-shadow: 0 10px 30px rgba(27, 79, 216, 0.08);
}

.deals-search-categories-container {
    position: relative;
    display: inline-block;
    height: 100%;
}

.deals-search-categories-trigger {
    height: 100%;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 700;
    color: #0f1734;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
    user-select: none;
    outline: none;
    transition: font-size 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}

.deals-search-categories-trigger:hover {
    opacity: 0.8;
}

.deals-search-categories-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    background: rgba(65, 66, 70, 0.98);
    /* Mockup background color: #414246 with high opacity */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    padding: 8px 0;
    min-width: 200px;
    z-index: 100;
    display: none;
    backdrop-filter: blur(8px);
}

.deals-search-categories-dropdown.is-open {
    display: block;
}

.deals-search-categories-item {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #eceae4;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.deals-search-categories-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.deals-search-categories-item.is-selected {
    color: #ffffff;
}

.deals-search-categories-item .check-icon {
    width: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    font-size: 12px;
}

.deals-search-categories-item.is-selected .check-icon {
    visibility: visible;
}

.deals-search-divider {
    width: 1px;
    height: 24px;
    background-color: #e7e4dc;
    flex-shrink: 0;
}

.deals-search input {
    flex: 1;
    height: 100% !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 16px !important;
    color: #0b162c !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

.deals-search input::placeholder {
    color: #969594 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.deals-search input::-webkit-input-placeholder {
    color: #969594 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.deals-search input::-moz-placeholder {
    color: #969594 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.deals-search input:-ms-input-placeholder {
    color: #969594 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.deals-search-button {
    height: 52px;
    background-color: #1b4fd8;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: height 0.3s ease, padding 0.3s ease, font-size 0.3s ease, background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.deals-search-button:hover {
    background-color: #113495;
}

/* Scroll Shrink Classes */
.deals-header.header-shrink {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    background: var(--nearby-bg);
}

.deals-header.header-shrink .deals-nav {
    min-height: 64px;
}

.deals-header.header-shrink .deals-logo img {
    width: 106px;
}

.deals-header.header-shrink .deals-search-wrapper {
    height: 48px;
}

.deals-header.header-shrink .deals-search-categories-trigger {
    font-size: 14px;
    padding: 0 16px;
}

.deals-header.header-shrink .deals-search-button {
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
}

.deals-search-button:active {
    transform: scale(0.98);
}

.deals-search-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    display: none;
    max-height: 520px;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--nearby-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(8, 13, 31, .16);
}

.deals-search-panel.is-open {
    display: block;
}

.deals-search-title {
    margin: 0 0 10px;
    color: var(--nearby-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.deals-search-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
}

.deals-search-row:hover {
    background: var(--nearby-soft);
}

.deals-search-row img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 12px;
    background: #eef4f1;
}

.deals-search-row strong,
.deals-search-row span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deals-search-row span {
    color: var(--nearby-muted);
    font-size: 13px;
}

.deals-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 34px;
}

.deals-links a {
    color: var(--nearby-pink);
    font-weight: 600;
    white-space: nowrap;
}

.deals-main {
    padding: 28px 0 48px;
}

.deals-section {
    margin-bottom: 18px;
    padding: 24px 20px 34px;
}

.deals-panel {
    /* border: 1px solid rgba(12, 20, 37, .06); */
    border-radius: 20px;
    /* background: rgba(255, 255, 255, .72); */
    /* box-shadow: 0 18px 50px rgba(11, 23, 35, .06); */
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
    color: black;
}

.section-copy {
    margin: 0;
    color: #333947;
    font-size: 14px;
}

.view-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--nearby-green);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(130px, 1fr));
    gap: 16px;
}

.category-grid.scroll-horizontal {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    scroll-behavior: smooth;
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.category-grid.scroll-horizontal .category-card {
    flex: 0 0 170px !important;
    max-width: 170px !important;
    min-width: 170px !important;
}

.category-grid.scroll-horizontal::-webkit-scrollbar {
    height: 6px;
}

.category-grid.scroll-horizontal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.category-grid.scroll-horizontal::-webkit-scrollbar-thumb {
    background: rgba(27, 79, 216, 0.2);
    border-radius: 10px;
}

.category-grid.scroll-horizontal::-webkit-scrollbar-thumb:hover {
    background: rgba(27, 79, 216, 0.4);
}

.category-card {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    border: 1px solid var(--nearby-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(8, 13, 31, .07);
    cursor: pointer;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.category-card:hover,
.category-card.is-active {
    border-color: rgba(27, 79, 216, .28);
    box-shadow: 0 16px 36px rgba(27, 79, 216, .12);
    transform: translateY(-2px);
}

.category-icon-img {
    height: 100%;
    width: 100%;
    border-radius: 100%;
}

.category-icon {
    display: grid;
    /* width: 110px; */
    /* height: 110px; */
    place-items: center;
    margin-bottom: 16px;
    border-radius: 999px;
    background: #e7f6ef;
}

.category-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.category-name {
    max-width: 100%;
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--nearby-ink);
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-count {
    color: var(--nearby-green);
    font-size: 15px;
    font-weight: 600;
}

.deal-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(210px, 1fr));
    gap: 24px;
}

.deal-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(27, 79, 216, .12);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(8, 13, 31, .08);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.deal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(27, 79, 216, .2);
    box-shadow: 0 22px 48px rgba(8, 13, 31, .12);
}

.deal-media {
    position: relative;
    aspect-ratio: 1.36 / 1;
    background: #f5f7fb;
}

.deal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deal-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 14px;
    color: #fff;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--nearby-pink), #b10a63);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.deal-body {
    padding: 20px 18px 20px;
}

.store-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.store-line img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 999px;
    background: #eef4f1;
}

.store-name {
    display: block;
    overflow: hidden;
    color: var(--nearby-green);
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-rating {
    color: #5e6472;
    font-size: 12px;
}

.store-rating i {
    color: #ffb000;
    margin-right: 4px;
}

.deal-title {
    min-height: 52px;
    margin: 0 0 18px;
    color: var(--nearby-ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}

.deal-meta {
    display: grid;
    gap: 10px;
    color: #5e6472;
    font-size: 13px;
}

.deal-meta span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.deal-meta i {
    width: 16px;
}

.deal-meta .ends {
    color: var(--nearby-pink);
    font-weight: 700;
}

.deal-empty {
    grid-column: 1 / -1;
    padding: 34px;
    color: var(--nearby-muted);
    border: 1px dashed #dfe4e2;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

@media (max-width: 1200px) {

    .category-grid:not(.scroll-horizontal),
    .deal-grid {
        grid-template-columns: repeat(4, minmax(180px, 1fr));
    }
}

@media (max-width: 900px) {
    .deals-header {
        position: relative;
    }

    .deals-container {
        padding: 0 16px;
    }

    .deals-nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        min-height: auto;
    }

    .deals-search {
        width: 100%;
        margin: 4px 0;
    }

    .deals-links {
        justify-content: center;
        gap: 24px;
        width: 100%;
    }

    .section-head {
        align-items: center;
        text-align: center;
        flex-direction: column;
        gap: 12px;
    }

    .section-head .view-link {
        margin-top: 4px;
    }

    .category-grid:not(.scroll-horizontal) {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .category-card {
        min-height: 130px;
        padding: 12px 8px;
    }

    .category-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 8px;
    }

    .category-icon img {
        width: 40px;
        height: 40px;
    }

    .category-name {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .category-count {
        font-size: 12px;
    }

    .deal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .deal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .deals-section {
        padding: 20px 0 28px;
    }

    .deals-panel {
        padding-left: 0;
        padding-right: 0;
    }

    .section-title {
        font-size: 22px;
    }

    .section-copy {
        font-size: 13px;
    }

    .deals-search-wrapper {
        height: 50px;
        padding: 2px;
    }

    .deals-search-categories-trigger {
        padding: 0 10px;
        font-size: 13px;
        max-width: 110px;
    }

    .deals-search input {
        padding: 0 8px !important;
        font-size: 13px !important;
    }

    .deals-search-button {
        height: 44px;
        padding: 0 16px;
        font-size: 13px;
    }

    .deals-search-categories-dropdown {
        top: calc(100% + 6px);
        left: 0;
        min-width: 180px;
    }

    .category-grid:not(.scroll-horizontal) {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .category-card {
        min-height: 110px;
    }

    .category-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 6px;
    }

    .category-icon img {
        width: 30px;
        height: 30px;
    }

    .category-name {
        font-size: 13px;
    }

    .deal-card {
        border-radius: 16px;
    }

    .deal-media {
        aspect-ratio: 1.65 / 1;
    }

    .deal-body {
        padding: 12px;
    }

    .store-line {
        gap: 8px;
        margin-bottom: 6px;
    }

    .store-line img {
        width: 30px;
        height: 30px;
    }

    .store-name {
        font-size: 13px;
    }

    .deal-title {
        font-size: 13px;
        min-height: 36px;
        margin-bottom: 8px;
        line-height: 1.35;
    }

    .deal-meta {
        font-size: 11px;
        gap: 6px;
    }

    .deal-badge {
        top: 10px;
        left: 10px;
        padding: 4px 8px;
        font-size: 10px;
    }

    .deals-header.header-shrink .deals-nav {
        min-height: auto;
    }

    .deals-header.header-shrink .deals-search-wrapper {
        height: 46px;
    }

    .deals-header.header-shrink .deals-search-categories-trigger {
        font-size: 12px;
        padding: 0 8px;
    }

    .deals-header.header-shrink .deals-search-button {
        height: 40px;
        padding: 0 12px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .category-grid:not(.scroll-horizontal) {
        grid-template-columns: repeat(2, 1fr);
    }

    .deal-grid {
        grid-template-columns: 1fr;
    }
}

.module-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: capitalize;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
    color: #1B4FD8;
    background: linear-gradient(135deg, rgba(27, 79, 216, .12), rgba(255, 255, 255, .9));
    border: 1px solid rgba(27, 79, 216, .18);
    box-shadow: 0 10px 30px rgba(27, 79, 216, .08);
}

.module-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(27, 79, 216, .12);
}

.module-pill.pill-default:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(27, 79, 216, .12);
}