
/* ============================================================
   A1 CASH & CARRY
   SHOP BY CATEGORY — REFERENCE DESIGN
============================================================ */

.category-grid,
#categoryGrid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    align-items: start;
}

/* Card */
.category-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border: 0;
    border-radius: 15px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

/* Image container */
.category-image {
    position: relative;
    width: 100%;
    height: 270px;
    overflow: hidden;
    border-radius: 15px;
    background: #e5e7eb;
    isolation: isolate;
}

.category-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.45s ease;
}

.category-card:hover .category-card-image {
    transform: scale(1.06);
}

/* Dark image overlay */
.category-image-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.02) 35%,
        rgba(0, 0, 0, 0.15) 65%,
        rgba(0, 0, 0, 0.58) 100%
    );
}

/* Yellow offer badge */
.category-offer-badge {
    position: absolute;
    z-index: 2;
    left: 11px;
    bottom: 11px;
    max-width: calc(100% - 22px);
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 5px;
    background: #17233d;
    color: #ffb000;
    font-family: "Inter", "Poppins", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Text below the image */
.category-info {
    padding: 15px 5px 4px;
    text-align: center;
    background: transparent;
}

.category-info h3 {
    margin: 0 0 6px;
    color: #17233d;
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.category-info p {
    margin: 0;
    color: #777b84;
    font-family: "Inter", "Poppins", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Fallback if an image cannot load */
.category-image-fallback .category-image {
    background: linear-gradient(135deg, #243451, #64748b);
}

/* Keyboard accessibility */
.category-card:focus-visible {
    outline: 3px solid #d7192d;
    outline-offset: 4px;
}

/* Laptop */
@media (max-width: 1400px) {
    .category-grid,
    #categoryGrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .category-image {
        height: 235px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .category-grid,
    #categoryGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .category-image {
        height: 200px;
        border-radius: 12px;
    }

    .category-info {
        padding-top: 12px;
    }

    .category-info h3 {
        font-size: 17px;
    }

    .category-info p {
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .category-grid,
    #categoryGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-image {
        height: 155px;
        border-radius: 10px;
    }

    .category-offer-badge {
        left: 7px;
        bottom: 7px;
        max-width: calc(100% - 14px);
        padding: 4px 6px;
        font-size: 10px;
    }

    .category-info {
        padding: 10px 2px 2px;
    }

    .category-info h3 {
        margin-bottom: 4px;
        font-size: 15px;
    }

    .category-info p {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* Very small phones */
@media (max-width: 350px) {
    .category-grid,
    #categoryGrid {
        gap: 9px;
    }

    .category-image {
        height: 125px;
    }

    .category-info h3 {
        font-size: 14px;
    }

    .category-info p {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card,
    .category-card-image {
        transition: none;
    }
}



/* Category section heading */
.category-section {
    padding-top: 48px;
    padding-bottom: 48px;
    background: #f5f5f6;
}

.category-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
}

.category-section-heading > div > span {
    display: block;
    margin-bottom: 8px;
    color: #c9142b;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
}

.category-section-heading h2 {
    margin: 0;
    color: #192640;
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: clamp(34px, 3.2vw, 52px);
    font-weight: 700;
    line-height: 1.05;
}

.category-view-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding-bottom: 5px;
    color: #c9142b;
    font-family: "Inter", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.category-view-all:hover {
    color: #921023;
}

@media (max-width: 600px) {
    .category-section {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .category-section-heading {
        margin-bottom: 22px;
    }

    .category-section-heading > div > span {
        font-size: 11px;
    }

    .category-section-heading h2 {
        font-size: 34px;
    }

    .category-view-all {
        gap: 5px;
        font-size: 12px;
    }
}
