/* ==========================================================
   APC Manufacturer Manager
   ========================================================== */

.apc-manufacturer-list,
.apc-manufacturer-profile {
    width: 100%;
}

/* Manufacturer directory
   ========================================================== */

.apc-manufacturer-list {
    display: grid;
    gap: 24px;
    margin: 32px 0 0;
}

.apc-manufacturer-card {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding: 28px 30px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.apc-manufacturer-card:hover {
    transform: translateY(-2px);
    border-color: #A06CAD;
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.08);
}

.apc-manufacturer-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.apc-manufacturer-card__logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.apc-manufacturer-card__logo-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
}

.apc-manufacturer-card__logo-fallback {
    color: #013f52;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.apc-manufacturer-card__content {
    min-width: 0;
}

.apc-manufacturer-card__title {
    margin: 0 0 12px;
    color: #000000;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.25;
}

.apc-manufacturer-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.apc-manufacturer-card:hover .apc-manufacturer-card__title a,
.apc-manufacturer-card__title a:hover {
    color: #A06CAD;
}

.apc-manufacturer-card__description {
    color: #333333;
    font-size: 16px;
    line-height: 1.65;
}

.apc-manufacturer-card__description p:last-child {
    margin-bottom: 0;
}

.apc-manufacturer-card__action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.apc-manufacturer-button,
.apc-manufacturer-profile__website a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    color: #ffffff !important;
    background: #A06CAD;
    border: 0;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.apc-manufacturer-button:hover,
.apc-manufacturer-profile__website a:hover {
    color: #ffffff !important;
    background: #62BB47;
    transform: translateY(-1px);
}

/* Manufacturer profile
   ========================================================== */

.apc-manufacturer-profile {
    padding-bottom: 40px;
}

.apc-manufacturer-profile__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: center;
    gap: 48px;
    margin: 0 0 48px;
    padding: 8px 12px 44px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #dfe4e8;
    border-radius: 0;
    box-shadow: none;
}

.apc-manufacturer-profile__intro {
    min-width: 0;
}

.apc-manufacturer-profile__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 102px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #dfe4e8;
}

.apc-manufacturer-profile__logo-image {
    display: block;
    width: auto;
    max-width: 155px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}

.apc-manufacturer-profile__title {
    margin: 0 0 10px;
    color: #000000;
    font-weight: 500;
    line-height: 1.25;
}

.apc-manufacturer-profile__short-description {
    max-width: 720px;
    color: #222222;
    font-size: 18px;
    line-height: 1.55;
}

.apc-manufacturer-profile__short-description p,
.apc-manufacturer-profile__description p {
    margin-top: 0;
}

.apc-manufacturer-profile__short-description p:last-child,
.apc-manufacturer-profile__description p:last-child {
    margin-bottom: 0;
}

.apc-manufacturer-profile__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 365px;
    gap: 48px;
    align-items: start;
    margin: 0 0 52px;
    padding: 0 12px;
}

.apc-manufacturer-profile__main--without-news {
    display: block;
}

.apc-manufacturer-profile__about {
    width: 100%;
    max-width: 760px;
    margin: 0;
    padding: 0;
}

.apc-manufacturer-profile__about-title {
    margin: 0 0 18px;
    color: #000000;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.3;
}

.apc-manufacturer-profile__description {
    color: #333333;
    font-size: 16px;
    line-height: 1.7;
}

.apc-manufacturer-profile__website {
    margin: 22px 0 0;
}

/* Manufacturer news
   ========================================================== */

.apc-manufacturer-profile__news {
    min-width: 0;
}

.apc-manufacturer-profile__news-title {
    margin: 0 0 18px;
    color: #000000;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.3;
}

.apc-manufacturer-news-list {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dfe4e8;
    border-radius: 5px;
}

.apc-manufacturer-news-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 105px;
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.apc-manufacturer-news-item:last-child {
    border-bottom: 0;
}

.apc-manufacturer-news-item--without-image {
    grid-template-columns: minmax(0, 1fr);
}

.apc-manufacturer-news-item__image {
    display: block;
    width: 110px;
    height: 78px;
    overflow: hidden;
    border-radius: 5px;
    line-height: 0;
    text-decoration: none !important;
}

.apc-manufacturer-news-item__thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.apc-manufacturer-news-item__image:hover .apc-manufacturer-news-item__thumbnail,
.apc-manufacturer-news-item__image:focus .apc-manufacturer-news-item__thumbnail {
    transform: scale(1.025);
}

.apc-manufacturer-news-item__content {
    min-width: 0;
}

.apc-manufacturer-news-item__date {
    display: block;
    margin: 0 0 5px;
    color: #777777;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-transform: uppercase;
}

.apc-manufacturer-news-item__title {
    margin: 0;
    color: #000000;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.apc-manufacturer-news-item__title a,
.apc-manufacturer-news-item__title a:link,
.apc-manufacturer-news-item__title a:visited {
    color: #000000 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.apc-manufacturer-news-item__title a:hover,
.apc-manufacturer-news-item__title a:focus {
    color: #A06CAD !important;
    text-decoration: none !important;
}

.apc-manufacturer-section-heading {
    margin-bottom: 24px;
}

.apc-manufacturer-section-heading h2 {
    margin: 0 0 8px;
    color: #000000;
    font-weight: 400;
}

.apc-manufacturer-section-heading p {
    margin: 0;
}

.apc-manufacturer-section-heading__title {
    margin: 0;
    color: #000000;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.35;
}

.apc-manufacturer-category-group + .apc-manufacturer-category-group {
    margin-top: 34px;
}

.apc-manufacturer-category-group__title {
    margin: 0 0 16px;
    color: #000000;
    font-size: 20px;
    font-weight: 500;
}

.apc-manufacturer-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.apc-manufacturer-category-tile {
    position: relative;
    display: flex;
    min-height: 130px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    text-decoration: none !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.apc-manufacturer-category-tile:hover,
.apc-manufacturer-category-tile.is-active {
    transform: translateY(-2px);
    border-color: #A06CAD;
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.08);
}

.apc-manufacturer-category-tile__image-wrap {
    display: block;
    width: 100%;
    min-height: 130px;
}

.apc-manufacturer-category-tile__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 130px;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.apc-manufacturer-category-tile:hover .apc-manufacturer-category-tile__image {
    transform: scale(1.025);
}

.apc-manufacturer-category-tile__title {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px 12px;
    color: #000000;
    background: rgba(255, 255, 255, 0.94);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.apc-manufacturer-category-tile:hover .apc-manufacturer-category-tile__title,
.apc-manufacturer-category-tile.is-active .apc-manufacturer-category-tile__title {
    color: #A06CAD;
}

.apc-manufacturer-profile__products {
    margin-top: 52px;
}

.apc-manufacturer-section-heading--products {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.apc-manufacturer-clear-filter {
    color: #000000;
    font-weight: 500;
    text-decoration: none;
}

.apc-manufacturer-clear-filter:hover {
    color: #A06CAD;
}

.apc-manufacturer-profile__products .products {
    margin-top: 20px;
}

.apc-manufacturer-profile__products .woocommerce-pagination {
    margin-top: 30px;
}

.apc-manufacturer-button:focus-visible,
.apc-manufacturer-card a:focus-visible,
.apc-manufacturer-category-tile:focus-visible,
.apc-manufacturer-profile__website a:focus-visible,
.apc-manufacturer-clear-filter:focus-visible {
    outline: 2px solid #A06CAD;
    outline-offset: 3px;
}

/* Responsive behaviour
   ========================================================== */

@media (max-width: 1100px) {
    .apc-manufacturer-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .apc-manufacturer-card {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 24px;
    }

    .apc-manufacturer-card__action {
        grid-column: 2;
        justify-content: flex-start;
    }

    .apc-manufacturer-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .apc-manufacturer-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apc-manufacturer-profile__hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 6px 0 34px;
    }

    .apc-manufacturer-profile__logo {
        justify-self: start;
        min-height: 96px;
        padding: 10px 12px;
    }

    .apc-manufacturer-profile__logo-image {
        max-width: 150px;
        max-height: 68px;
    }

    .apc-manufacturer-profile__short-description {
        font-size: 17px;
    }

    .apc-manufacturer-profile__about {
        padding: 0;
    }
}

@media (max-width: 600px) {
    .apc-manufacturer-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 24px;
    }

    .apc-manufacturer-card__logo {
        justify-content: flex-start;
        width: 100%;
        min-height: 80px;
    }

    .apc-manufacturer-card__logo a {
        justify-content: flex-start;
    }

    .apc-manufacturer-card__logo-image {
        max-width: 220px;
        max-height: 90px;
    }

    .apc-manufacturer-card__title {
        font-size: 22px;
    }

    .apc-manufacturer-card__action {
        justify-content: flex-start;
        width: 100%;
    }

    .apc-manufacturer-category-grid {
        grid-template-columns: 1fr;
    }

    .apc-manufacturer-section-heading--products {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .apc-manufacturer-card,
    .apc-manufacturer-card__title a,
    .apc-manufacturer-button,
    .apc-manufacturer-category-tile,
    .apc-manufacturer-category-tile__image,
    .apc-manufacturer-category-tile__title,
    .apc-manufacturer-profile__website a {
        transition: none;
    }

    .apc-manufacturer-card:hover,
    .apc-manufacturer-button:hover,
    .apc-manufacturer-category-tile:hover,
    .apc-manufacturer-profile__website a:hover {
        transform: none;
    }
}


@media (max-width: 900px) {
    .apc-manufacturer-profile__main {
        grid-template-columns: minmax(0, 1fr);
        gap: 38px;
    }

    .apc-manufacturer-profile__about {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .apc-manufacturer-news-item {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
    }

    .apc-manufacturer-news-item__image {
        width: 92px;
        height: 68px;
    }
}
