/*
Theme Name: Offer Bazaar
Theme URI: https://example.com/offer-bazaar
Author: Codex
Author URI: https://example.com
Description: A modern brochure directory theme for supermarkets, hypermarkets, restaurants, cafes, and local offers.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: offer-bazaar
*/

:root {
  --bg: #f7f5ef;
  --surface: #fffdfa;
  --ink: #161616;
  --muted: #68645d;
  --line: #ded8cd;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --accent: #eab308;
  --rose: #be123c;
  --blue: #2563eb;
  --shadow: 0 18px 48px rgba(22, 22, 22, .1);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(222, 216, 205, .75);
  background: rgba(247, 245, 239, .9);
  backdrop-filter: blur(18px);
}

.nav-wrap,
.section,
.hero-inner {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
  font-size: .92rem;
}

.menu a:hover {
  color: var(--ink);
  background: #ece7db;
}

.hero {
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(15, 118, 110, .9), rgba(11, 79, 74, .72)),
    url("assets/hero-market.svg") center/cover no-repeat;
  color: #fff;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: 560px;
  padding: 70px 0 54px;
}

.compact-hero .hero-inner {
  min-height: 430px;
  padding: 56px 0 44px;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  line-height: .95;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(1rem, 1.7vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  line-height: 1;
}

.button.primary {
  color: var(--ink);
  background: var(--accent);
}

.button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .1);
}

.button.download {
  border-color: var(--line);
  background: #fff;
}

.hero-panel {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
}

.offer-stack {
  display: grid;
  gap: 12px;
}

.mini-offer {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 12px;
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--ink);
}

.mini-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--rose);
  font-weight: 900;
}

.mini-offer:nth-child(2) .mini-icon {
  background: var(--blue);
}

.mini-offer:nth-child(3) .mini-icon {
  background: var(--brand);
}

.mini-offer strong,
.shop-card strong,
.brochure-card strong {
  display: block;
}

.mini-offer span,
.shop-card span,
.brochure-card span {
  color: var(--muted);
  font-size: .9rem;
}

.section {
  padding: 58px 0;
}

.store-strip-section {
  padding-top: 24px;
  padding-bottom: 0;
}

.store-strip-wrap {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(22, 22, 22, .06);
}

.store-strip {
  display: grid;
  grid-auto-columns: 92px;
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.store-logo-card {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  text-align: center;
}

.store-logo-card:hover {
  border-color: rgba(15, 118, 110, .35);
  box-shadow: 0 10px 24px rgba(22, 22, 22, .08);
}

.store-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.sample-logo {
  padding: 8px;
  font-size: .86rem;
}

.offer-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.category-sidebar {
  position: sticky;
  top: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(22, 22, 22, .05);
}

.category-sidebar h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-list a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 6px;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 800;
}

.category-list a:hover {
  background: #f1ede4;
}

.category-list-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.category-list small {
  color: var(--muted);
  font-size: .78rem;
}

.offer-main {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2,
.archive-title,
.entry-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.04;
}

.section-head p,
.archive-intro {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-tile {
  min-height: 158px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(22, 22, 22, .04);
}

.category-tile:hover,
.shop-card:hover,
.brochure-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-tile,
.shop-card,
.brochure-card {
  transition: transform .18s ease, box-shadow .18s ease;
}

.category-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.category-tile:nth-child(2n) .category-icon {
  background: var(--rose);
}

.category-tile:nth-child(3n) .category-icon {
  background: var(--blue);
}

.category-tile h3 {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.category-tile p {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
}

.shop-grid,
.brochure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.offer-shop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shop-card,
.brochure-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.shop-media {
  aspect-ratio: 16 / 10;
  background: #e8e1d2;
}

.shop-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--rose));
  font-size: 2.8rem;
  font-weight: 900;
}

.shop-body,
.brochure-card {
  padding: 18px;
}

.shop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: var(--radius);
  color: var(--brand-dark);
  background: #d7f3ee;
  font-size: .82rem;
  font-weight: 800;
}

.page-band {
  border-bottom: 1px solid var(--line);
  background: #fffdfa;
}

.page-band .section {
  padding-top: 48px;
  padding-bottom: 44px;
}

.single-shop {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: start;
}

.single-shop-media {
  overflow: hidden;
  border-radius: var(--radius);
  background: #e8e1d2;
  box-shadow: var(--shadow);
}

.single-shop-media img,
.single-shop-media .shop-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.content {
  color: var(--muted);
  font-size: 1rem;
}

.page-content {
  width: min(860px, 100%);
}

.builder-page {
  min-height: 60vh;
}

.brochure-card {
  display: flex;
  flex-direction: column;
  min-height: 176px;
}

.brochure-visual-card {
  padding: 0;
  min-height: 0;
}

.brochure-preview {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 5;
  place-items: center;
  overflow: hidden;
  background: #e8e1d2;
}

.brochure-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brochure-preview::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .58));
}

.view-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(234, 179, 8, .92);
  font-size: .88rem;
  font-weight: 900;
}

.brochure-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.pdf-badge {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--rose);
  font-weight: 900;
}

.pdf-badge.large {
  width: 84px;
  height: 84px;
  margin: 0;
  font-size: 1.25rem;
}

.brochure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.brochure-actions .button {
  min-height: 38px;
  padding: 9px 12px;
  font-size: .88rem;
}

.brochure-actions .button.view {
  color: #fff;
  background: var(--brand);
}

.brochure-actions .button.download {
  border-color: var(--line);
  background: #fff;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 253, 250, .65);
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fffdfa;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
  font-size: .92rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

@media (max-width: 900px) {
  .hero-inner,
  .single-shop {
    grid-template-columns: 1fr;
  }

  .offer-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
  }

  .category-grid,
  .shop-grid,
  .brochure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-wrap,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu {
    width: 100%;
  }

  .menu a {
    padding-inline: 10px;
  }

  .hero-inner {
    min-height: auto;
    padding: 50px 0 38px;
  }

  .category-grid,
  .shop-grid,
  .brochure-grid {
    grid-template-columns: 1fr;
  }

  .store-strip {
    grid-auto-columns: 82px;
  }

  .store-logo-card {
    width: 82px;
    height: 82px;
  }

  .mini-offer {
    grid-template-columns: 48px 1fr;
  }

  .mini-offer .pill {
    grid-column: 2;
    width: max-content;
  }
}

/* D4D-inspired offers dashboard */
:root {
  --bg: #e9e9e9;
  --surface: #fff;
  --brand: #8b3fd6;
  --brand-dark: #6f2fba;
  --accent: #ffc928;
  --line: #e6e6e6;
  --muted: #6d6d6d;
  --shadow: 0 6px 22px rgba(0, 0, 0, .12);
}

.offers-dashboard {
  background: var(--bg);
}

.site-header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.nav-wrap {
  min-height: 58px;
}

.brand-mark {
  background: var(--brand);
}

.menu a {
  min-height: 34px;
  font-size: .88rem;
}

.dashboard-top {
  padding-top: 22px;
  padding-bottom: 0;
}

.dashboard-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
  padding: 18px 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .08);
}

.dashboard-titlebar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.dashboard-titlebar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.store-strip-section {
  padding-top: 24px;
}

.store-strip-wrap {
  padding: 14px 48px;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}

.store-strip-wrap::before,
.store-strip-wrap::after {
  position: absolute;
}

.store-strip {
  grid-auto-columns: 90px;
  gap: 12px;
}

.store-logo-card {
  width: 90px;
  height: 90px;
  border-color: #eee;
  border-radius: 10px;
  color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.store-logo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 63, 214, .42);
}

.offer-layout {
  width: min(var(--max), calc(100% - 32px));
  grid-template-columns: 230px minmax(0, 1fr);
  padding-top: 24px;
}

.category-sidebar {
  top: 82px;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .08);
}

.category-sidebar h2 {
  padding: 0 2px 10px;
  border-bottom: 1px solid #eee;
}

.category-list a {
  min-height: 42px;
  padding: 7px;
  font-size: .9rem;
}

.category-list-icon {
  background: #f0e6ff;
  color: var(--brand-dark);
}

.offer-main {
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .08);
}

.offer-main .section-head {
  align-items: center;
  margin-bottom: 12px;
}

.offer-main .section-head h2 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.offer-main .section-head p {
  font-size: .92rem;
}

.offer-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #f9f9f9;
}

.offer-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 18px;
  color: #555;
  font-weight: 900;
}

.offer-tab.active {
  color: #fff;
  background: var(--brand);
}

.offer-brochure-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.brochure-visual-card {
  overflow: hidden;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.brochure-visual-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.brochure-preview {
  aspect-ratio: 3 / 4.25;
  background:
    linear-gradient(135deg, rgba(139, 63, 214, .08), rgba(255, 201, 40, .18)),
    #f3f3f3;
}

.brochure-preview img {
  object-fit: cover;
}

.view-overlay {
  right: 10px;
  bottom: 10px;
  padding: 7px 9px;
  background: rgba(255, 169, 38, .95);
  font-size: .78rem;
}

.brochure-shop-badge {
  position: absolute;
  right: 10px;
  bottom: -24px;
  z-index: 2;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
}

.brochure-shop-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.brochure-info {
  padding: 32px 12px 12px;
}

.brochure-info strong {
  min-height: 42px;
  font-size: .98rem;
  line-height: 1.25;
}

.brochure-info span {
  font-size: .84rem;
}

.brochure-actions {
  gap: 6px;
  padding-top: 12px;
}

.brochure-actions .button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: .78rem;
}

.button.primary,
.brochure-actions .button.view {
  background: var(--brand);
  color: #fff;
}

.button.primary:hover,
.brochure-actions .button.view:hover {
  background: var(--brand-dark);
}

.pdf-badge.large {
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(139, 63, 214, .25);
}

@media (max-width: 1100px) {
  .offer-brochure-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .offer-layout {
    width: min(var(--max), calc(100% - 32px));
  }

  .offer-brochure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .store-strip-wrap {
    padding: 12px;
  }

  .offer-main {
    padding: 14px;
  }

  .offer-main .section-head {
    align-items: stretch;
  }

  .offer-tabs {
    width: 100%;
  }

  .offer-tab {
    flex: 1;
    justify-content: center;
    padding-inline: 10px;
  }

  .offer-brochure-grid {
    grid-template-columns: 1fr;
  }
}
