/* =============================================================================
   HARRINGTON SAFETY — PRODUCTS GRID v3.0
   Matched to harringtonsafety.co.uk theme
   ============================================================================= */

:root {
    --hsg-primary:       #2c4063;
    --hsg-primary-light: #337ab7;
    --hsg-primary-dark:  #1a2a44;
    --hsg-accent:        #fdb913;
    --hsg-accent-light:  #fdd55a;
    --hsg-text:          #1a2a44;
    --hsg-text-muted:    #666666;
    --hsg-bg:            #f9f9f9;
    --hsg-white:         #ffffff;
    --hsg-border:        #e5e5e5;
    --hsg-shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.08);
    --hsg-shadow-md:     0 4px 12px rgba(0, 0, 0, 0.1);
    --hsg-shadow-lg:     0 8px 24px rgba(0, 0, 0, 0.12);
    --hsg-shadow-xl:     0 12px 36px rgba(0, 0, 0, 0.14);
    --hsg-radius:        2px;
    --hsg-radius-lg:     4px;
    --hsg-transition:    0.3s ease;
}


/* Container */
.hsg-products-page {
    font-family: 'Open Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    color: var(--hsg-text);
}


/* -----------------------------------------------------------------------------
   Content Sections
   ----------------------------------------------------------------------------- */
.hsg-section {
    margin-bottom: 32px;
}

.hsg-section__heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--hsg-primary);
    margin: 0 0 14px 0;
    letter-spacing: 0.01em;
    position: relative;
    padding-bottom: 12px;
}

.hsg-section__heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--hsg-accent);
}

.hsg-section p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--hsg-text-muted);
    margin: 0 0 14px 0;
}

.hsg-section p:last-child {
    margin-bottom: 0;
}


/* -----------------------------------------------------------------------------
   Filter Pills
   ----------------------------------------------------------------------------- */
.hsg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.hsg-filter-pill {
    background: var(--hsg-white);
    border: 2px solid var(--hsg-border);
    padding: 10px 22px;
    border-radius: var(--hsg-radius);
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--hsg-text-muted);
    cursor: pointer;
    transition: var(--hsg-transition);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hsg-filter-pill:hover {
    border-color: var(--hsg-primary-light);
    color: var(--hsg-primary);
}

.hsg-filter-pill--active {
    background: var(--hsg-primary) !important;
    color: var(--hsg-white) !important;
    border-color: var(--hsg-primary) !important;
}


/* -----------------------------------------------------------------------------
   Product Cards Grid
   ----------------------------------------------------------------------------- */
.hsg-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}


/* -----------------------------------------------------------------------------
   Product Card
   ----------------------------------------------------------------------------- */
.hsg-product-card {
    background: var(--hsg-white);
    border-radius: var(--hsg-radius-lg);
    border: 1px solid var(--hsg-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--hsg-transition);
    animation: hsgFadeInUp 0.5s ease forwards;
}

.hsg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hsg-shadow-xl);
    border-color: var(--hsg-primary-light);
}

/* Badge */
.hsg-product-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 12px;
    border-radius: var(--hsg-radius);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 2;
}

.hsg-product-card__badge--blue {
    background: var(--hsg-primary-light);
    color: var(--hsg-white);
}

.hsg-product-card__badge--green {
    background: #28a745;
    color: var(--hsg-white);
}

.hsg-product-card__badge--gold {
    background: var(--hsg-accent);
    color: var(--hsg-primary-dark);
}

/* Image / Icon Area */
.hsg-product-card__image-wrap {
    height: 190px;
    overflow: hidden;
    background: var(--hsg-bg);
}

.hsg-product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hsg-product-card:hover .hsg-product-card__image {
    transform: scale(1.04);
}

.hsg-product-card__icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hsg-primary);
    position: relative;
    overflow: hidden;
}

.hsg-product-card__icon-placeholder::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(253, 185, 19, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    top: -30px;
    right: -30px;
}

.hsg-product-card__icon-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--hsg-accent);
}

.hsg-product-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.hsg-product-card__icon svg {
    width: 64px;
    height: 64px;
}

.hsg-product-card:hover .hsg-product-card__icon {
    transform: scale(1.1);
}

/* Body */
.hsg-product-card__body {
    padding: 20px 22px 14px;
    flex-grow: 1;
}

.hsg-product-card__category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hsg-primary-light);
    margin-bottom: 8px;
}

.hsg-product-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hsg-primary-dark);
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.hsg-product-card__excerpt {
    font-size: 13px;
    color: var(--hsg-text-muted);
    line-height: 1.65;
    margin: 0;
}

/* Footer */
.hsg-product-card__footer {
    padding: 14px 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--hsg-border);
    margin-top: auto;
}

.hsg-product-card__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--hsg-primary);
}

.hsg-product-card__price--contact {
    font-size: 12px;
    font-weight: 600;
    color: var(--hsg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hsg-product-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--hsg-primary-light) !important;
    color: var(--hsg-white) !important;
    padding: 10px 18px;
    border-radius: var(--hsg-radius);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: var(--hsg-transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hsg-product-card__btn:hover {
    background: var(--hsg-primary) !important;
    color: var(--hsg-white) !important;
    text-decoration: none !important;
}

.hsg-product-card__btn svg {
    transition: transform 0.3s ease;
}

.hsg-product-card__btn:hover svg {
    transform: translateX(3px);
}


/* -----------------------------------------------------------------------------
   FAQ Accordion
   ----------------------------------------------------------------------------- */
.hsg-faqs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hsg-faq {
    background: var(--hsg-white);
    border: 1px solid var(--hsg-border);
    border-radius: var(--hsg-radius-lg);
    overflow: hidden;
    transition: var(--hsg-transition);
}

.hsg-faq:hover {
    border-color: #ccc;
}

.hsg-faq--open {
    border-color: var(--hsg-primary-light);
    box-shadow: var(--hsg-shadow-md);
}

.hsg-faq__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Open Sans', sans-serif;
    transition: var(--hsg-transition);
}

.hsg-faq__question:hover {
    background: var(--hsg-bg);
}

.hsg-faq__question-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--hsg-text);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.hsg-faq--open .hsg-faq__question-text {
    color: var(--hsg-primary);
}

.hsg-faq__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hsg-bg);
    color: var(--hsg-text-muted);
    transition: var(--hsg-transition);
}

.hsg-faq--open .hsg-faq__icon {
    background: var(--hsg-primary);
    color: var(--hsg-white);
    transform: rotate(180deg);
}

.hsg-faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    padding: 0 22px;
}

.hsg-faq--open .hsg-faq__answer {
    max-height: 500px;
    padding: 0 22px 22px;
    opacity: 1;
}

.hsg-faq__answer p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--hsg-text-muted);
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--hsg-border);
}


/* -----------------------------------------------------------------------------
   Animations
   ----------------------------------------------------------------------------- */
@keyframes hsgFadeInUp {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hsg-product-card:nth-child(1) { animation-delay: 0.05s; }
.hsg-product-card:nth-child(2) { animation-delay: 0.1s; }
.hsg-product-card:nth-child(3) { animation-delay: 0.15s; }
.hsg-product-card:nth-child(4) { animation-delay: 0.2s; }
.hsg-product-card:nth-child(5) { animation-delay: 0.25s; }
.hsg-product-card:nth-child(6) { animation-delay: 0.3s; }
.hsg-product-card:nth-child(7) { animation-delay: 0.35s; }
.hsg-product-card:nth-child(8) { animation-delay: 0.4s; }


/* -----------------------------------------------------------------------------
   Responsive — Tablet
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .hsg-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}


/* -----------------------------------------------------------------------------
   Responsive — Mobile
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .hsg-products-page {
        padding: 0 15px;
    }

    .hsg-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hsg-section__heading {
        font-size: 19px;
    }

    .hsg-section p {
        font-size: 14px;
    }

    .hsg-filters {
        width: 100%;
        gap: 6px;
    }

    .hsg-filter-pill {
        padding: 8px 14px;
        font-size: 11px;
        flex: 1;
        text-align: center;
    }

    .hsg-product-card__image-wrap {
        height: 170px;
    }

    .hsg-product-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hsg-product-card__btn {
        justify-content: center;
        padding: 12px 18px;
    }

    .hsg-faq__question {
        padding: 14px 16px;
        gap: 12px;
    }

    .hsg-faq__question-text {
        font-size: 14px;
    }

    .hsg-faq__icon {
        width: 28px;
        height: 28px;
    }

    .hsg-faq__answer {
        padding: 0 16px;
    }

    .hsg-faq--open .hsg-faq__answer {
        padding: 0 16px 18px;
    }

    .hsg-faq__answer p {
        font-size: 13px;
    }
}


/* Print */
@media print {
    .hsg-filters { display: none; }

    .hsg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hsg-product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .hsg-faq__answer {
        max-height: none;
        opacity: 1;
        padding: 0 22px 14px;
    }
}
