/*
 * TOWNWAY HOME SHOWCASE V1
 *
 * Visual-only homepage layer.
 * Existing header, product cards, cart, wishlist and API remain intact.
 */

.tw-showcase-home {
    --tw-navy: #11185f;
    --tw-blue: #2027b7;
    --tw-purple: #4c35e8;
    --tw-text: #11183f;
    --tw-muted: #6f7891;
    --tw-border: #e5e8f2;
    --tw-soft: #f7f8fc;

    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 18px 20px 44px;
    background: linear-gradient(180deg, #fbfbff 0, #f7f8fc 100%);
}

.tw-showcase-layout {
    display: grid;
    grid-template-columns: minmax(300px, 27%) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.tw-showcase-rail {
    min-width: 0;
    border: 1px solid var(--tw-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(24, 34, 88, .06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tw-showcase-rail__scroll {
    max-height: 730px;
    overflow-y: auto;
    padding: 13px 11px 4px;
    scrollbar-width: thin;
    scrollbar-color: #aeb4c7 transparent;
}

.tw-showcase-rail-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46%;
    min-height: 205px;
    margin-bottom: 11px;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--tw-text) !important;
    isolation: isolate;
}

.tw-showcase-rail-card::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    right: -70px;
    top: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,.42);
    z-index: -1;
}

.tw-showcase-rail-card--fashion {
    background: linear-gradient(135deg, #f7f3ff 0%, #eeedff 100%);
}

.tw-showcase-rail-card--grocery {
    background: linear-gradient(135deg, #f4fbf1 0%, #eaf7ec 100%);
}

.tw-showcase-rail-card--daily {
    background: linear-gradient(135deg, #f2f7ff 0%, #e8f1ff 100%);
}

.tw-showcase-rail-card--fallback {
    background: linear-gradient(135deg, #f7f8ff 0%, #eef0ff 100%);
}

.tw-showcase-rail-card__icon {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: var(--tw-blue);
    font-size: 21px;
    box-shadow: 0 7px 18px rgba(29, 39, 109, .10);
    overflow: hidden;
}

.tw-showcase-rail-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tw-showcase-rail-card__copy {
    align-self: end;
    padding: 80px 10px 22px 20px;
    z-index: 2;
}

.tw-showcase-rail-card__copy strong {
    display: block;
    max-width: 180px;
    margin-bottom: 7px;
    color: var(--tw-text);
    font-size: 20px;
    line-height: 1.14;
    font-weight: 800;
}

.tw-showcase-rail-card__copy small {
    display: block;
    max-width: 180px;
    color: var(--tw-muted);
    font-size: 12px;
    line-height: 1.45;
}

.tw-showcase-rail-card__copy b {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    margin-top: 13px;
    border-radius: 50%;
    background: var(--tw-blue);
    color: #fff;
    font-size: 12px;
}

.tw-showcase-rail-card--grocery .tw-showcase-rail-card__copy b {
    background: #2f7d38;
}

.tw-showcase-rail-card__visual {
    position: relative;
    align-self: stretch;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
}

.tw-showcase-rail-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    padding: 8px 4px 0;
    filter: drop-shadow(0 12px 16px rgba(37, 44, 80, .10));
    transition: transform .2s ease;
}

.tw-showcase-rail-card:hover .tw-showcase-rail-card__visual img {
    transform: scale(1.035);
}

.tw-showcase-view-categories {
    min-height: 54px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-top: 1px solid var(--tw-border);
    color: var(--tw-blue) !important;
    background: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.tw-showcase-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tw-showcase-panel {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--tw-border);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(24, 34, 88, .045);
}

.tw-showcase-featured {
    padding: 15px 15px 13px;
}

.tw-showcase-heading {
    min-height: 50px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.tw-showcase-heading h2 {
    margin: 0 0 3px;
    color: var(--tw-text);
    font-size: 21px;
    line-height: 1.15;
    font-weight: 800;
}

.tw-showcase-heading p {
    margin: 0;
    color: var(--tw-muted);
    font-size: 12px;
}

.tw-showcase-heading > a,
.tw-showcase-heading__actions > a {
    color: var(--tw-blue) !important;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none !important;
}

.tw-showcase-heading__actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tw-showcase-arrow {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    flex: 0 0 35px;
    border-radius: 50%;
    border: 1px solid #e2e5f0;
    background: #fff;
    color: var(--tw-blue);
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(19, 29, 90, .07);
}

.tw-showcase-arrow:hover {
    color: #fff;
    border-color: var(--tw-blue);
    background: var(--tw-blue);
}

.tw-showcase-products {
    min-width: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, calc((100% - 48px) / 5));
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 5px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.tw-showcase-products::-webkit-scrollbar {
    display: none;
}

.tw-showcase-products > * {
    scroll-snap-align: start;
}

.tw-showcase-products .tw-product-card {
    width: 100% !important;
    min-width: 0 !important;
    height: 100%;
    border-radius: 15px !important;
    border: 1px solid #e5e8f2 !important;
    box-shadow: none !important;
    overflow: hidden;
    background: #fff;
}

.tw-showcase-products .tw-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(25, 36, 93, .09) !important;
}

.tw-showcase-products .tw-product-card__media {
    height: 168px !important;
    min-height: 168px !important;
    background: #fafbfe;
}

.tw-showcase-products .tw-product-card__media > a {
    height: 100% !important;
}

.tw-showcase-products .tw-product-card__media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 7px;
}

.tw-showcase-products .tw-product-card__body {
    padding: 9px 10px 10px !important;
}

.tw-showcase-products .tw-product-card__name {
    min-height: 36px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}

.tw-showcase-products .tw-product-card__rating {
    display: none !important;
}

.tw-showcase-products .tw-product-card__bottom {
    margin-top: 6px !important;
    gap: 6px !important;
    align-items: center !important;
}

.tw-showcase-products .tw-product-card__price strong {
    font-size: 14px !important;
}

.tw-showcase-products .tw-product-card__add {
    min-width: 74px !important;
    height: 34px !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

.tw-showcase-essentials {
    padding: 13px 15px 14px;
}

.tw-showcase-heading--compact {
    min-height: 38px;
    margin-bottom: 8px;
}

.tw-showcase-heading--compact h2 {
    font-size: 18px;
}

.tw-showcase-essential-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(90px, 1fr));
    gap: 9px;
}

.tw-showcase-essential {
    min-width: 0;
    height: 97px;
    padding: 8px 5px 7px;
    border: 1px solid #e7e8ee;
    border-radius: 13px;
    background: linear-gradient(180deg, #fbfbff, #f6f7fb);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--tw-text) !important;
    text-decoration: none !important;
    overflow: hidden;
}

.tw-showcase-essential:nth-child(3n + 1) {
    background: #fff8ee;
}

.tw-showcase-essential:nth-child(3n + 2) {
    background: #f8fbef;
}

.tw-showcase-essential:nth-child(3n + 3) {
    background: #f3f8ff;
}

.tw-showcase-essential span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
    border-radius: 12px;
    color: var(--tw-blue);
    font-size: 22px;
    overflow: hidden;
}

.tw-showcase-essential span img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tw-showcase-essential strong {
    max-width: 100%;
    color: var(--tw-text);
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tw-showcase-essential--all {
    background: #f7f6ff !important;
}

/* =========================================================
   ADVERTISEMENT
   ========================================================= */

.tw-showcase-ad {
    position: relative;
    min-height: 132px;
    border-radius: 18px;
    overflow: hidden;
    background: #eff8eb;
    box-shadow: 0 8px 24px rgba(24, 34, 88, .04);
}

.tw-showcase-ad__banner {
    position: relative;
    display: block;
    width: 100%;
    min-height: 132px;
    overflow: hidden;
}

.tw-showcase-ad__banner > img {
    display: block;
    width: 100%;
    height: 132px;
    object-fit: cover;
}

.tw-showcase-ad__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 18px 27px;
    background: linear-gradient(
        90deg,
        rgba(9, 22, 71, .78) 0%,
        rgba(22, 34, 97, .45) 45%,
        rgba(22, 34, 97, .04) 78%
    );
    color: #fff;
}

.tw-showcase-ad__overlay small,
.tw-showcase-ad__copy > small {
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.tw-showcase-ad__overlay strong {
    max-width: 650px;
    font-size: 28px;
    line-height: 1.08;
}

.tw-showcase-ad__overlay em {
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 9px;
    background: #fff;
    color: var(--tw-blue);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.tw-showcase-ad__fallback {
    position: relative;
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 27px;
    color: var(--tw-text) !important;
    text-decoration: none !important;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 120%, rgba(105,166,70,.20), transparent 34%),
        linear-gradient(90deg, #f3faec, #eef8e9 65%, #f5faef);
}

.tw-showcase-ad__fallback::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -80px;
    top: -100px;
    border-radius: 50%;
    background: rgba(75, 139, 54, .08);
}

.tw-showcase-ad__copy {
    position: relative;
    z-index: 2;
}

.tw-showcase-ad__copy strong {
    display: block;
    margin-bottom: 4px;
    color: #1a213c;
    font-size: 27px;
    line-height: 1.08;
    font-weight: 800;
}

.tw-showcase-ad__copy strong b {
    color: #468d35;
    font-weight: 800;
}

.tw-showcase-ad__copy p {
    margin: 0 0 9px;
    color: #606a79;
    font-size: 12px;
}

.tw-showcase-ad__copy em {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 8px;
    background: #438a36;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.tw-showcase-ad__art {
    position: relative;
    z-index: 2;
    width: 250px;
    min-height: 105px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #2e7c31;
}

.tw-showcase-ad__art > i {
    font-size: 64px;
}

.tw-showcase-ad__art b {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #3f9138;
    color: #fff;
    font-size: 22px;
}

.tw-showcase-ad__art small {
    font-size: 11px;
    font-weight: 800;
}

.tw-showcase-ad--between {
    margin: 4px 0 18px;
}

.tw-showcase-ad__fallback--blue {
    color: #fff !important;
    background:
        radial-gradient(circle at 85% 45%, rgba(255,255,255,.13), transparent 28%),
        linear-gradient(105deg, #151d72, #2428ad 55%, #5b50ed);
}

.tw-showcase-ad__fallback--blue .tw-showcase-ad__copy strong,
.tw-showcase-ad__fallback--blue .tw-showcase-ad__copy p {
    color: #fff;
}

.tw-showcase-ad__fallback--blue .tw-showcase-ad__copy p {
    opacity: .76;
}

.tw-showcase-ad__fallback--blue .tw-showcase-ad__copy em {
    color: var(--tw-blue);
    background: #fff;
}

/* =========================================================
   DEALS
   ========================================================= */

.tw-showcase-deals {
    margin-top: 14px;
    padding: 13px 15px 15px;
}

.tw-showcase-deal-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tw-showcase-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff1f1;
    color: #e24a4a;
    font-size: 11px;
    font-weight: 700;
}

.tw-showcase-countdown b {
    font-weight: 800;
}

.tw-showcase-deal-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 11px;
}

.tw-showcase-deal-grid .tw-product-card {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 105px minmax(0, 1fr) !important;
    min-height: 124px;
    border: 1px solid #e6e8f1 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    overflow: hidden;
}

.tw-showcase-deal-grid .tw-product-card__media {
    height: 124px !important;
    min-height: 124px !important;
    background: #fafbfe;
}

.tw-showcase-deal-grid .tw-product-card__media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 7px;
}

.tw-showcase-deal-grid .tw-product-card__body {
    min-width: 0;
    padding: 10px 8px 9px !important;
}

.tw-showcase-deal-grid .tw-product-card__name {
    min-height: 32px;
    font-size: 11px !important;
    line-height: 1.3 !important;
}

.tw-showcase-deal-grid .tw-product-card__rating {
    display: none !important;
}

.tw-showcase-deal-grid .tw-product-card__bottom {
    margin-top: 6px !important;
    gap: 5px !important;
}

.tw-showcase-deal-grid .tw-product-card__price strong {
    font-size: 13px !important;
}

.tw-showcase-deal-grid .tw-product-card__add {
    min-width: 44px !important;
    height: 30px !important;
    padding: 0 7px !important;
    font-size: 10px !important;
    border-radius: 7px !important;
}

/* =========================================================
   MORE CATEGORY ROWS
   ========================================================= */

.tw-showcase-more {
    margin-top: 14px;
}

.tw-showcase-category-row {
    margin-bottom: 14px;
    padding: 14px 15px 15px;
}

.tw-showcase-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tw-showcase-category-title > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f3ff;
    color: var(--tw-blue);
    font-size: 19px;
}

.tw-showcase-category-title > span img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tw-showcase-products--row {
    grid-auto-columns: minmax(190px, calc((100% - 60px) / 6));
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1400px) {
    .tw-showcase-layout {
        grid-template-columns: minmax(280px, 25%) minmax(0, 1fr);
    }

    .tw-showcase-products {
        grid-auto-columns: minmax(185px, calc((100% - 36px) / 4));
    }

    .tw-showcase-essential-grid {
        grid-template-columns: repeat(6, minmax(90px, 1fr));
    }

    .tw-showcase-essential:nth-child(n+7):not(.tw-showcase-essential--all) {
        display: none;
    }

    .tw-showcase-deal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tw-showcase-deal-grid .tw-product-card:nth-child(n+4) {
        display: none !important;
    }
}

@media (max-width: 1050px) {
    .tw-showcase-home {
        padding: 12px 11px 32px;
    }

    .tw-showcase-layout {
        display: block;
    }

    .tw-showcase-rail {
        margin-bottom: 12px;
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .tw-showcase-rail__scroll {
        max-height: none;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 5px;
        scrollbar-width: none;
    }

    .tw-showcase-rail__scroll::-webkit-scrollbar {
        display: none;
    }

    .tw-showcase-rail-card {
        flex: 0 0 300px;
        min-height: 175px;
        margin-bottom: 0;
    }

    .tw-showcase-view-categories {
        margin-top: 8px;
        border: 1px solid var(--tw-border);
        border-radius: 13px;
    }

    .tw-showcase-main {
        gap: 10px;
    }

    .tw-showcase-deal-grid {
        overflow-x: auto;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 280px;
        grid-template-columns: none;
        scrollbar-width: none;
    }

    .tw-showcase-deal-grid .tw-product-card:nth-child(n+4) {
        display: grid !important;
    }
}

@media (max-width: 700px) {
    .tw-showcase-home {
        padding: 8px 7px 24px;
    }

    .tw-showcase-rail-card {
        flex-basis: 260px;
        min-height: 155px;
    }

    .tw-showcase-rail-card__copy {
        padding: 68px 8px 16px 15px;
    }

    .tw-showcase-rail-card__copy strong {
        font-size: 17px;
    }

    .tw-showcase-rail-card__copy small {
        font-size: 10px;
    }

    .tw-showcase-featured,
    .tw-showcase-essentials,
    .tw-showcase-deals,
    .tw-showcase-category-row {
        padding-left: 9px;
        padding-right: 9px;
        border-radius: 15px;
    }

    .tw-showcase-heading {
        min-height: 42px;
    }

    .tw-showcase-heading h2 {
        font-size: 17px;
    }

    .tw-showcase-heading p {
        display: none;
    }

    .tw-showcase-heading__actions .tw-showcase-arrow {
        display: none;
    }

    .tw-showcase-products {
        grid-auto-columns: 70%;
        gap: 9px;
    }

    .tw-showcase-essential-grid {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        scrollbar-width: none;
    }

    .tw-showcase-essential {
        flex: 0 0 92px;
    }

    .tw-showcase-essential:nth-child(n+7):not(.tw-showcase-essential--all) {
        display: flex;
    }

    .tw-showcase-ad,
    .tw-showcase-ad__banner,
    .tw-showcase-ad__fallback {
        min-height: 120px;
    }

    .tw-showcase-ad__banner > img {
        height: 120px;
    }

    .tw-showcase-ad__overlay,
    .tw-showcase-ad__fallback {
        padding: 15px;
    }

    .tw-showcase-ad__overlay strong,
    .tw-showcase-ad__copy strong {
        font-size: 20px;
    }

    .tw-showcase-ad__art {
        display: none;
    }

    .tw-showcase-deal-grid {
        grid-auto-columns: 88%;
    }

    .tw-showcase-products--row {
        grid-auto-columns: 70%;
    }
}


/* =========================================================
   TOWNWAY DEALS ROW DESCRIPTION FIX V1
   Keep product image on left and show full product title/details
   ========================================================= */

.tw-showcase-deal-grid .tw-product-card {
    display: grid !important;
    grid-template-columns: 118px minmax(0, 1fr) !important;
    min-height: 155px !important;
    height: auto !important;
    align-items: stretch !important;
}


/* Force image to stay inside its own left column */
.tw-showcase-deal-grid .tw-product-card__media {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;

    height: 155px !important;
    min-height: 155px !important;

    position: relative !important;
    inset: auto !important;

    overflow: hidden !important;
    background: #fafbfe !important;
}


/* Product image fits inside left column */
.tw-showcase-deal-grid .tw-product-card__media > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.tw-showcase-deal-grid .tw-product-card__media img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;

    object-fit: contain !important;
    object-position: center !important;

    padding: 8px !important;
}


/* Right-side information area */
.tw-showcase-deal-grid .tw-product-card__body {
    width: auto !important;
    min-width: 0 !important;

    padding: 13px 11px 10px !important;

    position: relative !important;

    overflow: visible !important;
}


/* Show FULL product title instead of clipping */
.tw-showcase-deal-grid .tw-product-card__name {
    display: block !important;

    width: 100% !important;

    min-height: 0 !important;
    max-height: none !important;

    margin: 0 0 7px !important;

    color: #11183f !important;

    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: unset !important;

    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
}


/* Keep price and Add button below description */
.tw-showcase-deal-grid .tw-product-card__bottom {
    width: 100% !important;

    margin-top: 8px !important;

    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;

    gap: 7px !important;
}


/* Price should never disappear behind image */
.tw-showcase-deal-grid .tw-product-card__price {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.tw-showcase-deal-grid .tw-product-card__price strong {
    display: block !important;

    font-size: 13px !important;
    line-height: 1.2 !important;
}


/* Add button stays compact */
.tw-showcase-deal-grid .tw-product-card__add {
    flex: 0 0 auto !important;

    min-width: 55px !important;
    height: 32px !important;

    padding: 0 8px !important;

    font-size: 10px !important;
}


/* Discount badge remains over IMAGE only */
.tw-showcase-deal-grid .tw-product-card__discount {
    left: 8px !important;
    right: auto !important;

    max-width: 100px !important;

    font-size: 10px !important;
}


/* Wishlist stays in top-right of whole card */
.tw-showcase-deal-grid .tw-product-card__wish {
    top: 9px !important;
    right: 9px !important;
}


/* Desktop: keep five cards in one row */
@media (min-width: 1401px) {

    .tw-showcase-deal-grid {
        grid-template-columns:
            repeat(5, minmax(0, 1fr)) !important;
    }

}


/* Smaller desktop/tablet */
@media (max-width: 1400px) {

    .tw-showcase-deal-grid .tw-product-card {
        grid-template-columns:
            110px minmax(0, 1fr) !important;
    }

    .tw-showcase-deal-grid
    .tw-product-card__media {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
    }

}


/* Mobile */
@media (max-width: 700px) {

    .tw-showcase-deal-grid .tw-product-card {
        grid-template-columns:
            105px minmax(0, 1fr) !important;

        min-height: 145px !important;
    }

    .tw-showcase-deal-grid
    .tw-product-card__media {
        width: 105px !important;
        min-width: 105px !important;
        max-width: 105px !important;

        height: 145px !important;
        min-height: 145px !important;
    }

}



/* =========================================================
   TOWNWAY SIDEBAR MOBILE CATEGORY V1
   Fashion → Mobiles → Grocery → Daily Needs
   ========================================================= */

.tw-showcase-rail-card--mobile {
    background:
        linear-gradient(
            135deg,
            #eef7ff 0%,
            #e8f0ff 100%
        );
}

.tw-showcase-rail-card--mobile
.tw-showcase-rail-card__icon {
    color: #3156c9;
}

.tw-showcase-rail-card--mobile
.tw-showcase-rail-card__copy b {
    background: #3156c9;
}


/*
 * Four sidebar cards intentionally use
 * vertical scrolling on desktop.
 */
.tw-showcase-rail__scroll {
    max-height: 730px;
    overflow-y: auto;
}



/* =========================================================
   TOWNWAY SIDEBAR IMAGE AUTO CENTER V1
   Automatically fit & center category/product images
   ========================================================= */

.tw-showcase-rail-card__visual {
    position: relative !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    padding: 12px !important;

    overflow: hidden !important;
}


/*
 * Automatically fit image according to the space available.
 *
 * - no crop
 * - original aspect ratio preserved
 * - centered horizontally
 * - centered vertically
 */
.tw-showcase-rail-card__visual img {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 100% !important;
    max-height: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: auto !important;
    padding: 0 !important;

    transform-origin: center center !important;

    filter:
        drop-shadow(
            0 10px 14px
            rgba(37, 44, 80, .08)
        ) !important;
}


/*
 * Keep hover effect centered.
 */
.tw-showcase-rail-card:hover
.tw-showcase-rail-card__visual img {
    transform: scale(1.025) !important;
}


/*
 * Large/tall product photographs can use
 * slightly more of the available card area.
 */
.tw-showcase-rail-card--fashion
.tw-showcase-rail-card__visual,
.tw-showcase-rail-card--mobile
.tw-showcase-rail-card__visual {
    padding: 10px !important;
}


/*
 * Grocery / Daily Needs images may be wider,
 * so allow the full available box.
 */
.tw-showcase-rail-card--grocery
.tw-showcase-rail-card__visual,
.tw-showcase-rail-card--daily
.tw-showcase-rail-card__visual {
    padding: 8px !important;
}


/* Mobile responsive */
@media (max-width: 700px) {

    .tw-showcase-rail-card__visual {
        padding: 8px !important;
    }

}



/* =========================================================
   TOWNWAY SIDEBAR IMAGE AUTO CENTER V1
   Automatically fit & center category/product images
   ========================================================= */

.tw-showcase-rail-card__visual {
    position: relative !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    padding: 12px !important;

    overflow: hidden !important;
}


/*
 * Automatically fit image according to the space available.
 *
 * - no crop
 * - original aspect ratio preserved
 * - centered horizontally
 * - centered vertically
 */
.tw-showcase-rail-card__visual img {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 100% !important;
    max-height: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: auto !important;
    padding: 0 !important;

    transform-origin: center center !important;

    filter:
        drop-shadow(
            0 10px 14px
            rgba(37, 44, 80, .08)
        ) !important;
}


/*
 * Keep hover effect centered.
 */
.tw-showcase-rail-card:hover
.tw-showcase-rail-card__visual img {
    transform: scale(1.025) !important;
}


/*
 * Large/tall product photographs can use
 * slightly more of the available card area.
 */
.tw-showcase-rail-card--fashion
.tw-showcase-rail-card__visual,
.tw-showcase-rail-card--mobile
.tw-showcase-rail-card__visual {
    padding: 10px !important;
}


/*
 * Grocery / Daily Needs images may be wider,
 * so allow the full available box.
 */
.tw-showcase-rail-card--grocery
.tw-showcase-rail-card__visual,
.tw-showcase-rail-card--daily
.tw-showcase-rail-card__visual {
    padding: 8px !important;
}


/* Mobile responsive */
@media (max-width: 700px) {

    .tw-showcase-rail-card__visual {
        padding: 8px !important;
    }

}


/* TOWNWAY MOBILE CHROME HOME FIX V1 START */

/*
 * Townway mobile Chrome correction
 * Important:
 * - desktop > 820px is untouched
 * - fixes 720px Android/Chrome layouts
 * - prevents tiny compressed product cards
 * - keeps Add/View All/arrows visible
 * - makes rows touch-scrollable
 */

@media (max-width: 820px) {

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

    .tw-showcase-home,
    .tw-showcase-layout,
    .tw-showcase-main,
    .tw-showcase-featured,
    .tw-showcase-essentials,
    .tw-showcase-deals,
    .tw-showcase-category-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }


    /* ==========================================
       TOP CATEGORY / PROMO CARDS
       ========================================== */

    .tw-showcase-rail {
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .tw-showcase-rail__scroll {
        display: flex !important;

        width: 100% !important;
        max-width: 100% !important;

        gap: 9px !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 0 2px 7px !important;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;

        scrollbar-width: none;
    }

    .tw-showcase-rail__scroll::-webkit-scrollbar {
        display: none;
    }

    .tw-showcase-rail-card {
        flex: 0 0 min(78vw, 285px) !important;

        width: min(78vw, 285px) !important;
        max-width: min(78vw, 285px) !important;

        min-height: 150px !important;

        scroll-snap-align: start;
    }


    /* ==========================================
       SECTION HEADERS
       ========================================== */

    .tw-showcase-heading {
        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        gap: 8px !important;

        min-width: 0 !important;
    }

    .tw-showcase-heading > div:first-child {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .tw-showcase-heading h2 {
        font-size: 16px !important;
        line-height: 1.2 !important;

        white-space: normal !important;
    }

    .tw-showcase-heading p {
        display: none !important;
    }

    .tw-showcase-heading__actions {
        display: flex !important;
        align-items: center !important;

        gap: 4px !important;

        flex: 0 0 auto !important;

        margin-left: auto !important;
    }

    /*
     * Earlier <=700 rule hides arrows.
     * Restore them for mobile because the user
     * needs every navigation button accessible.
     */
    .tw-showcase-heading__actions .tw-showcase-arrow {
        display: inline-flex !important;

        align-items: center !important;
        justify-content: center !important;

        width: 30px !important;
        height: 30px !important;

        min-width: 30px !important;

        padding: 0 !important;
    }


    /* ==========================================
       FEATURED + CATEGORY PRODUCT ROWS
       ========================================== */

    .tw-showcase-products,
    .tw-showcase-products--row {
        display: grid !important;

        grid-template-columns: none !important;
        grid-auto-flow: column !important;

        /*
         * Around two full cards on common mobile
         * screens instead of 4-5 compressed cards.
         */
        grid-auto-columns: minmax(148px, 46vw) !important;

        gap: 9px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 2px 2px 8px !important;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;

        scrollbar-width: none;
    }

    .tw-showcase-products::-webkit-scrollbar,
    .tw-showcase-products--row::-webkit-scrollbar {
        display: none;
    }


    .tw-showcase-products .tw-product-card,
    .tw-showcase-products--row .tw-product-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;

        overflow: hidden !important;

        scroll-snap-align: start;
    }


    .tw-showcase-products .tw-product-card__media,
    .tw-showcase-products--row .tw-product-card__media {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }


    .tw-showcase-products .tw-product-card__body,
    .tw-showcase-products--row .tw-product-card__body {
        width: 100% !important;
        min-width: 0 !important;

        padding: 9px !important;

        box-sizing: border-box !important;
    }


    .tw-showcase-products .tw-product-card__name,
    .tw-showcase-products--row .tw-product-card__name {
        width: 100% !important;

        min-height: 34px !important;

        font-size: 11px !important;
        line-height: 1.3 !important;

        overflow: hidden !important;
    }


    /* Price + Add button must always fit */
    .tw-showcase-products .tw-product-card__bottom,
    .tw-showcase-products--row .tw-product-card__bottom {
        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        gap: 5px !important;

        min-width: 0 !important;
    }


    .tw-showcase-products .tw-product-card__price,
    .tw-showcase-products--row .tw-product-card__price {
        flex: 1 1 auto !important;

        min-width: 0 !important;
    }


    .tw-showcase-products .tw-product-card__price strong,
    .tw-showcase-products--row .tw-product-card__price strong {
        font-size: 12px !important;

        white-space: nowrap !important;
    }


    /*
     * Keep the complete Add button visible.
     * Do not reduce it to only the cart icon.
     */
    .tw-showcase-products .tw-product-card__add,
    .tw-showcase-products--row .tw-product-card__add {
        flex: 0 0 auto !important;

        width: auto !important;
        min-width: 52px !important;
        max-width: none !important;

        height: 31px !important;

        padding: 0 8px !important;

        font-size: 10px !important;

        white-space: nowrap !important;
    }


    .tw-showcase-products .tw-product-card__add span,
    .tw-showcase-products--row .tw-product-card__add span {
        display: inline !important;
    }


    /* ==========================================
       SHOP BY ESSENTIALS
       ========================================== */

    .tw-showcase-essential-grid {
        display: grid !important;

        grid-template-columns: none !important;
        grid-auto-flow: column !important;

        grid-auto-columns: minmax(105px, 30vw) !important;

        gap: 8px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 2px 2px 8px !important;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;

        scrollbar-width: none;
    }

    .tw-showcase-essential-grid::-webkit-scrollbar {
        display: none;
    }

    .tw-showcase-essential {
        width: 100% !important;
        min-width: 0 !important;

        scroll-snap-align: start;
    }


    /* ==========================================
       DEALS OF THE DAY
       ========================================== */

    .tw-showcase-deal-grid {
        display: grid !important;

        grid-template-columns: none !important;
        grid-auto-flow: column !important;

        /*
         * A deal card remains wide enough for
         * image + price + Add button.
         */
        grid-auto-columns: minmax(270px, 82vw) !important;

        gap: 9px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 2px 2px 8px !important;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;

        scrollbar-width: none;
    }

    .tw-showcase-deal-grid::-webkit-scrollbar {
        display: none;
    }


    .tw-showcase-deal-grid .tw-product-card {
        width: 100% !important;

        min-width: 0 !important;
        max-width: none !important;

        grid-template-columns:
            102px minmax(0, 1fr) !important;

        scroll-snap-align: start;
    }


    .tw-showcase-deal-grid
    .tw-product-card__media {
        width: 102px !important;
        min-width: 102px !important;
        max-width: 102px !important;
    }


    .tw-showcase-deal-grid
    .tw-product-card__body {
        min-width: 0 !important;

        padding: 9px !important;
    }


    .tw-showcase-deal-grid
    .tw-product-card__bottom {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        gap: 5px !important;

        min-width: 0 !important;
    }


    .tw-showcase-deal-grid
    .tw-product-card__add {
        flex: 0 0 auto !important;

        min-width: 55px !important;

        padding-left: 8px !important;
        padding-right: 8px !important;

        white-space: nowrap !important;
    }


    /* ==========================================
       PREVENT OUTER PAGE OVERFLOW
       ========================================== */

    .tw-showcase-main > *,
    .tw-showcase-featured > *,
    .tw-showcase-essentials > *,
    .tw-showcase-deals > *,
    .tw-showcase-category-row > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}


/* Extra-small phones */
@media (max-width: 430px) {

    .tw-showcase-products,
    .tw-showcase-products--row {
        grid-auto-columns:
            minmax(145px, 47vw) !important;
    }

    .tw-showcase-deal-grid {
        grid-auto-columns:
            minmax(260px, 86vw) !important;
    }

    .tw-showcase-essential-grid {
        grid-auto-columns:
            minmax(102px, 31vw) !important;
    }

    .tw-showcase-heading h2 {
        font-size: 15px !important;
    }
}

/* TOWNWAY MOBILE CHROME HOME FIX V1 END */

