/* CouponsHaven brand detail page */
.brand-page-main {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 18px 0 52px;
    padding-top: 42px;
}
.brand-page-breadcrumb,
.brands-page-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 22px;
    color: #7b8494;
    font-size: 13px;
}
.brand-page-breadcrumb a,
.brands-page-breadcrumb a {
    color: #687386;
    text-decoration: none;
}
.brand-page-breadcrumb a:hover,
.brands-page-breadcrumb a:hover { color: #f36b12; }

.brand-page-breadcrumb span:last-child {
    color: #f36b12;
    font-weight: 700;
}

.brand-hero {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 26px;
    margin-bottom: 34px;
    border: 1px solid #e8ebf0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(24, 39, 75, .045);
}
.brand-hero-logo {
    display: flex;
    width: 150px;
    height: 125px;
    flex: 0 0 150px;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    border: 1px solid #edf0f4;
    border-radius: 13px;
    background: #fff;
    color: #334155;
    font-size: 38px;
    font-weight: 800;
}
.brand-hero-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.brand-hero-copy { min-width: 0; }
.brand-eyebrow {
    display: inline-block;
    margin-bottom: 7px;
    color: #f36b12;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.brand-hero-copy h1 {
    margin: 0 0 9px;
    color: #182337;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -.035em;
}
.brand-hero-copy p {
    max-width: 760px;
    margin: 0;
    color: #647084;
    font-size: 14px;
    line-height: 1.7;
}
.brand-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 15px;
    color: #697586;
    font-size: 12px;
}
.brand-verified { color: #16834a; font-weight: 700; }

.brand-offers-section { margin-top: 10px; }
.brand-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}
.brand-section-heading h2 {
    margin: 0 0 5px;
    color: #1c293d;
    font-size: 23px;
    letter-spacing: -.025em;
}
.brand-section-heading p {
    margin: 0;
    color: #778195;
    font-size: 13px;
}

.brand-offer-tools { margin-bottom: 15px; }
.brand-tabs { margin-bottom: 19px; }
.brand-offers-list { margin-top: 0; }
.brand-no-offers {
    padding: 38px 20px;
    border: 1px dashed #d8dee8;
    border-radius: 14px;
    background: #fff;
    text-align: center;
}
.brand-no-offers h3 { margin: 0 0 7px; color: #253149; font-size: 18px; }
.brand-no-offers p { margin: 0; color: #778195; font-size: 13px; }
.brand-seo-content {
    margin-top: 38px;
    padding: 23px 25px;
    border: 1px solid #e9edf2;
    border-radius: 14px;
    background: #fff;
}
.brand-seo-content h2 { margin: 0 0 10px; color: #263348; font-size: 19px; }
.brand-seo-content p { margin: 0; color: #687386; font-size: 13px; line-height: 1.8; }
.brand-back-link { margin-top: 26px; }
.brand-back-link a,
.brand-back-button {
    color: #d95c0a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.brand-not-found {
    max-width: 650px;
    margin: 55px auto;
    padding: 45px 25px;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}
.brand-not-found h1 { margin: 0 0 10px; color: #1d2939; }
.brand-not-found p { color: #667085; }

/* Preserve existing offer card design; add only brand-page refinements. */
.brand-page-main .store-offers-list {
    gap: 17px;
}
.brand-page-main .store-offer-card {
    min-width: 0;
}
.brand-page-main .store-offer-content h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    line-height: 1.4;
}
.brand-page-main .store-offer-action button {
    white-space: nowrap;
}

@media (max-width: 700px) {
    .brand-page-main {
        width: min(100% - 28px, 1200px);
        padding-top: 13px;
    }
    .brand-hero {
        align-items: flex-start;
        gap: 15px;
        padding: 17px;
        margin-bottom: 27px;
    }
    .brand-hero-logo {
        width: 88px;
        height: 82px;
        flex-basis: 88px;
        padding: 9px;
        border-radius: 10px;
    }
    .brand-hero-copy h1 { font-size: 22px; }
    .brand-hero-copy p { font-size: 12px; line-height: 1.55; }
    .brand-hero-meta { gap: 7px 12px; margin-top: 10px; font-size: 11px; }
    .brand-section-heading { align-items: flex-start; }
    .brand-section-heading h2 { font-size: 20px; }
    .brand-section-heading p { font-size: 12px; }
    .brand-seo-content { padding: 18px; margin-top: 28px; }
}
@media (max-width: 420px) {
    .brand-hero { flex-direction: column; }
    .brand-hero-logo { width: 100px; height: 78px; flex-basis: auto; }
}


/* Active offer count card in the brand hero */
.brand-hero {
    gap: 26px;
}
.brand-hero-copy {
    flex: 1 1 auto;
}
.brand-hero-stat {
    display: flex;
    width: 150px;
    min-width: 130px;
    min-height: 100px;
    flex: 0 0 150px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid #ffeadc;
    border-radius: 14px;
    background: #fff5ee;
    text-align: center;
}
.brand-hero-stat strong {
    color: #f36b12;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}
.brand-hero-stat span {
    color: #586579;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
}
@media (max-width: 700px) {
    .brand-hero {
        flex-wrap: wrap;
    }
    .brand-hero-stat {
        width: auto;
        min-width: 112px;
        min-height: 74px;
        flex-basis: 112px;
        margin-left: auto;
        padding: 10px;
    }
    .brand-hero-stat strong {
        font-size: 25px;
    }
}
@media (max-width: 420px) {
    .brand-hero-stat {
        margin-left: 0;
    }
}


/* =========================================================
   Brand offers: retailer-aware compact cards
   Each brand offer clearly identifies its source store.
   ========================================================= */
.brand-page-main .brand-offers-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}
.brand-page-main .brand-offer-card {
    display: flex;
    min-width: 0;
    min-height: 330px;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid #e5e9f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(24, 39, 75, .045);
    cursor: default;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.brand-page-main .brand-offer-card:hover {
    transform: translateY(-2px);
    border-color: #ffd1b4;
    box-shadow: 0 9px 22px rgba(24, 39, 75, .085);
}
.brand-offer-card-top {
    display: flex;
    min-height: 30px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.brand-offer-card-top .store-offer-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.brand-offer-card-top .store-offer-discount {
    position: static;
    display: inline-flex;
    min-height: 29px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #ffd6bb;
    border-radius: 8px;
    background: #fff5ee;
    color: #ed5b08;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}
.brand-offer-store {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fff;
    color: #253149;
    text-decoration: none;
}
.brand-offer-store:hover {
    border-color: #ffd1b4;
    background: #fffaf6;
}
.brand-offer-store-logo {
    display: flex;
    width: 100%;
    height: 68px;
    align-items: center;
    justify-content: center;
    color: #344054;
    font-size: 26px;
    font-weight: 800;
}
.brand-offer-store-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 88%;
    max-height: 64px;
    object-fit: contain;
}
.brand-offer-store-name {
    max-width: 100%;
    overflow: hidden;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-offer-card-content {
    flex: 1 1 auto;
    min-width: 0;
}
.brand-offer-card-content h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #202c40;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}
.brand-offer-card-content .store-offer-meta {
    margin-top: 9px;
    color: #8791a2;
    font-size: 11px;
}
.brand-offer-card-action {
    margin-top: auto;
}
.brand-offer-card-action .offer-action-button {
    display: flex;
    width: 100%;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 9px;
}
.brand-offer-store-link {
    display: block;
    padding-top: 10px;
    border-top: 1px solid #edf0f4;
    color: #e85d0b;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.brand-offer-store-link:hover { color: #b94705; text-decoration: underline; }

@media (max-width: 950px) {
    .brand-page-main .brand-offers-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .brand-page-main .brand-offers-list {
        grid-template-columns: 1fr;
        gap: 13px;
    }
    .brand-page-main .brand-offer-card {
        min-height: 0;
        padding: 15px;
    }
    .brand-offer-store { min-height: 96px; }
    .brand-offer-store-logo { height: 55px; }
    .brand-offer-store-logo img { max-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
    .brand-page-main .brand-offer-card { transition: none; }
}


/* Ensure filtered cards are removed from the grid layout. */
.brand-page-main .brand-offer-card[hidden] { display: none !important; }
