/* ==========================================================================
   home.css - for the home page only
   (hero slider, category tiles, promo cards, trust banner,
    buying guides, help card)
   ========================================================================== */

/* --- Hero slider --------------------------------------------------------- */

.hero {
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.hero-track {
    position: relative;
}

.hero-slide {
    display: none;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    min-height: 380px;
}

.hero-slide.active {
    display: block;
    animation: heroFade .4s ease;
}

@keyframes heroFade {
    from { opacity: .35; }
    to   { opacity: 1; }
}

.hero-inner {
    position: relative;
    min-height: 380px;
    padding: 0 12px;
}

.hero-text {
    position: absolute;
    z-index: 4;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13px;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .92);
    color: #0b5e2e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    z-index: 3;
}

.hero-arrow:hover {
    background: #0f7a3c;
    color: #ffffff;
}

.hero-prev { left: 14px; }
.hero-next { right: 14px; }

/* --- Category tiles ------------------------------------------------------ */

.cat-tiles {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 12px;
}

.cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px 8px;
    /* A subtle gradient - very light green towards the bottom */
    background: linear-gradient(180deg, #ffffff 0%, #f7fcf9 100%);
    border: 1px solid #e6ece8;
    border-radius: 14px;
    text-align: center;
    min-height: 108px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(28, 38, 32, .04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

/* The thin green line on top - only visible on hover */
.cat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0f7a3c 0%, #52b788 100%);
    opacity: 0;
    transition: opacity .15s ease;
}

.cat-tile:hover {
    background: linear-gradient(180deg, #ffffff 0%, #eef9f2 100%);
    border-color: #bfe0cd;
    box-shadow: 0 8px 20px rgba(11, 94, 46, .12);
    transform: translateY(-3px);
}

.cat-tile:hover::before {
    opacity: 1;
}

.cat-tile-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #e9f6ed;
    color: #0f7a3c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* A soft halo around the icon */
    box-shadow: 0 0 0 5px #f4fbf7;
    transition: background .15s ease, box-shadow .15s ease;
}

.cat-tile:hover .cat-tile-icon {
    background: #d9efe2;
    box-shadow: 0 0 0 5px #e9f6ed;
}

.cat-tile-name {
    font-size: 12px;
    font-weight: 600;
    color: #1c2620;
    line-height: 1.3;
    transition: color .15s ease;
}

.cat-tile:hover .cat-tile-name {
    color: #0b5e2e;
}

/* When the admin picked their own image, drop the tile's green box -
   the image has its own ring/background. */
.cat-tile-icon:has(.cat-icon-img) {
    background: transparent;
    border-radius: 50%;
}

.cat-tile-icon .cat-icon-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Promo cards --------------------------------------------------------- */

.promo-card {
    position: relative;
    height: 100%;
    min-height: 210px;
    border-radius: 12px;
    overflow: hidden;
    /* This colour only shows when there is no image */
    background: #1c2620;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
}

.promo-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Only a soft dark shade at the top and bottom, so white text stays readable.
   No tint is laid over the whole image. */
.promo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, .55) 0%,
        rgba(0, 0, 0, .12) 42%,
        rgba(0, 0, 0, .12) 58%,
        rgba(0, 0, 0, .55) 100%);
    pointer-events: none;
}

.promo-body {
    position: relative;
    z-index: 1;
}

.promo-card h3 {
    color: #ffffff;
    font-size: 19px;
    margin-bottom: 3px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.promo-card p {
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.promo-btn {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0f7a3c;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 7px;
}

.promo-btn:hover {
    background: #ffffff;
    color: #0b5e2e;
}

/* --- Green banner -------------------------------------------------------- */

.green-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    min-height: 92px;
    padding: 18px 22px;
    border-radius: 10px;
    background: linear-gradient(100deg, #e9f6ed 0%, #cdeddb 60%, #a9e0c2 100%);
    border: 1px solid #cfe8da;
}

.green-banner svg {
    color: #0f7a3c;
    flex-shrink: 0;
}

.green-banner strong {
    display: block;
    font-size: 21px;
    color: #0b5e2e;
    line-height: 1.15;
}

.green-banner span {
    font-size: 13px;
    color: #33503f;
}

/* --- Buying guides ------------------------------------------------------- */

.guide-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e3e8e5;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.guide-card:hover {
    border-color: #0f7a3c;
    box-shadow: 0 6px 18px rgba(11, 94, 46, .1);
}

.guide-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: #f2faf5;
    overflow: hidden;
}

.guide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a9c9b8;
}

.guide-body {
    display: block;
    padding: 12px 14px 14px;
}

.guide-body strong {
    display: block;
    font-size: 14px;
    color: #1c2620;
    line-height: 1.4;
    margin-bottom: 3px;
}

.guide-card:hover .guide-body strong {
    color: #0f7a3c;
}

.guide-body span {
    font-size: 12px;
    color: #6b7b72;
}

/* --- Help card ----------------------------------------------------------- */

.help-card {
    background: linear-gradient(135deg, #0b5e2e 0%, #128a45 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 26px 24px;
    height: 100%;
}

.help-card h2 {
    color: #ffffff;
    font-size: 22px;
    margin-bottom: 8px;
    line-height: 1.25;
}

.help-card p {
    color: #d9f0e2;
    font-size: 14px;
    margin-bottom: 18px;
}

.help-wa {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #25d366;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 11px 20px;
    border-radius: 7px;
    margin-bottom: 20px;
}

.help-wa:hover {
    background: #1db954;
    color: #ffffff;
}

.help-contact {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .22);
    padding-top: 16px;
}

.help-contact > span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-contact svg {
    color: #a9e0c2;
    flex-shrink: 0;
}

.help-contact span span {
    display: block;
    font-size: 12px;
    color: #b9e7cb;
}

.help-contact strong {
    display: block;
    font-size: 14px;
    color: #ffffff;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .cat-tiles {
        grid-template-columns: repeat(5, 1fr);
    }

}

@media (max-width: 991.98px) {
    .hero-slide,
    .hero-inner {
        min-height: 320px;
    }

    .cat-tiles {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 575.98px) {
    .hero-inner {
        min-height: 240px;
        padding: 0 12px;
    }

    .hero-slide {
        min-height: 240px;
    }

    .hero-text {
        bottom: 16px;
    }

    /* On mobile the arrows get smaller and hug the edges,
       so they do not sit on top of the slide's text or button. */
    .hero-arrow {
        width: 30px;
        height: 30px;
        background: rgba(255, 255, 255, .85);
        box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
    }

    .hero-arrow svg {
        width: 15px;
        height: 15px;
    }

    .hero-prev { left: 7px; }
    .hero-next { right: 7px; }

    .cat-tiles {
        grid-template-columns: repeat(3, 1fr);
        gap: 9px;
    }

    .cat-tile {
        min-height: 92px;
        padding: 13px 6px;
    }

    .cat-tile-icon {
        width: 40px;
        height: 40px;
    }

    .cat-tile-icon .cat-icon-img {
        width: 40px;
        height: 40px;
    }

    .cat-tile-name {
        font-size: 11px;
    }

    .green-banner strong {
        font-size: 18px;
    }

    .help-card {
        padding: 22px 18px;
    }

    .help-card h2 {
        font-size: 19px;
    }
}


/* Turn the hero into a card on large screens - mobile stays as it was. */

@media (min-width: 992px) {
    .hero {
        margin: 16px 12px 0;
        border-radius: 14px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, .07);
    }
}
