/* ======================================================
Project : Sridevi Enterprises
File    : products.css
Purpose : Product catalogue and product details styling.

Author  : Srikar
====================================================== */

/* ===========================================
   Listing and Filter Controls
=========================================== */

.products-page,
.product-details-page {

    background: #F5F7FA;
    min-height: 70vh;

}

.products-header h1,
.product-details-page h1,
.specifications-section h2,
.related-products-section h2 {

    color: #1E4FA3;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;

}

.product-search,
.filter-panel,
.catalog-product-card,
.specifications-section,
.related-products-section {

    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);

}

.product-search {

    padding: 20px;

}

/* ===========================================
   Search Result Highlighting (Products page only)

   The shared search *input* component
   (.search-bar / .search-bar-input / etc.) now
   lives in static/css/components/search.css,
   loaded globally since the navbar reuses it too.
=========================================== */

.search-highlight {

    background: #FFF3C4;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;

}

.filter-drawer {

    background: #ffffff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);

}

.filter-panel {

    padding: 24px;

}

@media (min-width: 992px) {

    .filter-drawer {

        position: sticky;
        top: 100px;

    }

}

.filter-panel-title {

    font-size: 1.25rem;
    color: #1E4FA3;
    margin-bottom: 8px;

}

.offcanvas-header .offcanvas-title {

    font-size: 1.15rem;
    color: #1E4FA3;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;

}

.filter-drawer .offcanvas-header .btn-close {

    width: 44px;
    height: 44px;
    padding: 0;

}

/* ===========================================
   Collapsible Filter Groups
=========================================== */

.filter-group {

    border-bottom: 1px solid #EAECF0;

}

.filter-group:first-of-type {

    border-top: 1px solid #EAECF0;

}

.filter-group-toggle {

    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 14px 2px;
    font-weight: 600;
    color: #1F2937;
    text-align: left;

}

.filter-group-toggle i {

    color: #667085;
    font-size: .85rem;
    transition: transform .2s ease;

}

.filter-group-toggle[aria-expanded="true"] i {

    transform: rotate(180deg);

}

.filter-group-body {

    padding-bottom: 16px;

}

/* ===========================================
   Active Filter Chips
=========================================== */

.active-filters-bar {

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

}

.active-filters-label {

    color: #667085;
    font-size: .9rem;
    font-weight: 600;

}

.filter-chip {

    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #EAF1FB;
    color: #1E4FA3;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease;

}

.filter-chip:hover {

    background: #D6E4F7;
    color: #1E4FA3;

}

.filter-chip i {

    font-size: .75rem;

}

.clear-all-filters-link {

    color: #667085;
    font-size: .875rem;
    text-decoration: underline;
    margin-left: 4px;

}

/* ===========================================
   Toolbar
=========================================== */

.product-list-toolbar {

    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EAECF0;
    gap: 16px;
    scroll-margin-top: 100px;

}

.product-list-count {

    color: #1F2937;
    font-size: 1.05rem;
    font-weight: 600;

}

.filter-toggle-btn {

    display: inline-flex;
    align-items: center;
    white-space: nowrap;

}

.filter-count-badge {

    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 999px;
    background: #1E4FA3;
    color: #ffffff;
    font-size: .75rem;
    font-weight: 700;

}

/* ===========================================
   Product Cards
=========================================== */

.catalog-product-card {

    overflow: hidden;
    display: flex;
    flex-direction: column;

}

.catalog-product-card > img {

    width: 100%;
    height: 190px;
    object-fit: contain;
    background: #F5F7FA;
    padding: 16px;

}

.catalog-product-card-body {

    padding: 20px;
    display: flex;
    flex: 1;
    flex-direction: column;

}

.catalog-product-card h2,
.catalog-product-card h3 {

    color: #1F2937;
    font-size: 1rem;
    font-weight: 600;
    height: 3rem;
    line-height: 1.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

}

.catalog-product-brand,
.catalog-product-meta,
.product-detail-meta,
.product-detail-availability {

    color: #667085;
    font-size: .9rem;

}

.catalog-product-pricing {

    color: #1E4FA3;
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 12px;

}

.catalog-product-card .btn {

    margin-top: auto;

}

.catalog-product-card:hover {

    box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
    transform: translateY(-2px);
    transition: box-shadow .2s ease, transform .2s ease;

}

.catalog-product-card .btn:focus-visible,
.back-link:focus-visible {

    outline: 3px solid #1E4FA3;
    outline-offset: 3px;

}

/* ===========================================
   Product Grid Cards (Products page only)

   Scoped under .product-grid-card, an additive
   modifier class used only in the Products page
   catalog grid, so none of these rules touch the
   shared .catalog-product-card/.catalog-product-brand/
   .catalog-product-pricing classes reused by the
   Similar Products cards and main info panel on
   the Product Details pages (customer + employee).
=========================================== */

.product-grid-card .catalog-product-image-wrap {

    position: relative;
    overflow: hidden;
    height: 208px;
    background: #F5F7FA;

}

.product-grid-card .catalog-product-image {

    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform .25s ease;

}

.product-grid-card .catalog-product-image-wrap--placeholder .catalog-product-image {

    opacity: .82;

}

.product-grid-card:hover .catalog-product-image {

    transform: scale(1.06);

}

.product-grid-card .catalog-product-card-body {

    padding: 22px 20px 20px;
    gap: 3px;

}

.product-grid-card .catalog-product-brand {

    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 2px;

}

.product-grid-card h2 {

    margin-bottom: 4px;

}

.product-grid-card .catalog-product-meta {

    margin-bottom: 10px;

}

.product-grid-card .availability-badge {

    margin-bottom: 10px;

}

.product-grid-card .catalog-product-pricing {

    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 16px;

}

.product-grid-card .catalog-product-cta {

    border-radius: 8px;
    font-weight: 600;
    padding: 10px 16px;
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;

}

.product-grid-card:hover .catalog-product-cta {

    box-shadow: 0 4px 12px rgba(30, 79, 163, .28);

}

/* ===========================================
   Availability Badge
=========================================== */

.availability-badge {

    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;

}

.availability-badge::before {

    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;

}

.availability-badge--in-stock {

    background: #ECFDF3;
    color: #067647;

}

.availability-badge--on-request {

    background: #FFFAEB;
    color: #B54708;

}

.related-products-section .availability-badge {

    margin-bottom: 12px;

}

.empty-state {

    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    color: #667085;
    padding: 48px 24px;
    text-align: center;

}

.empty-state-icon {

    color: #98A2B3;
    font-size: 2.25rem;
    margin-bottom: 16px;

}

.empty-state-title {

    color: #1F2937;
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;

}

.empty-state-suggestions-label {

    font-weight: 600;
    margin-bottom: 8px;

}

.empty-state-suggestions {

    display: inline-block;
    list-style: disc;
    margin: 0 0 24px;
    padding-left: 20px;
    text-align: left;

}

.empty-state-suggestions li {

    margin-bottom: 4px;

}

.empty-state-suggestions a {

    color: #1E4FA3;

}

.empty-state-actions {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

}

.product-pagination {

    margin-top: 36px;

}

.product-pagination .pagination {

    gap: 6px;
    row-gap: 10px;
    flex-wrap: wrap;

}

.product-pagination .page-item .page-link {

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 42px;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #D0D5DD;
    border-radius: 8px;
    color: #1F2937;
    font-weight: 500;

}

.product-pagination .page-link-nav {

    padding: 0 18px;
    font-weight: 600;

}

.product-pagination .page-item.active .page-link {

    background: #1E4FA3;
    border-color: #1E4FA3;
    color: #ffffff;
    font-weight: 700;

}

.product-pagination .page-item:not(.disabled):not(.active) .page-link:hover {

    background: #EAF1FB;
    border-color: #1E4FA3;
    color: #1E4FA3;

}

.product-pagination .page-item.disabled .page-link {

    background: #F5F7FA;
    border-color: #EAECF0;
    color: #98A2B3;

}

.product-pagination .page-link:focus-visible {

    outline: 3px solid #1E4FA3;
    outline-offset: 2px;
    z-index: 1;

}

@media (max-width: 575.98px) {

    .product-pagination .page-item .page-link {

        min-width: 44px;
        height: 44px;

    }

}

/* ===========================================
   Customer Enquiry
=========================================== */

.enquiry-form-wrapper {

    max-width: 760px;
    margin: 0 auto;
    padding: 36px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);

}

.enquiry-form-wrapper h1 {

    margin-top: 24px;

}

.enquiry-success > i {

    color: #198754;
    font-size: 3.5rem;

}

/* ===========================================
   Contact Page
=========================================== */

.contact-page {

    background: #F5F7FA;

}

.contact-hero,
.contact-main-content,
.contact-map-section,
.contact-faq-section {

    margin-bottom: 48px;

}

.contact-hero h1,
.contact-page h2 {

    color: #1E4FA3;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;

}

.contact-information-card,
.contact-form-card {

    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: 32px;

}

.contact-information-card address,
.contact-information-card p {

    display: grid;
    gap: 4px;
    margin: 0 0 20px;

}

.contact-information-card a {

    color: #1E4FA3;
    overflow-wrap: anywhere;

}

.contact-map-placeholder {

    align-items: center;
    background: linear-gradient(135deg, #1E4FA3, #0F2E6E);
    border-radius: 14px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    font-size: 1.1rem;
    gap: 12px;
    justify-content: center;
    min-height: 320px;

}

.contact-map-placeholder i {

    font-size: 2.5rem;

}

.contact-faq-section .accordion-item {

    border-color: #D0D5DD;

}

/* ===========================================
   Product Details
=========================================== */

.back-link {

    color: #1E4FA3;
    text-decoration: none;

}

.pd-back-link {

    display: inline-block;
    margin-bottom: 8px;

}

.product-main-image {

    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 14px;
    padding: 30px;

}

.product-details-page .product-main-image {

    background: #F5F7FA;
    transition: opacity 150ms ease;

}

.product-details-page .product-main-image--placeholder {

    opacity: .82;

}

.product-details-page .product-main-image.is-fading {

    opacity: 0;

}

.product-gallery {

    display: flex;
    gap: 12px;
    margin-top: 16px;

}

.product-details-page .product-gallery {

    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;

}

.product-gallery img {

    width: 76px;
    height: 76px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #D0D5DD;
    border-radius: 8px;
    padding: 6px;

}

.product-details-page .product-gallery img {

    flex-shrink: 0;

}

.product-gallery-thumb {

    border: none;
    background: none;
    padding: 0;
    line-height: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 150ms ease, transform 150ms ease;

}

.product-gallery-thumb:hover:not(.is-active) {

    box-shadow: 0 0 0 2px #D0D5DD;

}

.product-gallery-thumb.is-active {

    box-shadow: 0 0 0 2px #1E4FA3;
    transform: scale(1.05);

}

.product-gallery-thumb:focus-visible {

    outline: 2px solid #1E4FA3;
    outline-offset: 2px;

}

.product-facts,
.specifications-list {

    margin: 28px 0;

}

.product-facts div,
.specifications-list div {

    display: grid;
    grid-template-columns: minmax(120px, 1fr) 2fr;
    border-bottom: 1px solid #EAECF0;
    padding: 12px 0;

}

.product-facts dt,
.specifications-list dt {

    color: #475467;

}

.product-facts dd,
.specifications-list dd {

    color: #1F2937;
    margin: 0;

}

.product-details-page .specifications-list {

    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0;
    column-gap: 48px;

}

@media (min-width: 768px) {

    .product-details-page .specifications-list {

        grid-template-columns: repeat(2, 1fr);

    }

}

.specifications-section,
.related-products-section {

    margin-top: 48px;
    padding: 32px;

}

.product-details-page .specifications-section {

    margin-top: 56px;

}

.product-details-page .related-products-section {

    margin-top: 64px;

}

/* ===========================================
   Mobile
=========================================== */

.product-hero-info .catalog-product-brand {

    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;

}

.product-hero-info h1 {

    margin-bottom: 10px;

}

.product-hero-info .product-detail-meta {

    margin-bottom: 16px;

}

.product-hero-info .availability-badge {

    margin-bottom: 16px;

}

.product-hero-info .catalog-product-pricing {

    margin-bottom: 0;

}

.product-hero-info .product-facts {

    margin-top: 20px;
    margin-bottom: 0;

}

.product-hero-cta {

    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #EAECF0;

}

@media (max-width: 991.98px) {

    .product-details-page .product-main-image {

        height: 340px;

    }

    /*
     * v1.0 Sprint 11 (RC-4) - fixes 12px of horizontal page overflow on the
     * customer Product Details page below 576px.
     *
     * Bootstrap's .g-5 sets --bs-gutter-x: 3rem, which gives .row a
     * margin of 0 -24px. Its parent .container only has 12px of padding,
     * so the row hangs 12px past the viewport on each side. The row has no
     * background, so nothing looks wrong - it just silently widens
     * scrollWidth and the whole page scrolls sideways.
     *
     * Only --bs-gutter-x is reset; --bs-gutter-y stays at .g-5's 3rem, so
     * the vertical gap between the stacked image and info columns is
     * unchanged. This is scoped to max-width 991.98px because that is the
     * lg breakpoint at which these .col-lg-6 columns stop sitting side by
     * side - once they are stacked and full width, the horizontal gutter
     * has no visual job left to do, so removing the overhang is inert:
     * the row's negative margin and the columns' padding shrink together,
     * leaving column content on exactly the same pixel as before.
     * Desktop (>=992px) never sees this rule and is byte-identical.
     *
     * .product-details-page .row.g-5 matches exactly one element in the
     * app (customer/product_details.html's hero row) - the shared
     * .product-details-page wrapper on enquiry_form/enquiry_success has no
     * g-5 row, and employee/product_details.html is a different wrapper.
     */
    .product-details-page .row.g-5 {

        --bs-gutter-x: 1.5rem;

    }

}

@media (max-width: 767.98px) {

    .product-main-image {

        height: 300px;

    }

    .product-details-page .product-main-image {

        height: 300px;

    }

    .product-hero-cta .btn {

        width: 100%;

    }

    .enquiry-form-wrapper {

        padding: 24px;

    }

    .contact-information-card,
    .contact-form-card {

        padding: 24px;

    }

}
