 /* =====================================================
   CATALOGUE LAYOUT
   Matches How To Order template: 1240px max-width
===================================================== */

.catalogue-ajax,
.catalogue-ajax * {
    box-sizing: border-box;
}

.catalogue-ajax {
    width: min(calc(100% - 48px), 1240px);
    max-width: 1240px;
    margin: 42px auto;
    padding: 0;
    font-family: inherit;
    color: #202938;
}

.catalogue-ajax h1 {
    margin: 0 0 28px;
    padding: 0;
    font-size: clamp(27px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    color: #202938;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Search and sorting */

.catalogue-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 14px;
    margin: 0 0 24px;
}

.catalogue-controls input,
.catalogue-controls select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 15px;
    border: 1px solid #dfe3e8;
    border-radius: 9px;
    background: #fff;
    color: #273142;
    font: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.catalogue-controls input:focus,
.catalogue-controls select:focus {
    border-color: #246bfd;
    box-shadow: 0 0 0 3px rgb(36 107 253 / 12%);
}

.catalogue-count {
    margin: 0 0 18px;
    padding: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* =====================================================
   PRODUCT GRID
===================================================== */

.catalogue-product-list {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.catalogue-product-list li {
    display: flex;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e8ebf0;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(20 35 60 / 4%);
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.catalogue-product-list li:hover {
    transform: translateY(-4px);
    border-color: #d7e2ff;
    box-shadow: 0 12px 28px rgb(20 35 60 / 10%);
}

.catalogue-product-list a {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.catalogue-product-list a:focus-visible {
    outline: 3px solid #246bfd;
    outline-offset: -3px;
}

.catalogue-product-image {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 12px;
    object-fit: contain;
    object-position: center;
    background: #f7f8fb;
    transition: transform .25s ease;
}

.catalogue-product-list li:hover .catalogue-product-image {
    transform: scale(1.025);
}

.catalogue-product-content {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: stretch;
    border-top: 1px solid #f0f2f6;
}

.catalogue-product-name {
    display: -webkit-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    margin: 0;
    padding: 15px 16px 17px;
    color: #202938;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.catalogue-product-list a:hover .catalogue-product-name {
    color: #246bfd;
}

/* =====================================================
   LOAD MORE
===================================================== */

.catalogue-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 34px 0 12px;
}

.catalogue-load-more {
    display: inline-flex;
    min-width: 210px;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 0;
    padding: 14px 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #246bfd 0%, #5946e8 100%);
    box-shadow: 0 7px 18px rgb(65 89 220 / 25%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.catalogue-load-more:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgb(65 89 220 / 35%);
}

.catalogue-load-more:focus-visible {
    outline: 3px solid #94b7ff;
    outline-offset: 4px;
}

.catalogue-load-more:disabled {
    cursor: wait;
    opacity: .75;
    transform: none;
}

.catalogue-load-more[hidden] {
    display: none !important;
}

.catalogue-load-more-icon {
    display: inline-block;
    font-size: 20px;
    line-height: 1;
    transition: transform .2s ease;
}

.catalogue-load-more:hover:not(:disabled) .catalogue-load-more-icon {
    transform: translateY(3px);
}

/* Loading spinner */

.catalogue-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgb(255 255 255 / 40%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: catalogue-spin .7s linear infinite;
}

.catalogue-load-more.is-loading .catalogue-spinner {
    display: inline-block;
}

.catalogue-load-more.is-loading .catalogue-load-more-icon {
    display: none;
}

@keyframes catalogue-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status messages */

.catalogue-status {
    min-height: 24px;
    padding: 8px 0 18px;
    color: #737b89;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.catalogue-status:empty {
    display: none;
}

.catalogue-retry {
    margin-left: 8px;
    padding: 5px 10px;
    border: 1px solid #d7dce5;
    border-radius: 6px;
    background: #fff;
    color: #245bd7;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

@media (max-width: 1024px) {
    .catalogue-product-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    .catalogue-product-image {
        height: 200px;
    }
}

/* =====================================================
   MOBILE
   Same side spacing as How To Order template
===================================================== */

@media (max-width: 700px) {
    .catalogue-ajax {
        width: calc(100% - 36px);
        max-width: 1240px;
        margin: 28px auto;
    }

    .catalogue-ajax h1 {
        margin-bottom: 22px;
        font-size: clamp(27px, 6vw, 34px);
    }

    .catalogue-controls {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .catalogue-product-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .catalogue-product-list li {
        border-radius: 9px;
    }

    .catalogue-product-image {
        height: auto;
        aspect-ratio: 4 / 3;
        padding: 8px;
    }

    .catalogue-product-name {
        padding: 11px 10px 13px;
        font-size: 13px;
    }

    .catalogue-load-more-wrap {
        padding-top: 26px;
    }

    .catalogue-load-more {
        width: 100%;
        max-width: 300px;
        min-height: 49px;
    }
}

/* Very small mobile screens: 14px side spacing */

@media (max-width: 380px) {
    .catalogue-ajax {
        width: calc(100% - 28px);
    }

    .catalogue-product-list {
        gap: 9px;
    }

    .catalogue-product-name {
        padding: 10px 9px 12px;
        font-size: 12px;
    }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
    .catalogue-product-list li,
    .catalogue-product-image,
    .catalogue-load-more,
    .catalogue-load-more-icon {
        transition: none;
    }

    .catalogue-spinner {
        animation-duration: 1.5s;
    }
}