.category-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 20px 64px;
}

.category-page a,
.category-page button {
    -webkit-tap-highlight-color: transparent;
}

.category-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px;
    color: #64748b;
    font-size: 13px;
}

.category-breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.category-breadcrumb a:hover {
    color: #f97316;
}

.category-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}

.category-page-label {
    display: inline-block;
    margin-bottom: 8px;
    color: #f97316;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.category-page-header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
}

.category-page-header .category-description {
    max-width: 760px;
    margin: 12px 0 0;
    color: #64748b;
    line-height: 1.65;
}

.category-seo-description {
    max-width: 760px;
    margin: 14px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
}

.category-seo-description p {
    margin: 0 0 8px;
}

.category-seo-description p:last-child {
    margin-bottom: 0;
}

.category-offer-count {
    flex: 0 0 auto;
    min-width: 110px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff4ed;
    text-align: center;
}

.category-offer-count strong {
    display: block;
    color: #f97316;
    font-size: 24px;
    line-height: 1.1;
}

.category-offer-count span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.category-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 16px 0 26px;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}

.category-context-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.category-context-label span {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.category-context-label a {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.category-context-label a:hover,
.category-back-link:hover {
    color: #f97316;
}

.category-back-link {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* Category content layout */
.category-content-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin-top: 10px;
}

.category-subcategory-rail {
    position: sticky;
    top: 20px;
    min-width: 0;
    padding: 16px 0;
}

.category-subcategory-rail-header {
    padding: 0 12px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.category-subcategory-rail-header > span {
    display: block;
    margin-bottom: 3px;
    color: #f97316;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.category-subcategory-rail-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.3;
}

.category-subcategory-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 8px;
}

.category-subcategory-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.category-subcategory-nav-link > span:first-child {
    min-width: 0;
}

.category-subcategory-nav-link > span:last-child {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 16px;
}

.category-subcategory-nav-link:hover {
    background: #fff7f1;
    border-color: #ffd9bf;
    color: #f97316;
}

.category-subcategory-nav-link:hover > span:last-child {
    color: #f97316;
}

.category-subcategory-nav-link.active {
    background: #fff1e8;
    border-color: #ffc9a5;
    color: #d85b00;
    font-weight: 800;
}

.category-subcategory-nav-link.active > span:last-child {
    color: #f97316;
}

.category-offers-section {
    min-width: 0;
    margin-top: 0;
}

.category-offers-header {
    margin-bottom: 18px;
}

.category-offers-header h2 {
    color: #0f172a;
    font-size: 22px;
    line-height: 1.3;
}

.category-offers-header p {
    line-height: 1.55;
}

/* =========================================================
   Category offers - shared compact Homepage card layout
   ========================================================= */

.category-offers-section .deals-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.category-offers-section .category-offer-visual-card {
    width: 100%;
    min-width: 0;
    height: 100%;
}

.category-offers-section .category-offer-visual-card .latest-card-visual {
    flex-basis: 125px;
    height: 125px;
    min-height: 125px;
}

.category-offers-section .category-offer-visual-card .latest-card-logo img {
    max-width: 82%;
    max-height: 76px;
    object-fit: contain;
}

.category-offers-section .category-offer-visual-card .latest-card-content {
    flex: 1 1 auto;
}

.category-offers-section .category-offer-visual-card .coupon-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.category-offers-section .category-offer-visual-card .coupon-meta {
    min-height: 14px;
}

.category-offers-section .offer-card:focus-visible,
.category-offers-section .offer-action-button:focus-visible,
.category-offer-filter:focus-visible,
.category-subcategory-nav-link:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .category-offers-section .deals-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .category-offers-section .deals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-offers-section .category-offer-visual-card .latest-card-visual {
        flex-basis: 112px;
        height: 112px;
        min-height: 112px;
        padding-right: 9px;
        padding-left: 9px;
    }

    .category-offers-section .category-offer-visual-card .latest-card-content {
        gap: 6px;
        padding: 10px;
    }

    .category-offers-section .category-offer-visual-card .latest-card-logo img {
        max-height: 68px;
    }
}

@media (max-width: 360px) {
    .category-offers-section .deals-grid {
        gap: 9px;
    }

    .category-offers-section .category-offer-visual-card .latest-card-discount {
        top: 7px;
        right: 7px;
        padding: 5px 7px;
        font-size: 10px;
    }

    .category-offers-section .category-offer-visual-card .latest-card-type {
        padding: 6px 10px 6px 8px;
        font-size: 9px;
    }
}

.category-offers-section .offer-card:focus-visible,
.category-offers-section .offer-action-button:focus-visible,
.category-offer-filter:focus-visible,
.category-subcategory-nav-link:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

.category-offer-filters {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    padding: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
}

.category-offer-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid #f97316;
    border-radius: 7px;
    background: #fff;
    color: #f97316;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.category-offer-filter:hover {
    background: #fff4ed;
    color: #ea580c;
}

.category-offer-filter.active {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

.category-offer-filter.active:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
}

@media (max-width: 600px) {
    .category-offers-header h2 {
        font-size: 20px;
    }

    .category-offer-filters {
        display: flex;
        width: 100%;
        margin-top: 14px;
    }

    .category-offer-filter {
        flex: 1 1 0;
        padding: 0 8px;
    }

    .category-offer-card {
        padding: 16px;
    }

    .category-offer-card-top {
        gap: 8px;
    }

    .category-offer-card .coupon-discount {
        font-size: 15px;
    }

    .category-offer-actions {
        grid-template-columns: 1fr;
    }

    .category-offer-secondary {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .category-content-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .category-subcategory-rail {
        position: static;
        padding: 0;
    }

    .category-subcategory-rail-header {
        padding: 13px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 10px 10px 0 0;
        background: #fafafa;
    }

    .category-subcategory-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 8px;
        border: 1px solid #e5e7eb;
        border-top: 0;
        border-radius: 0 0 10px 10px;
        background: #fff;
    }

    .category-subcategory-nav-link {
        min-height: 40px;
        padding: 8px 10px;
    }

    .category-subcategories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .category-page {
        padding: 6px 14px 48px;
    }

    .category-breadcrumb {
        margin-bottom: 16px;
        font-size: 12px;
    }

    .category-page-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .category-offer-count {
        width: 100%;
        min-width: 0;
    }

    .category-context-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-subcategories-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Offer Popup
   ========================================================= */

.offer-modal-close:focus-visible,
.offer-popup-copy:focus-visible,
.offer-popup-action:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 3px;
}

   .offer-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.offer-modal.is-open {
    display: block;
}

.offer-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.offer-modal-dialog {
    position: relative;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    margin: 16px auto;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.offer-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #1a1a1a;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.offer-modal-close:hover {
    background: #e5e7eb;
}

.offer-modal-content {
    padding: 32px;
}

.offer-modal-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    font-size: 15px;
}

.offer-popup-store {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.offer-popup-store-logo {
    width: 60px;
    height: 60px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    flex-shrink: 0;
}

.offer-popup-store-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.offer-popup-store-placeholder {
    font-size: 20px;
    font-weight: 700;
    color: #666666;
}

.offer-popup-store-label {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #888888;
}

.offer-popup-store-name {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.offer-popup-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #555555;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
}

.offer-popup-type.coupon {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.offer-popup-type.deal {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #374151;
}

.offer-popup-offer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.offer-popup-title {
    margin: 10px 0 10px;
    padding-right: 30px;
    font-size: 24px;
    line-height: 1.25;
    color: #1a1a1a;
}

.offer-popup-discount {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.offer-popup-description {
    margin: 0 0 20px;
    color: #555555;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-line;
}

.offer-popup-expiry {
    margin-bottom: 14px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #f8fafc;
    color: #666666;
    font-size: 13px;
}

.offer-popup-conditions {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.offer-popup-conditions-title {
    margin: 0;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 800;
}

.offer-popup-condition-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.offer-popup-condition-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.45;
}

.offer-popup-condition-check {
    flex: 0 0 auto;
    font-weight: 800;
    color: #16a34a;
}

.offer-popup-conditions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.offer-popup-condition-column,
.offer-popup-exclusion-column {
    min-width: 0;
}

.offer-popup-exclusion-column {
    padding-left: 18px;
    border-left: 1px solid #e5e7eb;
}

.offer-popup-exclusions {
    margin: 0;
    padding: 0;
    border-top: 0;
}

.offer-popup-exclusions-label {
    display: block;
    margin: 0 0 7px;
    color: #666666;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.offer-popup-exclusions-text {
    color: #555555;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
}

.offer-popup-code-wrap {
    padding: 12px;
    border: 1px dashed #fdba74;
    border-radius: 12px;
    background: #fffaf5;
    margin-bottom: 14px;
}

.offer-popup-code-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #777777;
}

.offer-popup-code-row {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
}

.offer-popup-code {
    min-width: 0;
    max-width: 100%;
    flex: 1;
    padding: 12px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 800;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.offer-popup-copy {
    flex-shrink: 0;
    flex: 0 0 auto;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #1a1a1a;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.offer-popup-copy:hover {
    opacity: .9;
}

.offer-popup-action {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    background: #f97316;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.offer-popup-action:hover {
    background: #ea580c;
    color: #ffffff;
}

.offer-popup-note {
    margin: 12px 0 0;
    color: #777777;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.offer-popup-error {
    padding: 24px 8px;
    color: #666666;
    text-align: center;
}

body.offer-modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {

    .offer-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .offer-modal-content {
        padding: 26px 20px 22px;
    }

    .offer-popup-offer-meta {
        margin-top: 8px;
    }

    .offer-popup-title {
        margin-top: 8px;
        font-size: 21px;
    }

    .offer-popup-conditions-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .offer-popup-exclusion-column {
        padding-left: 0;
        padding-top: 12px;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    .offer-popup-code-row {
        flex-direction: column;
    }

    .offer-popup-copy {
        min-height: 42px;
    }

}



/* =========================================================
   CouponsHaven — compact, consistent offer popup refinement
   ========================================================= */

/* Keep the dialog centered and inside the viewport without excessive scrolling. */
.offer-modal-dialog {
    width: min(540px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 18px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.offer-modal-content {
    padding: 24px 28px 22px;
}

.offer-modal-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 23px;
}

.offer-popup-store {
    gap: 10px;
    margin-bottom: 14px;
    padding-right: 28px;
}

.offer-popup-store-logo {
    width: 52px;
    height: 52px;
    border-radius: 11px;
}

.offer-popup-store-name {
    font-size: 17px;
    line-height: 1.25;
}

.offer-popup-offer-meta {
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.offer-popup-type {
    padding: 4px 8px;
    font-size: 10px;
}

.offer-popup-discount {
    padding: 5px 9px;
    font-size: 15px;
    white-space: nowrap;
}

.offer-popup-title {
    margin: 12px 0 12px;
    padding-right: 0;
    font-size: clamp(21px, 3vw, 24px);
    line-height: 1.25;
    letter-spacing: -0.35px;
    overflow-wrap: anywhere;
}

.offer-popup-description {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 1.5;
}

.offer-popup-expiry {
    margin-bottom: 12px;
    padding: 7px 10px;
    font-size: 12px;
}

.offer-popup-conditions {
    margin-bottom: 12px;
    padding: 11px 13px;
    border-radius: 11px;
}

.offer-popup-conditions-title {
    font-size: 13px;
}

.offer-popup-condition-list {
    gap: 5px;
    margin-top: 7px;
}

.offer-popup-condition-list li,
.offer-popup-exclusions-text {
    font-size: 12.5px;
}

.offer-popup-conditions-layout {
    gap: 14px;
}

.offer-popup-exclusion-column {
    padding-left: 14px;
}

.offer-popup-code-wrap {
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 11px;
}

.offer-popup-code-label {
    margin-bottom: 7px;
    font-size: 10px;
}

.offer-popup-code-row {
    align-items: stretch;
    gap: 8px;
}

.offer-popup-code {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.offer-popup-copy {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0 17px;
    border-radius: 9px;
    background: #f97316;
    font-size: 13px;
    transition: background-color 160ms ease, transform 160ms ease;
}

.offer-popup-copy:hover {
    background: #ea580c;
    opacity: 1;
}

.offer-popup-action {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.16);
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* Coupon popups contain the code panel; keep their store action orange. */
.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-action {
    background: linear-gradient(135deg, #ff7a1a 0%, #f45b0a 100%);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.18);
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-action:hover {
    background: #ea580c;
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.24);
    transform: translateY(-1px);
}

/* Deal popups omit the coupon-code panel and use blue to match deal cards. */
.offer-modal-dialog:not(:has(.offer-popup-code-wrap)) .offer-popup-action {
    background: linear-gradient(135deg, #3478f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

.offer-modal-dialog:not(:has(.offer-popup-code-wrap)) .offer-popup-action:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
    transform: translateY(-1px);
}

.offer-popup-note {
    margin-top: 9px;
    font-size: 11.5px;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .offer-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 15px;
    }

    .offer-modal-content {
        padding: 22px 17px 18px;
    }

    .offer-popup-store {
        margin-bottom: 12px;
    }

    .offer-popup-store-logo {
        width: 46px;
        height: 46px;
    }

    .offer-popup-title {
        margin: 10px 0;
        font-size: 21px;
    }

    .offer-popup-conditions-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .offer-popup-exclusion-column {
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    /* Keep coupon and Copy side-by-side on phones when space allows. */
    .offer-popup-code-row {
        flex-direction: row;
    }

    .offer-popup-code {
        min-width: 0;
    }

    .offer-popup-copy {
        min-height: 42px;
        padding: 0 14px;
    }
}

@media (max-width: 360px) {
    .offer-modal-content {
        padding: 20px 14px 16px;
    }

    .offer-popup-code-row {
        gap: 6px;
    }

    .offer-popup-copy {
        padding: 0 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offer-popup-copy,
    .offer-popup-action {
        transition: none !important;
    }

    .offer-popup-action:hover {
        transform: none !important;
    }
}



/* =========================================================
   Popup consistency fix — coupon and deal share the same shell
   ========================================================= */

/* Same outer width, corner shape, centering and neutral scrollbar for both. */
.offer-modal-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
    border-radius: 18px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #ffffff;
}

.offer-modal-content {
    padding: 24px 28px 22px;
}

/* The coupon popup has extra fields, so tighten only its vertical spacing
   to make it feel like the deal popup without removing offer information. */
.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-store {
    margin-bottom: 10px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-offer-meta {
    margin-top: 6px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-title {
    margin-top: 9px;
    margin-bottom: 9px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-description {
    margin-bottom: 9px;
    line-height: 1.45;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-expiry {
    margin-bottom: 9px;
    padding: 6px 10px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-conditions {
    margin-bottom: 9px;
    padding: 10px 12px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-code-wrap {
    margin-bottom: 10px;
    padding: 10px 12px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-code-label {
    margin-bottom: 6px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-code {
    min-height: 40px;
    padding: 8px 11px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-copy {
    min-height: 40px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-note {
    margin-top: 8px;
}

/* Both primary actions have the same dimensions; color remains type-specific. */
.offer-popup-action {
    min-height: 44px;
    border-radius: 9px;
    box-sizing: border-box;
}

/* Avoid a browser-default/focus-colored orange outline on the blue deal action. */
.offer-popup-action:focus {
    outline: none;
}

.offer-popup-action:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .offer-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 15px;
    }

    .offer-modal-content {
        padding: 21px 17px 18px;
    }

    .offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-store {
        margin-bottom: 9px;
    }

    .offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-title {
        margin-top: 8px;
        margin-bottom: 8px;
    }
}



/* =========================================================
   Final popup polish — shared Visit Store CTA and aligned panels
   ========================================================= */

.offer-modal-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
}

.offer-modal-content {
    padding: 24px 28px 22px;
}

/* Keep conditions, coupon code panel, and primary action on identical edges. */
.offer-popup-conditions,
.offer-popup-code-wrap,
.offer-popup-action {
    width: 100%;
    box-sizing: border-box;
}

.offer-popup-conditions {
    margin-bottom: 10px;
}

.offer-popup-code-wrap {
    margin-bottom: 10px;
}

.offer-popup-action {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 9px;
    box-shadow: none;
}

/* Coupon popup: branded orange CTA, with no layout-specific border. */
.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-action {
    background: linear-gradient(135deg, #ff7a1a 0%, #f45b0a 100%);
    border-color: #f97316;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.16);
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-action:hover {
    background: #ea580c;
    border-color: #ea580c;
}

/* Deal popup: blue CTA with a matching blue border, never orange. */
.offer-modal-dialog:not(:has(.offer-popup-code-wrap)) .offer-popup-action {
    background: linear-gradient(135deg, #3478f6 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.16);
}

.offer-modal-dialog:not(:has(.offer-popup-code-wrap)) .offer-popup-action:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.offer-popup-action:focus {
    outline: none;
}

.offer-popup-action:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 3px;
}

/* Coupon-only details use tighter vertical rhythm while retaining all content. */
.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-store {
    margin-bottom: 10px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-offer-meta {
    margin-top: 6px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-title {
    margin-top: 9px;
    margin-bottom: 8px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-description {
    margin-bottom: 8px;
    line-height: 1.45;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-expiry {
    margin-bottom: 9px;
    padding: 6px 10px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-conditions {
    padding: 10px 12px;
}

.offer-modal-dialog:has(.offer-popup-code-wrap) .offer-popup-code-wrap {
    padding: 10px 12px;
}

@media (max-width: 600px) {
    .offer-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 15px;
    }

    .offer-modal-content {
        padding: 21px 17px 18px;
    }
}



/* Coupon copy interaction — clear success and failure feedback */
.offer-popup-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 76px;
    white-space: nowrap;
    font-weight: 750;
    transition: background-color 160ms ease, border-color 160ms ease,
                box-shadow 160ms ease, transform 160ms ease;
}

.offer-popup-copy .offer-copy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.offer-popup-copy.is-copied {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.18);
}

.offer-popup-copy.is-copied .offer-copy-icon {
    font-size: 15px;
}

.offer-popup-copy.copy-failed {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.offer-popup-copy:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 3px;
}

.offer-code-feedback {
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: #f8fafc;
}

.offer-code-feedback-question {
  margin: 0 0 10px;
  color: #202939;
  font-size: 13px;
  font-weight: 800;
}

.offer-code-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-code-feedback-button {
  min-height: 35px;
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.offer-code-feedback-button:hover:not(:disabled) {
  border-color: #ff6a00;
  background: #fff7ed;
  color: #c2410c;
}

.offer-code-feedback-button:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.3);
  outline-offset: 2px;
}

.offer-code-feedback-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.offer-code-feedback-status {
  margin: 9px 0 0;
  color: #667085;
  font-size: 11px;
  line-height: 1.5;
}

.offer-code-feedback-status:empty {
  display: none;
}
/* Improvement 5 UI refinement: consistent title alignment and balanced columns. */
.offer-modal-dialog {
    width: min(780px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}

.offer-modal-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "store store"
        "meta meta"
        "title title"
        "description code"
        "expiry feedback"
        "conditions feedback"
        "conditions action";
    align-content: center;
    align-items: start;
    column-gap: 24px;
    row-gap: 0;
}

.offer-popup-store { grid-area: store; }
.offer-popup-offer-meta { grid-area: meta; }
.offer-popup-title {
    grid-area: title;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: pretty;
}
.offer-popup-description { grid-area: description; min-width: 0; }
.offer-popup-expiry { grid-area: expiry; min-width: 0; }
.offer-popup-conditions { grid-area: conditions; min-width: 0; }
.offer-popup-code-wrap { grid-area: code; min-width: 0; align-self: start; margin-top: 8px; }
.offer-code-feedback { grid-area: feedback; min-width: 0; align-self: start; margin-top: 8px; margin-bottom: 12px; }
.offer-popup-action { grid-area: action; align-self: end; min-width: 0; margin-top: 0; }

/* Keep the title full-width for both offer types; use the right column for actions. */
.offer-modal-content:has(.offer-popup-code-wrap) {
    grid-template-areas:
        "store store"
        "meta meta"
        "title title"
        "description code"
        "expiry feedback"
        "conditions feedback"
        "conditions action";
}

.offer-modal-content:not(:has(.offer-popup-code-wrap)) {
    grid-template-areas:
        "store store"
        "meta meta"
        "title title"
        "description feedback"
        "expiry feedback"
        "conditions feedback"
        "conditions action";
}

.offer-modal-content:has(.offer-popup-code-wrap) .offer-popup-code-wrap {
    margin-bottom: 12px;
}

.offer-modal-content:has(.offer-popup-code-wrap) .offer-code-feedback,
.offer-modal-content:not(:has(.offer-popup-code-wrap)) .offer-code-feedback {
    margin-top: 8px;
    margin-bottom: 12px;
}

.offer-modal-content:has(.offer-popup-code-wrap) .offer-popup-action,
.offer-modal-content:not(:has(.offer-popup-code-wrap)) .offer-popup-action {
    align-self: end;
    margin-top: 0;
}

@media (max-width: 640px) {
    .offer-modal-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .offer-modal-content,
    .offer-modal-content:has(.offer-popup-code-wrap),
    .offer-modal-content:not(:has(.offer-popup-code-wrap)) {
        display: block;
        padding: 21px 17px 18px;
    }

    .offer-popup-code-wrap,
    .offer-code-feedback,
    .offer-popup-action {
        margin-top: 12px;
    }

    .offer-popup-title {
        overflow-wrap: anywhere;
    }
}


/* Screenshot-driven correction: prevent coupon-code overflow and restore usable
   width to the conditions/restrictions panel. Keep these rules last so they
   override the earlier popup refinements in this stylesheet. */
.offer-modal-dialog {
    width: min(780px, calc(100% - 32px)) !important;
}

.offer-modal-dialog .offer-modal-content:has(.offer-popup-code-wrap) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
}

.offer-modal-dialog .offer-popup-code-wrap {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.offer-modal-dialog .offer-popup-code-label {
    white-space: nowrap;
}

.offer-modal-dialog .offer-popup-code-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.offer-modal-dialog .offer-popup-code {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.offer-modal-dialog .offer-popup-copy {
    flex: 0 0 auto;
    min-width: 78px;
    white-space: nowrap;
}

.offer-modal-dialog .offer-popup-conditions-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.offer-modal-dialog .offer-popup-condition-column,
.offer-modal-dialog .offer-popup-exclusion-column {
    min-width: 0;
}

.offer-modal-dialog .offer-popup-conditions-title {
    overflow-wrap: normal;
    word-break: normal;
}

.offer-modal-dialog .offer-popup-exclusion-column {
    padding-left: 12px;
}

.offer-modal-dialog .offer-popup-exclusions-label {
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.offer-modal-dialog .offer-popup-exclusions-text {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .offer-modal-dialog {
        width: calc(100% - 20px) !important;
    }

    .offer-modal-dialog .offer-modal-content:has(.offer-popup-code-wrap) {
        display: block;
    }

    .offer-modal-dialog .offer-popup-code-row {
        flex-direction: row;
    }

    .offer-modal-dialog .offer-popup-conditions-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .offer-modal-dialog .offer-popup-exclusion-column {
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 360px) {
    .offer-modal-dialog .offer-popup-code-row {
        gap: 6px;
    }

    .offer-modal-dialog .offer-popup-copy {
        min-width: 70px;
        padding-left: 9px;
        padding-right: 9px;
    }
}

/* Final screenshot refinement: keep the coupon label on its own line and
   prevent it from sitting behind the code field. Improve the two detail panels. */
.offer-modal-dialog .offer-popup-code-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 10px 12px;
}

.offer-modal-dialog .offer-popup-code-label {
    position: static;
    display: block;
    width: 100%;
    margin: 0;
    line-height: 1.25;
    font-size: 10px;
    letter-spacing: .04em;
    white-space: nowrap;
}

.offer-modal-dialog .offer-popup-code-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.offer-modal-dialog .offer-popup-code {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.offer-modal-dialog .offer-popup-copy {
    flex: 0 0 auto;
    min-width: 82px;
}

.offer-modal-dialog .offer-popup-conditions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.offer-modal-dialog .offer-popup-condition-column,
.offer-modal-dialog .offer-popup-exclusion-column {
    min-width: 0;
}

.offer-modal-dialog .offer-popup-conditions-title {
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: normal;
    word-break: normal;
}

.offer-modal-dialog .offer-popup-exclusion-column {
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
}

.offer-modal-dialog .offer-popup-exclusions-label {
    display: block;
    line-height: 1.35;
    overflow-wrap: normal;
    word-break: normal;
}

.offer-modal-dialog .offer-popup-exclusions-text {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .offer-modal-dialog .offer-popup-conditions-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .offer-modal-dialog .offer-popup-exclusion-column {
        padding: 12px 0 0;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }
}


/* =========================================================
   Unified Store Offer Popup — shared coupon/deal layout
   Replaces the older content-grid positioning rules above.
   ========================================================= */

.offer-modal-dialog {
    width: min(780px, calc(100% - 32px)) !important;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
}

.offer-modal-content {
    display: block;
    padding: 28px 32px 30px;
}

.offer-popup-store {
    margin-bottom: 14px;
    padding-right: 34px;
}

.offer-popup-store-logo {
    width: 52px;
    height: 52px;
}

.offer-popup-offer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.offer-popup-title {
    margin: 0 0 18px;
    padding-right: 0;
    font-size: clamp(22px, 2.4vw, 25px);
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.offer-popup-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.offer-popup-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.offer-popup-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    row-gap: 10px;
    min-width: 0;
}

.offer-popup-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.offer-popup-expiry {
    margin: 0;
    padding: 7px 10px;
    font-size: 12px;
}

.offer-popup-conditions {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 13px;
}

.offer-popup-conditions-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.offer-popup-condition-column,
.offer-popup-exclusion-column {
    min-width: 0;
}

.offer-popup-conditions-title,
.offer-popup-exclusions-label {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0;
}

.offer-popup-condition-list {
    gap: 6px;
    margin-top: 0;
}

.offer-popup-condition-list li,
.offer-popup-exclusions-text {
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.offer-popup-exclusion-column {
    padding-left: 12px;
}

.offer-popup-code-wrap {
    grid-row: 1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 12px;
}

.offer-popup-code-label {
    margin: 0 0 7px;
    font-size: 10px;
    line-height: 1.3;
}

.offer-popup-code-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.offer-popup-code {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    overflow-x: auto;
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: 14px;
}

.offer-popup-copy {
    flex: 0 0 auto;
    min-width: 82px;
    min-height: 40px;
    padding: 0 13px;
    background: #ff6a00;
    font-size: 12px;
}

.offer-popup-copy:hover {
    background: #e85d04;
}

.offer-code-feedback {
    grid-row: 2;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 13px;
}

.offer-code-feedback-question {
    margin-bottom: 8px;
    font-size: 12px;
}

.offer-code-feedback-actions {
    gap: 7px;
}

.offer-code-feedback-button {
    min-height: 35px;
    padding: 7px 10px;
    font-size: 11.5px;
}

.offer-popup-action {
    grid-row: 3;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 16px;
    border-radius: 9px;
    font-size: 13px;
}

/* Coupon right column: code → feedback → store CTA. */
.offer-popup-actions:has(.offer-popup-code-wrap) .offer-popup-action {
    grid-row: 3;
    background: linear-gradient(135deg, #ff7a1a 0%, #f45b0a 100%);
    border-color: #f97316;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.16);
}

.offer-popup-actions:has(.offer-popup-code-wrap) .offer-popup-action:hover {
    background: #ea580c;
    border-color: #ea580c;
}

/* Deal right column has no code panel, so its feedback and CTA start at the top. */
.offer-popup-actions:not(:has(.offer-popup-code-wrap)) .offer-code-feedback {
    grid-row: 1;
}

.offer-popup-actions:not(:has(.offer-popup-code-wrap)) .offer-popup-action {
    grid-row: 2;
    background: linear-gradient(135deg, #3478f6 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.16);
}

.offer-popup-actions:not(:has(.offer-popup-code-wrap)) .offer-popup-action:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

@media (max-width: 640px) {
    .offer-modal-dialog {
        width: calc(100% - 20px) !important;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 15px;
    }

    .offer-modal-content {
        padding: 22px 18px 20px;
    }

    .offer-popup-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .offer-popup-details,
    .offer-popup-actions {
        gap: 10px;
    }

    .offer-popup-conditions-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .offer-popup-exclusion-column {
        padding: 10px 0 0;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    .offer-popup-code-row {
        flex-direction: row;
    }

    .offer-popup-code {
        min-width: 0;
    }
}

@media (max-width: 360px) {
    .offer-modal-content {
        padding: 20px 14px 16px;
    }

    .offer-popup-copy {
        min-width: 72px;
        padding: 0 9px;
    }
}


/* =========================================================
   Final popup alignment — consistent coupon/deal feedback
   ========================================================= */
.offer-popup-body {
    align-items: start;
}

.offer-popup-details,
.offer-popup-actions {
    min-width: 0;
    align-self: start;
}

/* Keep both feedback choices on one row on desktop/tablet. */
.offer-code-feedback-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 7px;
}

.offer-code-feedback-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 7px 5px;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.25;
}

/* On narrow screens, stack the feedback choices if their labels would feel cramped. */
@media (max-width: 420px) {
    .offer-code-feedback-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .offer-code-feedback-button {
        justify-content: flex-start;
        padding: 8px 10px;
        font-size: 12px;
    }
}



/* FINAL FIX: long coupon codes must not create an inner horizontal scrollbar.
   The code is visually clipped; the copy handler still copies the full code. */
.offer-modal-dialog .offer-popup-code-row,
.offer-popup-code-row {
    display: flex !important;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    overflow: hidden !important;
}

.offer-modal-dialog .offer-popup-code-row .offer-popup-code,
.offer-popup-code-row .offer-popup-code {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    scrollbar-width: none !important;
}

.offer-modal-dialog .offer-popup-code-row .offer-popup-code::-webkit-scrollbar,
.offer-popup-code-row .offer-popup-code::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.offer-modal-dialog .offer-popup-code-row .offer-popup-copy,
.offer-popup-code-row .offer-popup-copy {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

/* Show the complete coupon code instead of truncating it with an ellipsis. */
.offer-modal-dialog .offer-popup-code-row {
    align-items: stretch;
}

.offer-modal-dialog .offer-popup-code {
    white-space: normal !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    min-width: 0;
    height: auto;
    line-height: 1.4;
}



/* =========================================================
   Category page final layout
   Full-width offers with horizontal subcategory navigation
   ========================================================= */

.category-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.category-subcategory-rail {
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
}

.category-subcategory-rail-header {
    padding: 0 0 10px;
    border: 0;
    background: transparent;
}

.category-subcategory-rail-header > span {
    margin-bottom: 3px;
}

.category-subcategory-rail-header h2 {
    font-size: 16px;
}

.category-subcategory-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.category-subcategory-nav-link {
    display: inline-flex;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    white-space: nowrap;
}

.category-subcategory-nav-link > span:last-child {
    display: none;
}

.category-subcategory-nav-link.active {
    background: #fff1e8;
    border-color: #ffc9a5;
    color: #d85b00;
}

/* Four equal-width offer cards across the full content width. */
.category-offers-section .deals-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* Match the compact Homepage card structure using the existing
   Category markup. No shared PHP component changes are required. */
.category-offers-section .deal-card.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 350px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
    cursor: pointer;
}

.category-offers-section .deal-card.offer-card .deal-card-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex: 0 0 125px;
    min-height: 125px;
    padding: 0;
    border-bottom: 1px solid #e8edf3;
    background: #fff;
}

.category-offers-section .deal-card.offer-card .deal-card-header > div:first-child {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    flex-wrap: wrap;
    max-width: calc(100% - 8px);
}

.category-offers-section .deal-card.offer-card .deal-type {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 11px;
    border: 0;
    border-radius: 0 0 10px 0;
    background: #08264e;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.category-offers-section .deal-card.offer-card .deal-card-header .deal-type + .deal-type {
    border-radius: 0 0 8px 8px;
}

.category-offers-section .deal-card.offer-card .deal-discount {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 1;
    max-width: calc(100% - 90px);
    padding: 6px 10px;
    border: 1px solid #ff6a1a;
    border-radius: 999px;
    background: #fff;
    color: #f4510b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.category-offers-section .deal-card.offer-card .deal-store {
    display: contents;
}

.category-offers-section .deal-card.offer-card .deal-store-logo {
    position: absolute;
    top: 43px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72%;
    height: 72px;
    transform: translateX(-50%);
    border: 0;
    background: transparent;
}

.category-offers-section .deal-card.offer-card .deal-store-logo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.category-offers-section .deal-card.offer-card .deal-store-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 25px;
    font-weight: 800;
}

.category-offers-section .deal-card.offer-card .deal-store-name {
    position: absolute;
    top: 137px;
    left: 13px;
    right: 13px;
    display: block;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.category-offers-section .deal-card.offer-card .deal-title {
    display: -webkit-box;
    min-height: 42px;
    margin: 157px 13px 0;
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.category-offers-section .deal-card.offer-card .deal-description {
    display: -webkit-box;
    margin: 6px 13px 0;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.category-offers-section .deal-card.offer-card .deal-meta {
    min-height: 17px;
    margin: 7px 13px 0;
    color: #ea580c;
    font-size: 10px;
    font-weight: 700;
}

.category-offers-section .deal-card.offer-card .deal-card-action {
    display: flex;
    margin: auto 13px 12px;
    padding-top: 12px;
}

.category-offers-section .deal-card.offer-card .deal-get-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #ff5b0a;
    border-radius: 9px;
    background: #fff;
    color: #f4510b;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.category-offers-section .deal-card.offer-card:has(.coupon-code-action) .deal-get-button,
.category-offers-section .deal-card.offer-card .deal-get-button.coupon-action {
    background: #ff5b0a;
    color: #fff;
}

.category-offers-section .deal-card.offer-card .deal-get-button:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
}

@media (max-width: 760px) {
    .category-content-layout {
        gap: 18px;
    }

    .category-subcategory-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 7px;
        scrollbar-width: thin;
    }

    .category-subcategory-nav-link {
        flex: 0 0 auto;
    }

    .category-offers-section .deals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-offers-section .deal-card.offer-card {
        min-height: 340px;
    }

    .category-offers-section .deal-card.offer-card .deal-card-header {
        flex-basis: 112px;
        min-height: 112px;
    }

    .category-offers-section .deal-card.offer-card .deal-store-logo {
        top: 39px;
        height: 64px;
    }

    .category-offers-section .deal-card.offer-card .deal-store-logo img {
        max-height: 64px;
    }

    .category-offers-section .deal-card.offer-card .deal-store-name {
        top: 124px;
    }

    .category-offers-section .deal-card.offer-card .deal-title {
        margin-top: 145px;
        margin-right: 10px;
        margin-left: 10px;
        font-size: 12px;
    }

    .category-offers-section .deal-card.offer-card .deal-description,
    .category-offers-section .deal-card.offer-card .deal-meta {
        margin-right: 10px;
        margin-left: 10px;
    }

    .category-offers-section .deal-card.offer-card .deal-card-action {
        margin-right: 10px;
        margin-left: 10px;
    }
}



/* =========================================================
   Final Category card spacing and navigation label correction
   ========================================================= */

/* Keep the store name and offer title in normal card flow directly
   beneath the logo panel, like the Homepage offer cards. */
.category-offers-section .deal-card.offer-card .deal-store-name {
    position: static;
    display: block;
    margin: 10px 13px 0;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.category-offers-section .deal-card.offer-card .deal-title {
    min-height: 42px;
    margin: 7px 13px 0;
}

/* The first Subcategories pill is "All" and must remain visible.
   Hide only the trailing arrow on links that have two spans. */
.category-subcategory-nav-link > span:last-child:not(:first-child) {
    display: none;
}

@media (max-width: 760px) {
    .category-offers-section .deal-card.offer-card .deal-store-name {
        margin-right: 10px;
        margin-left: 10px;
    }

    .category-offers-section .deal-card.offer-card .deal-title {
        margin: 7px 10px 0;
    }
}
