/* =========================================================
   A1 CASH & CARRY - HOME DEALS (css/home.css)
   Layout: 4 cards on top row, 2 wide cards on bottom row
========================================================= */

.a1-deals-section {
    max-width: 1500px;
    margin: 30px auto;
    padding: 20px;
}

/* ---------- Heading ---------- */
.a1-deals-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
}

.a1-deals-heading span {
    display: block;
    color: #d92b2b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.a1-deals-heading h2 {
    margin: 8px 0 0;
    color: #0a1233;
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    line-height: 1.1;
}

.a1-deals-heading a {
    color: #0a1233;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.a1-deals-heading a:hover {
    color: #e86b00;
}

/* ---------- Grid: 4 columns, wide cards span 2 ---------- */
.a1-deals-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.a1-deal-card.deal-wide {
    grid-column: span 2;
}

/* ---------- Card ---------- */
.a1-deal-card {
    min-width: 0;
    padding: 14px 14px 16px;
    border: 2px solid var(--deal-border);
    border-radius: 14px;
    background: var(--deal-bg);
    overflow: hidden;
}

.a1-deal-card h3 {
    margin: 0 0 6px;
    color: var(--deal-title);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
}

.a1-deal-sub {
    margin: 0 0 14px;
    color: #566178;
    font-size: 14px;
    line-height: 1.4;
}

/* ---------- Colour themes ---------- */
.deal-green  { --deal-border: #7ddba0; --deal-bg: #ebfaf1; --deal-title: #0b5d2e; }
.deal-orange { --deal-border: #f28a2e; --deal-bg: #fff3e8; --deal-title: #c2410c; }
.deal-pink   { --deal-border: #f06292; --deal-bg: #ffe9f2; --deal-title: #b0125a; }
.deal-blue   { --deal-border: #8ec9f5; --deal-bg: #e8f4ff; --deal-title: #0b3a8a; }
.deal-purple { --deal-border: #a78bfa; --deal-bg: #f1ecff; --deal-title: #3b1a99; }
.deal-yellow { --deal-border: #f5d34a; --deal-bg: #fff7d1; --deal-title: #6b4a00; }

/* ---------- Items ---------- */
.a1-deal-items {
    display: grid;
    gap: 14px 10px;
}

.a1-deal-items.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.a1-deal-items.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.a1-deal-item {
    display: block;
    min-width: 0;
    color: #111;
    text-decoration: none;
    cursor: pointer;
}

.a1-deal-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: #f1f1f1;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.a1-deal-items.cols-4 .a1-deal-item img {
    aspect-ratio: 1 / 1;
}

.a1-deal-item:hover img {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.a1-deal-item p {
    margin: 8px 0 0;
    color: #1a2238;
    font-size: 14px;
    line-height: 1.35;
}

/* =========================================================
   CATEGORY RESULTS SECTION
========================================================= */

.category-results {
    max-width: 1500px;
    margin: 35px auto;
    padding: 20px;
    scroll-margin-top: 90px;
}

.category-results[hidden] {
    display: none !important;
}

.category-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.category-results-header h2 {
    margin: 0;
    color: #171717;
    font-size: clamp(22px, 3vw, 30px);
}

#clearCategoryFilter {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #ff8a00;
    color: #111;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

#clearCategoryFilter:hover {
    background: #ffb900;
}

.category-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.category-product-card {
    min-width: 0;
    padding: 12px;
    overflow: hidden;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.category-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.category-product-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f8f8;
}

.category-product-card h3 {
    margin: 12px 0 8px;
    color: #222;
    font-size: 15px;
    line-height: 1.45;
}

.category-product-card .category-product-price {
    margin: 0;
    color: #171717;
    font-size: 17px;
    font-weight: 800;
}

.category-no-products {
    grid-column: 1 / -1;
    padding: 30px 15px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #555;
    text-align: center;
}

/* =========================================================
   RESPONSIVE - TABLET
========================================================= */

@media (max-width: 1000px) {
    .a1-deals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* wide cards take the full row on tablet */
    .a1-deal-card.deal-wide {
        grid-column: 1 / -1;
    }

    .category-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================================
   RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 560px) {
    .a1-deals-section {
        padding: 12px;
        margin: 18px auto;
    }

    .a1-deals-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .a1-deal-card.deal-wide {
        grid-column: auto;
    }

    /* 4 items in a row become 2x2 on phones */
    .a1-deal-items.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .a1-deals-heading {
        align-items: flex-start;
    }

    .a1-deals-heading a {
        font-size: 12px;
    }

    .a1-deal-card h3 {
        font-size: 17px;
    }

    .a1-deal-sub {
        font-size: 13px;
    }

    .a1-deal-item p {
        font-size: 13px;
    }

    .category-results {
        padding: 12px;
        margin: 20px auto;
    }

    .category-results-header {
        align-items: flex-start;
    }

    .category-results-header h2 {
        font-size: 22px;
    }

    .category-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .category-product-card {
        padding: 8px;
    }

    .category-product-card h3 {
        font-size: 13px;
    }

    .category-product-card .category-product-price {
        font-size: 15px;
    }

    #clearCategoryFilter {
        padding: 9px 12px;
        font-size: 12px;
    }
}