/* ==========================================================================
   DiscountRoof — shared pages (categories, stores A–Z, trending, content, legal)
   Loaded after homepage4.css. Everything scoped under .h4.
   ========================================================================== */

.h4 .p4-crumbs,
.h4 .p4-az { margin: 0; }

.h4 #content,
.h4 .p4-sec { scroll-margin-top: 96px; }

/* ---------- Page hero ---------- */
.h4 .p4-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 36px 0 48px;
    background: var(--h4-wash-hero);
}
.h4 .p4-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--h4-dots);
    background-size: 18px 18px;
    opacity: .5;
}
.h4 .p4-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .88));
}
.h4 .p4-hero--sm { padding: 28px 0 36px; }
.h4 .p4-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .8125rem; color: var(--h4-mute); }
.h4 .p4-crumbs li + li::before { content: "/"; margin: 0 9px; color: #b9b5ad; }
.h4 .p4-crumbs a:hover { color: var(--h4-ink); text-decoration: underline; text-underline-offset: 3px; }
.h4 .p4-crumbs [aria-current] { color: var(--h4-ink2); }

.h4 .p4-hero .h4-eyebrow { margin-top: 22px; }
.h4 .p4-hero h1 { max-width: 22ch; }
.h4 .p4-hero .h4-hero__lede { margin-top: 16px; max-width: 58ch; }
.h4 .p4-hero .h4-stats { margin-top: 24px; }
.h4 .p4-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- A–Z strip ---------- */
.h4 .p4-az { border-bottom: 1px solid var(--h4-line); background: #fff; }
.h4 .p4-az ul {
    display: flex;
    gap: 4px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.h4 .p4-az ul::-webkit-scrollbar { display: none; }
.h4 .p4-az a {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    color: var(--h4-ink2);
}
.h4 .p4-az a:hover { background: var(--h4-paper); color: var(--h4-ink); }
.h4 .p4-az a.is-active { background: var(--h4-ink); color: #fff; }

/* ---------- Layout helpers ---------- */
.h4 .p4-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 48px; }
.h4 .p4-layout .h4-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.h4 .p4-layout .h4-how { grid-template-columns: minmax(0, 1fr); gap: 28px; }
.h4 .p4-side { display: grid; gap: 20px; }
.h4 .p4-card { padding: 22px; border: 1px solid var(--h4-line); border-radius: 20px; background: #fff; }
.h4 .p4-card h2 { font-size: 1.2rem; letter-spacing: 0; }
.h4 .p4-card p { margin-top: 8px; font-size: .95rem; color: var(--h4-ink2); }
.h4 .p4-card .h4-btn { width: 100%; margin-top: 16px; }

.h4 .p4-list { margin-top: 8px; }
.h4 .p4-list li + li { border-top: 1px solid var(--h4-line); }
.h4 .p4-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; }
.h4 .p4-list a span { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.h4 .p4-list a small { flex: none; font-size: .8125rem; color: var(--h4-mute); }
.h4 .p4-list a:hover span { color: var(--h4-red); }
.h4 .p4-list li:last-child a { padding-bottom: 0; }

/* ---------- Category directory ---------- */
.h4 .p4-catblocks { display: grid; gap: 20px; }
.h4 .p4-catblock {
    padding: 22px 24px;
    border: 1px solid var(--h4-line);
    border-radius: 18px;
    background: #fff;
}
.h4 .p4-catblock__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.h4 .p4-catblock__head h2 { font-size: 1.25rem; letter-spacing: 0; }
.h4 .p4-catblock__head h2 a:hover { color: var(--h4-red); }
.h4 .p4-catblock .h4-cloud { gap: 8px; }
.h4 .p4-catblock .h4-cloud a { background: var(--h4-paper); }

/* ---------- Store directory tiles ---------- */
.h4 .p4-storegrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.h4 .p4-store {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    height: 100%;
    padding: 20px 12px 16px;
    border: 1px solid var(--h4-line);
    border-radius: 16px;
    background: #fff;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.h4 .p4-store:hover { border-color: var(--h4-ink); box-shadow: var(--h4-shadow); }
.h4 .p4-store strong { margin-top: 10px; font-weight: 600; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.h4 .p4-store small { font-size: .8125rem; color: var(--h4-mute); }

.h4 .p4-more { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- Prose / legal / article ---------- */
.h4 .p4-prose { max-width: 72ch; }
.h4 .p4-prose > * + * { margin-top: 14px; }
.h4 .p4-prose h2 { margin-top: 36px; font-size: 1.45rem; letter-spacing: 0; }
.h4 .p4-prose h3 { margin-top: 24px; font-size: 1.15rem; }
.h4 .p4-prose p,
.h4 .p4-prose li { color: var(--h4-ink2); }
.h4 .p4-prose ul,
.h4 .p4-prose ol { padding-left: 1.2em; }
.h4 .p4-prose ul { list-style: disc; }
.h4 .p4-prose ol { list-style: decimal; }
.h4 .p4-prose li + li { margin-top: 6px; }
.h4 .p4-prose a {
    color: var(--h4-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--h4-red);
    text-underline-offset: 3px;
}
.h4 .p4-prose strong { color: var(--h4-ink); }

.h4 .p4-article { max-width: 74ch; margin-inline: auto; }
.h4 .p4-article__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .875rem; color: var(--h4-mute); }
.h4 .p4-article__media {
    margin: 28px 0;
    overflow: hidden;
    border-radius: 18px;
    background: #ebe8e2;
    aspect-ratio: 16 / 9;
}
.h4 .p4-article__media img { width: 100%; height: 100%; object-fit: cover; }
.h4 .p4-article .p4-prose { max-width: none; }

/* ---------- Forms ---------- */
.h4 .p4-form { display: grid; gap: 16px; }
.h4 .p4-form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--h4-ink); }
.h4 .p4-form input,
.h4 .p4-form textarea,
.h4 .p4-form select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--h4-line);
    border-radius: 12px;
    background: #fff;
    font: 500 1rem/1.3 var(--h4-body);
    color: var(--h4-ink);
}
.h4 .p4-form textarea { min-height: 140px; padding: 14px 16px; resize: vertical; }
.h4 .p4-form input:focus,
.h4 .p4-form textarea:focus,
.h4 .p4-form select:focus { border-color: var(--h4-ink); outline: 0; }
.h4 .p4-form__msg { min-height: 1.3em; font-weight: 600; font-size: .875rem; }
.h4 .p4-form__msg.is-error { color: #8a1815; }
.h4 .p4-form__msg.is-ok { color: #0a5238; }
.h4 .p4-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.h4 .p4-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.h4 .p4-contact__ways { display: grid; gap: 14px; margin-top: 22px; }
.h4 .p4-contact__way {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--h4-line);
    border-radius: 14px;
    background: #fff;
}
.h4 .p4-contact__way span {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--h4-paper);
    color: var(--h4-red);
}
.h4 .p4-contact__way strong { display: block; font-weight: 700; }
.h4 .p4-contact__way small { display: block; margin-top: 2px; color: var(--h4-ink2); }
.h4 .p4-contact__form {
    padding: 26px;
    border: 1px solid var(--h4-line);
    border-radius: 20px;
    background: #fff;
}

/* ---------- Empty / error ---------- */
.h4 .p4-empty {
    padding: 48px 24px;
    border: 1.5px dashed #d5d0c7;
    border-radius: 20px;
    background: var(--h4-paper);
    text-align: center;
}
.h4 .p4-empty h2 { margin-top: 10px; font-size: 1.4rem; }
.h4 .p4-empty p { max-width: 42ch; margin: 8px auto 0; color: var(--h4-ink2); }
.h4 .p4-empty .h4-btn { margin-top: 20px; }

/* ---------- Gift cards (valentine gifts) ---------- */
.h4 .p4-gifts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.h4 .p4-gift {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--h4-line);
    border-radius: 16px;
    background: #fff;
}
.h4 .p4-gift__media { aspect-ratio: 1; background: #ebe8e2; }
.h4 .p4-gift__media img { width: 100%; height: 100%; object-fit: cover; }
.h4 .p4-gift__body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.h4 .p4-gift__body strong { font: 700 1.05rem/1.25 var(--h4-display); }
.h4 .p4-gift__body p { font-size: .9rem; color: var(--h4-ink2); }
.h4 .p4-gift__body .h4-btn { width: 100%; margin-top: auto; }

@media (max-width: 1100px) {
    .h4 .p4-storegrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .h4 .p4-layout { gap: 32px; }
}

@media (max-width: 900px) {
    .h4 #content,
    .h4 .p4-sec { scroll-margin-top: 72px; }
    .h4 .p4-hero { padding: 24px 0 36px; }
    .h4 .p4-layout,
    .h4 .p4-contact { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .h4 .p4-storegrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .h4 .p4-gifts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h4 .p4-form__row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .h4 .p4-storegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .h4 .p4-store { padding: 14px 8px 12px; }
    .h4 .p4-gifts { grid-template-columns: minmax(0, 1fr); }
    .h4 .p4-contact__form { padding: 18px; }
}
