/* ============================================================================
   Ajanta Builders Mart — visual category directory + listing refresh
   ============================================================================ */

/* ============================ Category directory ============================ */
.category-directory-v4 {
    background: #F7F9FC;
}

.category-directory-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(520px 330px at 83% 30%, rgba(120, 43, 52, .35), transparent 68%),
        radial-gradient(380px 280px at 67% 100%, rgba(82, 31, 37, .3), transparent 70%),
        linear-gradient(118deg, #170709 0%, #220b0e 54%, #381519 100%);
}

.category-directory-hero::before {
    content: '';
    position: absolute;
    right: -120px;
    top: -145px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255, 255, 255, .035), 0 0 0 57px rgba(255, 255, 255, .025);
}

.category-directory-hero-inner {
    position: relative;
    z-index: 1;
    min-height: 397px;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: 45px;
    padding-top: 45px;
    padding-bottom: 47px;
}

.category-directory-copy {
    min-width: 0;
}

.category-directory-copy .home-section-kicker {
    color: #FDBA74;
}

.category-directory-copy h1 {
    color: #fff;
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.04;
    letter-spacing: -.05em;
    margin-top: 12px;
}

.category-directory-copy h1 em {
    color: #67E8F9;
    font-style: normal;
}

.category-directory-copy p {
    max-width: 510px;
    color: #C9D6EA;
    font-size: 15px;
    line-height: 1.65;
    margin-top: 15px;
}

.category-directory-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.category-directory-pills span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(239, 246, 255, .78);
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12.5px;
    font-weight: 700;
}

.category-directory-pills strong {
    color: #fff;
    font-size: 13px;
}

.category-directory-collage {
    position: relative;
    justify-self: end;
    width: min(100%, 430px);
    height: 290px;
}

.directory-collage-photo {
    position: absolute;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, .87);
    border-radius: 20px;
    box-shadow: 0 22px 42px rgba(0, 0, 0, .28);
}

.directory-collage-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collage-photo-one {
    left: 2%;
    top: 34px;
    width: 52%;
    height: 205px;
    transform: rotate(-7deg);
}

.collage-photo-two {
    right: 2%;
    top: 3px;
    width: 44%;
    height: 166px;
    transform: rotate(7deg);
}

.collage-photo-three {
    right: 3%;
    bottom: 0;
    width: 46%;
    height: 139px;
    transform: rotate(-4deg);
}

.directory-collage-badge {
    position: absolute;
    left: 41%;
    top: 105px;
    z-index: 3;
    width: 91px;
    height: 91px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #F97316, #EA580C);
    box-shadow: 0 12px 25px rgba(249, 115, 22, .4);
    font-family: var(--font-display);
    font-size: 24px;
    line-height: .8;
    font-weight: 800;
    text-align: center;
}

.directory-collage-badge small {
    display: block;
    color: rgba(255, 255, 255, .83);
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: 6px;
}

.category-directory-body {
    padding: 70px 0 82px;
    background: linear-gradient(180deg, #F7F9FC 0%, #FFFDF8 100%);
}

.category-directory-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.category-directory-section-head h2 {
    color: var(--ink);
    font-size: clamp(25px, 2.7vw, 34px);
    font-weight: 800;
    letter-spacing: -.04em;
    margin-top: 7px;
}

.category-directory-section-head p {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 7px;
}

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

.directory-category-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 19px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(16, 24, 40, .07);
    transition: transform .22s, box-shadow .22s;
}

.directory-category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 33px rgba(16, 24, 40, .14);
}

.directory-category-media {
    position: relative;
    aspect-ratio: 1.22;
    overflow: hidden;
    background: #E8EEF3;
}

.directory-category-media::after {
    content: '';
    position: absolute;
    inset: 44% 0 0;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(7, 21, 40, .53));
}

.directory-category-media>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.directory-category-card:hover .directory-category-media>img {
    transform: scale(1.07);
}

.directory-category-icon {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
}

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

.directory-category-arrow {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(7, 21, 40, .55);
    font-size: 17px;
}

.directory-category-body {
    min-width: 0;
    padding: 15px 15px 17px;
}

.directory-category-body strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-category-body span {
    display: block;
    overflow: hidden;
    color: var(--faint);
    font-size: 13px;
    font-weight: 600;
    margin-top: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-category-body i {
    color: #D0D5DD;
    font-style: normal;
    padding: 0 4px;
}

.category-directory-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 51px;
    padding: 27px 31px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(115deg, #170709, #381519 65%, #521f25);
    box-shadow: 0 15px 33px rgba(23, 7, 9, .25);
}

.category-directory-cta .home-section-kicker {
    color: #FDBA74;
}

.category-directory-cta h2 {
    color: #fff;
    font-size: 23px;
    letter-spacing: -.035em;
    margin-top: 6px;
}

.category-directory-cta p {
    color: #C9D6EA;
    font-size: 12px;
    margin-top: 5px;
}

.category-directory-cta .btn {
    flex: 0 0 auto;
    min-height: 45px;
    font-size: 12.5px;
}

/* ============================ Category product listing ============================ */
.category-listing-v4 {
    min-height: 62vh;
    padding-bottom: 20px;
    background: linear-gradient(180deg, #F7F9FC, #FFFDF8);
}

.listing-category-hero-v4 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 17px;
    min-height: 163px;
    padding: 25px 0 24px;
}

.listing-category-photo-v4 {
    position: relative;
    width: 108px;
    height: 108px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 22px;
    background: #E7EEF3;
    box-shadow: 0 9px 22px rgba(16, 24, 40, .13);
}

.listing-category-photo-v4>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-category-photo-v4>span {
    position: absolute;
    left: 9px;
    bottom: 9px;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 11px rgba(0, 0, 0, .15);
}

.listing-category-photo-v4>span img {
    width: 22px;
    height: 22px;
}

.listing-category-hero-v4 .cat-hero-text {
    min-width: 0;
}

.listing-category-hero-v4 .home-section-kicker {
    font-size: 12px;
}

.listing-category-hero-v4 .cat-hero-text h1 {
    color: var(--navy-900);
    font-size: clamp(25px, 3vw, 36px);
    margin-top: 6px;
}

.listing-category-hero-v4 .cat-hero-text p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.listing-category-hero-v4 .cat-hero-text p b {
    color: var(--orange-500);
    padding: 0 4px;
}

.listing-category-back-v4 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--navy-900);
    background: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: 0 4px 13px rgba(16, 24, 40, .06);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.listing-category-back-v4 span {
    color: var(--orange-600);
    font-size: 16px;
}

.listing-category-back-v4:hover {
    color: var(--orange-600);
}

/* ============================ Professional Search Page Hero ============================ */
.search-page-header {
    margin-bottom: 24px;
    animation: searchFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes searchFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-header-shell {
    position: relative;
    padding: 10px 0 20px;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #E2E8F0;
}

.search-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.search-badge-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-metrics-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    padding: 3.5px 10px;
    border-radius: 8px;
}

.search-metrics-tag strong {
    color: #0F172A;
    font-weight: 800;
}

.search-cat-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0F172A;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-cat-shortcut svg {
    color: #F97316;
    transition: transform 0.2s ease;
}

.search-cat-shortcut:hover {
    color: #EA580C;
    border-color: #FDBA74;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.search-cat-shortcut:hover svg {
    transform: translate(2px, -2px);
}

.search-header-content {
    margin-bottom: 14px;
}

.search-main-heading {
    color: #0F172A;
    font-family: var(--font-display);
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 6px 0;
}

.search-highlight {
    color: #EA580C;
    background: linear-gradient(120deg, rgba(254, 215, 170, 0.45) 0%, rgba(253, 186, 116, 0.2) 100%);
    padding: 1px 7px;
    border-radius: 6px;
}

.search-sub-text {
    color: #64748B;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    max-width: 680px;
}

/* Dedicated Search Bar: Hidden on Desktop (since header search is always active), Visible on Phone/Mobile */
.search-mobile-bar-container {
    display: none;
    margin-top: 14px;
    width: 100%;
}

.search-mobile-form {
    width: 100%;
}

.search-input-capsule {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 2px solid #CBD5E1;
    border-radius: 14px;
    padding: 4px 4px 4px 13px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    box-sizing: border-box;
}

.search-input-capsule:focus-within {
    border-color: #F97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16), 0 8px 20px rgba(249, 115, 22, 0.08);
    transform: translateY(-1px);
}

.search-capsule-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    margin-right: 10px;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.search-input-capsule:focus-within .search-capsule-icon {
    color: #EA580C;
    transform: scale(1.1);
}

.search-capsule-field {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #0F172A;
    padding: 8px 0;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* Suppress native browser clear buttons so only our single custom cross button is shown */
.search-capsule-field::-webkit-search-decoration,
.search-capsule-field::-webkit-search-cancel-button,
.search-capsule-field::-webkit-search-results-button,
.search-capsule-field::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.search-capsule-field::-ms-clear,
.search-capsule-field::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

.search-capsule-field::placeholder {
    color: #94A3B8;
    font-weight: 400;
}

.search-capsule-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #F1F5F9;
    color: #64748B;
    text-decoration: none;
    margin-right: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.search-capsule-clear:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.search-capsule-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: #381519;
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(56, 21, 25, 0.25);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-capsule-btn:hover {
    background: #4a1c21;
    transform: translateY(-1px);
}

.search-capsule-btn:active {
    transform: translateY(0);
}

.listing-toolbar-v4 {
    padding: 14px 17px;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 13px rgba(16, 24, 40, .05);
}

.listing-toolbar-v4 .lt-count strong {
    color: var(--navy-900);
}

.category-product-grid-v4 .product-card {
    border: 0;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .07);
}

.category-product-grid-v4 .product-card:hover {
    border: 0;
    box-shadow: 0 15px 30px rgba(16, 24, 40, .13);
}

/* ============================ Responsive ============================ */
@media (max-width: 1099px) {
    .category-directory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .category-directory-hero-inner {
        min-height: 560px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 23px;
        padding-top: 34px;
        padding-bottom: 38px;
    }

    .category-directory-copy h1 {
        font-size: 30px;
    }

    .category-directory-copy p {
        font-size: 13px;
        margin-top: 12px;
    }

    .category-directory-pills {
        gap: 6px;
        margin-top: 18px;
    }

    .category-directory-pills span {
        font-size: 13px;
        padding: 6px 8px;
    }

    .category-directory-pills strong {
        font-size: 13px;
    }

    .category-directory-collage {
        width: 100%;
        max-width: 380px;
        height: 218px;
        margin: 0 auto;
    }

    .directory-collage-photo {
        border-width: 4px;
        border-radius: 15px;
    }

    .collage-photo-one {
        top: 29px;
        height: 155px;
    }

    .collage-photo-two {
        top: 0;
        height: 126px;
    }

    .collage-photo-three {
        height: 107px;
    }

    .directory-collage-badge {
        left: 39%;
        top: 77px;
        width: 70px;
        height: 70px;
        font-size: 18px;
    }

    .directory-collage-badge small {
        font-size: 11px;
        margin-top: 4px;
    }

    .category-directory-body {
        padding: 48px 0 61px;
    }

    .category-directory-v4 {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .category-directory-body {
        padding: 20px 0 36px;
        overflow-x: hidden;
    }

    .category-directory-section-head {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 18px;
        width: 100%;
    }

    .category-directory-section-head h1,
    .category-directory-section-head h2 {
        font-size: 22px !important;
        line-height: 1.2;
        word-break: break-word;
    }

    .category-directory-section-head p {
        font-size: 12.5px;
        line-height: 1.45;
        max-width: 100%;
        margin: 4px 0 0;
    }

    .category-directory-section-head>div:last-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: 6px;
    }

    .category-directory-section-head .home-view-all {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .category-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .directory-category-card {
        border-radius: 15px;
    }

    .directory-category-media {
        aspect-ratio: 1.12;
    }

    .directory-category-icon {
        left: 8px;
        bottom: 8px;
        width: 29px;
        height: 29px;
        border-radius: 8px;
    }

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

    .directory-category-arrow {
        right: 8px;
        bottom: 8px;
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    .directory-category-body {
        padding: 10px 9px 11px;
    }

    .directory-category-body strong {
        font-size: 13px;
    }

    .directory-category-body span {
        font-size: 12px;
        margin-top: 4px;
    }

    .category-directory-cta {
        display: block;
        margin-top: 37px;
        padding: 22px 18px;
        border-radius: 17px;
    }

    .category-directory-cta h2 {
        font-size: 21px;
    }

    .category-directory-cta p {
        font-size: 13px;
        line-height: 1.5;
    }

    .category-directory-cta .btn {
        margin-top: 16px;
        width: 100%;
    }

    .listing-category-hero-v4 {
        min-height: 144px;
        gap: 12px;
        padding: 20px 0 18px;
    }

    .listing-category-photo-v4 {
        width: 78px;
        height: 78px;
        border-radius: 17px;
    }

    .listing-category-photo-v4>span {
        left: 6px;
        bottom: 6px;
        width: 26px;
        height: 26px;
        border-radius: 8px;
    }

    .listing-category-photo-v4>span img {
        width: 17px;
        height: 17px;
    }

    .listing-category-hero-v4 .cat-hero-text h1 {
        font-size: 22px;
    }

    .listing-category-hero-v4 .cat-hero-text p {
        font-size: 12.5px;
        line-height: 1.45;
    }

    .listing-category-back-v4 {
        display: none !important;
    }

    /* Mobile Responsive Search Hero */
    .listing-search-hero-v4 {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        padding: 16px 14px 18px;
        border-radius: 18px;
        gap: 12px;
    }

    .listing-search-icon-v4 {
        display: none;
        /* Hide top corner icon on mobile to dedicate 100% width to search input */
    }

    /* Mobile Responsive Search Page Header */
    .search-page-header {
        margin-bottom: 16px;
    }

    .search-header-shell {
        padding: 4px 0 16px;
        border-radius: 0;
    }

    .search-header-top {
        margin-bottom: 8px;
    }

    .search-cat-shortcut {
        display: none !important;
    }

    .search-main-heading {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .search-sub-text {
        font-size: 12.5px;
        line-height: 1.45;
    }

    .search-mobile-bar-container {
        display: block;
        /* Visible on mobile */
        margin-top: 12px;
    }

    .search-input-capsule {
        padding: 4px 4px 4px 12px;
        border-radius: 12px;
    }

    .search-capsule-field {
        font-size: 14.5px;
        padding: 7px 0;
    }

    .search-capsule-btn {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 9px;
    }

    .search-capsule-btn svg {
        display: none;
    }

    .listing-toolbar-v4 {
        padding: 10px;
        gap: 8px;
    }

    .listing-toolbar-v4 .lt-count {
        font-size: 13px;
    }

    .listing-toolbar-v4 .lt-sort select {
        padding: 8px 10px;
        font-size: 12.5px;
    }

    .category-product-grid-v4 {
        gap: 10px;
    }

    .category-product-grid-v4 .product-card {
        border-radius: 14px;
    }

    .category-product-grid-v4 .pc-body {
        padding: 10px 9px 5px;
    }

    .category-product-grid-v4 .pc-name {
        font-size: 13.5px;
    }

    .category-product-grid-v4 .pc-price {
        font-size: 15.5px;
    }

    .category-product-grid-v4 .pc-add {
        padding: 5px 8px 9px;
    }

    .category-product-grid-v4 .pc-add-btn {
        min-height: 35px;
        border-radius: 9px;
        font-size: 12.5px;
        gap: 4px;
    }
}


/* Ensure mobile viewport protection & fixed bottom-nav clearance on all category views */
@media (max-width: 767px) {

    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    .category-directory-v4,
    .category-listing-v4 {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

.category-head-info {
    min-width: 0;
}

.category-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .category-head-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: 8px;
    }
}