
/* ==========================================
   SPRINGFIELD PHARMACY
   PRODUCT RANGES - FINAL RESPONSIVE MOSAIC

   Developed by Venon Digital Solutions
   ========================================== */

.sf-ranges {
    --sf-purple: #23155E;
    --sf-green: #236E3B;
    --sf-muted: #525B55;

    width: 100vw;
    max-width: none;

    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    padding: 60px 0 55px;

    background: #FFFFFF;
    font-family: Inter, Arial, sans-serif;
}

.sf-ranges *,
.sf-ranges *::before,
.sf-ranges *::after {
    box-sizing: border-box;
}


/* ==========================================
   SECTION INTRODUCTION
   ========================================== */

.sf-ranges__heading {
    max-width: 1250px;
    margin: 0 auto 32px;
    padding: 0 30px;
}

.sf-ranges__eyebrow {
    display: block;
    margin-bottom: 12px;

    color: var(--sf-green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.sf-ranges__heading h2 {
    margin: 0 0 12px;

    color: var(--sf-purple);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
}

.sf-ranges__heading p {
    max-width: 650px;
    margin: 0;

    color: var(--sf-muted);
    font-size: 15px;
    line-height: 1.7;
}


/* ==========================================
   DESKTOP MOSAIC
   ========================================== */

.sf-ranges__mosaic {
    display: grid;

    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 235px 270px;

    gap: 6px;
    width: 100%;
}


/* ==========================================
   SHARED CATEGORY TILES
   ========================================== */

.sf-ranges__tile {
    position: relative;

    min-width: 0;
    min-height: 0;

    margin: 0;
    padding: 0;

    overflow: hidden;
    isolation: isolate;

    /* Sharp rectangular edges */
    border: none;
    border-radius: 0;
    clip-path: none;
    box-shadow: none;

    background: #DCE8DF;
}


/* ==========================================
   DESKTOP CATEGORY POSITIONS
   ========================================== */

/* First row */

.sf-ranges__tile--skincare {
    grid-column: span 2;
}

.sf-ranges__tile--vitamins {
    grid-column: span 5;
}

.sf-ranges__tile--mother-baby {
    grid-column: span 2;
}

.sf-ranges__tile--personal-care {
    grid-column: span 3;
}

/* Second row */

.sf-ranges__tile--essentials {
    grid-column: span 6;
}

.sf-ranges__tile--wellbeing {
    grid-column: span 4;
}

.sf-ranges__tile--grooming {
    grid-column: span 2;
}


/* ==========================================
   CATEGORY PHOTOGRAPHY
   ========================================== */

.sf-ranges__media {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

.sf-ranges__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    border-radius: 0;

    /* Gentle zoom-out on hover */
    transform: scale(1.055);

    transition:
        transform 650ms cubic-bezier(.2, .7, .2, 1);
}

.sf-ranges__tile:hover .sf-ranges__image {
    transform: scale(1);
}


/* ==========================================
   IMAGE OVERLAY
   ========================================== */

.sf-ranges__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, .68) 100%
    );

    pointer-events: none;
}


/* ==========================================
   CATEGORY TITLES
   ========================================== */

.sf-ranges__tile-content {
    position: absolute;

    left: 20px;
    right: 15px;
    bottom: 20px;

    z-index: 2;
}

.sf-ranges__tile h3 {
    margin: 0;

    color: #FFFFFF !important;
    font-size: clamp(14px, 1.25vw, 20px);
    font-weight: 750;
    line-height: 1.3;

    text-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}


/* ==========================================
   PRODUCT ENQUIRY CONTACT STRIP
   ========================================== */

.sf-ranges__contact {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    max-width: 1250px;
    margin: 0 auto;

    padding: 28px 30px 0;
}

.sf-ranges__contact p {
    max-width: 650px;
    margin: 0;

    color: var(--sf-muted);
    font-size: 14px;
    line-height: 1.65;
}

.sf-ranges__contact a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 10px;
    flex-shrink: 0;

    min-height: 44px;
    padding: 12px 20px;

    background: var(--sf-green);
    color: #FFFFFF !important;

    border: none;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;

    transition: background 200ms ease;
}

.sf-ranges__contact a:hover {
    background: var(--sf-purple);
    color: #FFFFFF !important;
}

.sf-ranges__contact a:focus-visible {
    outline: 3px solid #59B532;
    outline-offset: 3px;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 1024px) {

    .sf-ranges__mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: 215px;
        gap: 6px;
    }

    /* Clear desktop grid spans */

    .sf-ranges__tile {
        grid-column: auto;
        grid-row: auto;
    }

    .sf-ranges__tile--essentials {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .sf-ranges__tile h3 {
        font-size: 18px;
    }

}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 767px) {

    .sf-ranges {
        padding: 38px 0 42px;
    }

    .sf-ranges__heading {
        margin-bottom: 24px;
        padding: 0 16px;
    }

    .sf-ranges__eyebrow {
        margin-bottom: 10px;
        font-size: 10px;
        letter-spacing: 1.1px;
    }

    .sf-ranges__heading h2 {
        margin-bottom: 12px;
        font-size: clamp(27px, 7vw, 34px);
        line-height: 1.2;
    }

    .sf-ranges__heading p {
        font-size: 14px;
        line-height: 1.65;
    }

    /*
     * Mobile:
     * Two equal-width columns.
     * Three paired rows, followed by
     * one full-width Pharmacy Essentials tile.
     */

    .sf-ranges__mosaic {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: 170px;

        gap: 5px;
        width: 100%;
    }

    /*
     * Reset ALL desktop/tablet placement.
     * This prevents orphaned tiles and gaps.
     */

    .sf-ranges__mosaic > .sf-ranges__tile {
        grid-column: auto;
        grid-row: auto;

        width: 100%;
        min-width: 0;
        height: 100%;
    }

    /*
     * Pair 1:
     * Skincare | Vitamins
     */

    .sf-ranges__tile--skincare {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .sf-ranges__tile--vitamins {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    /*
     * Pair 2:
     * Mother & Baby | Personal Care
     */

    .sf-ranges__tile--mother-baby {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .sf-ranges__tile--personal-care {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    /*
     * Pair 3:
     * Health & Wellbeing | Grooming
     */

    .sf-ranges__tile--wellbeing {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    .sf-ranges__tile--grooming {
        grid-column: 2 !important;
        grid-row: 3 !important;
    }

    /*
     * Full-width final tile:
     * Pharmacy Essentials
     */

    .sf-ranges__tile--essentials {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        height: 205px;
    }

    .sf-ranges__mosaic {
        grid-template-rows:
            170px
            170px
            170px
            205px;
    }

    /* Image treatment */

    .sf-ranges__image {
        object-fit: cover;
        object-position: center;
    }

    .sf-ranges__tile-content {
        left: 12px;
        right: 10px;
        bottom: 13px;
    }

    .sf-ranges__tile h3 {
        font-size: clamp(13px, 3.6vw, 16px);
        line-height: 1.25;
        font-weight: 750;
    }

    .sf-ranges__tile--essentials h3 {
        font-size: 18px;
    }


    /* ======================================
       MOBILE CONTACT SECTION
       ====================================== */

    .sf-ranges__contact {
        display: flex;
        flex-direction: column;

        align-items: flex-start;
        justify-content: flex-start;

        gap: 14px;

        padding: 22px 16px 0;
    }

    .sf-ranges__contact p {
        font-size: 13px;
        line-height: 1.6;
    }

    .sf-ranges__contact a {
        width: auto;
        min-height: 42px;

        padding: 11px 18px;

        border-radius: 5px;

        font-size: 13px;
        font-weight: 700;
    }

}


/* ==========================================
   SMALL MOBILE PHONES
   ========================================== */

@media (max-width: 380px) {

    .sf-ranges__mosaic {
        grid-template-rows:
            150px
            150px
            150px
            190px;
    }

    .sf-ranges__tile h3 {
        font-size: 12px;
    }

    .sf-ranges__tile--essentials h3 {
        font-size: 17px;
    }

}


/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .sf-ranges__image {
        transition: none;
        transform: none;
    }

}
