/*
Theme Name: SaveSpot Coupons
Theme URI: https://example.com/savespot
Author: SaveSpot
Description: A fast, responsive and SEO-friendly coupon & deals theme. Includes Stores and Coupons post types, deal categories, click-to-reveal coupon codes, tracked outbound links, A-Z store directory and JSON-LD schema markup.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
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: savespot
Tags: e-commerce, blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* ---------- Variables ---------- */
:root {
	--ss-primary: #0b7a5e;
	--ss-accent: #ff6b2c;
	--ss-dark: #14213d;
	--ss-text: #2b2f38;
	--ss-muted: #6b7280;
	--ss-border: #e5e7eb;
	--ss-bg: #f5f7fa;
	--ss-white: #ffffff;
	--ss-radius: 12px;
	--ss-shadow: 0 2px 10px rgba(20, 33, 61, .06);
	--ss-shadow-hover: 0 8px 24px rgba(20, 33, 61, .12);
	--ss-max: 1200px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--ss-text);
	background: var(--ss-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ss-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ss-dark); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; }
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: #fff; clip: auto !important; clip-path: none; color: var(--ss-dark); display: block;
	height: auto; left: 8px; top: 8px; padding: 12px 20px; width: auto; z-index: 100000;
}
.container { max-width: var(--ss-max); margin: 0 auto; padding: 0 20px; }
.section { padding-top: 40px; padding-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .gallery-caption { font-size: .85rem; color: var(--ss-muted); }
.sticky, .bypostauthor { display: block; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
	font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none !important;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ss-primary); color: #fff; }
.btn-accent { background: var(--ss-accent); color: #fff; }
.btn-outline { background: transparent; color: var(--ss-primary); border: 2px solid var(--ss-primary); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { background: var(--ss-white); border-bottom: 1px solid var(--ss-border); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.site-branding { flex-shrink: 0; }
.site-branding .custom-logo { max-height: 48px; width: auto; }
.site-title { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.5px; }
.site-title a { color: var(--ss-dark); }
.site-title a span { color: var(--ss-primary); }
.site-description { margin: 0; font-size: .8rem; color: var(--ss-muted); }
.header-search { flex: 1; max-width: 520px; }
.search-form { display: flex; background: var(--ss-bg); border: 1px solid var(--ss-border); border-radius: 999px; overflow: hidden; }
.search-form .search-field { flex: 1; border: 0; background: transparent; padding: 11px 18px; min-width: 0; outline: none; }
.search-form .search-submit { border: 0; background: var(--ss-primary); color: #fff; padding: 0 20px; cursor: pointer; font-weight: 700; }
.search-form:focus-within { border-color: var(--ss-primary); box-shadow: 0 0 0 3px rgba(11, 122, 94, .15); }
.main-navigation { margin-left: auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-navigation li { position: relative; }
.main-navigation a { display: block; padding: 10px 12px; color: var(--ss-dark); font-weight: 600; border-radius: 8px; }
.main-navigation a:hover, .main-navigation .current-menu-item > a { background: var(--ss-bg); text-decoration: none; color: var(--ss-primary); }
.main-navigation ul ul {
	display: none; position: absolute; top: 100%; left: 0; min-width: 200px; flex-direction: column;
	background: #fff; border: 1px solid var(--ss-border); border-radius: 10px; box-shadow: var(--ss-shadow-hover); padding: 6px;
}
.main-navigation li:hover > ul, .main-navigation li:focus-within > ul { display: flex; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--ss-border); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.menu-toggle-bar { display: block; width: 20px; height: 2px; background: var(--ss-dark); margin: 4px 0; }

/* ---------- Hero ---------- */
.hero {
	background: linear-gradient(135deg, var(--ss-dark) 0%, var(--ss-primary) 100%);
	color: #fff; padding: 56px 0 64px; text-align: center;
}
.hero h1 { color: #fff; font-size: 2.4rem; margin-bottom: .3em; }
.hero p { font-size: 1.1rem; opacity: .9; margin-bottom: 1.4em; }
.hero .search-form { max-width: 640px; margin: 0 auto; background: #fff; border: 0; }
.hero .search-form .search-field { padding: 16px 22px; font-size: 1.05rem; }
.hero .search-form .search-submit { padding: 0 28px; background: var(--ss-accent); }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.hero-chips a { background: rgba(255,255,255,.14); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .9rem; }
.hero-chips a:hover { background: rgba(255,255,255,.26); text-decoration: none; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-stores { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid-coupons { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- Store card ---------- */
.store-card {
	background: #fff; border: 1px solid var(--ss-border); border-radius: var(--ss-radius);
	padding: 18px 14px; text-align: center; box-shadow: var(--ss-shadow); transition: box-shadow .2s, transform .2s;
	display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ss-text);
}
.store-card:hover { box-shadow: var(--ss-shadow-hover); transform: translateY(-2px); text-decoration: none; }
.store-card .store-name { font-weight: 700; color: var(--ss-dark); }
.store-card .store-count { font-size: .85rem; color: var(--ss-muted); }
.store-logo {
	width: 96px; height: 96px; border-radius: 50%; background: #fff; border: 1px solid var(--ss-border);
	display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.store-logo img { max-width: 80%; max-height: 80%; object-fit: contain; }
.store-logo-placeholder {
	width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
	background: var(--ss-primary); color: #fff; font-size: 2rem; font-weight: 800;
}

/* ---------- Category card ---------- */
.cat-card {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	background: #fff; border: 1px solid var(--ss-border); border-radius: var(--ss-radius); padding: 16px 18px;
	color: var(--ss-dark); font-weight: 700; box-shadow: var(--ss-shadow);
}
.cat-card:hover { border-color: var(--ss-primary); color: var(--ss-primary); text-decoration: none; }
.cat-card .cat-count { font-size: .8rem; font-weight: 600; background: var(--ss-bg); color: var(--ss-muted); padding: 2px 10px; border-radius: 999px; }

/* ---------- Coupon card ---------- */
.coupon-list { display: flex; flex-direction: column; gap: 16px; }
.coupon-card {
	display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: center;
	background: #fff; border: 1px solid var(--ss-border); border-radius: var(--ss-radius);
	padding: 18px; box-shadow: var(--ss-shadow); transition: box-shadow .2s;
}
.coupon-card:hover { box-shadow: var(--ss-shadow-hover); }
.grid-coupons .coupon-card { grid-template-columns: 90px 1fr; }
.grid-coupons .coupon-action { grid-column: 1 / -1; }
.coupon-discount {
	min-height: 90px; border-radius: 10px; background: rgba(11, 122, 94, .08); color: var(--ss-primary);
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px;
	font-weight: 800; font-size: 1.35rem; line-height: 1.1; word-break: break-word;
}
.coupon-discount small { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.coupon-discount.has-logo { background: #fff; border: 1px solid var(--ss-border); }
.coupon-discount.has-logo img { max-height: 60px; object-fit: contain; }
.coupon-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 4px; background: var(--ss-bg); color: var(--ss-muted); }
.badge-code { background: rgba(11, 122, 94, .1); color: var(--ss-primary); }
.badge-deal { background: rgba(255, 107, 44, .12); color: var(--ss-accent); }
.badge-verified { background: #e7f7ee; color: #12805c; }
.badge-exclusive { background: var(--ss-dark); color: #fff; }
.badge-expired { background: #fde8e8; color: #b42318; }
.coupon-title { font-size: 1.1rem; margin: 0 0 4px; }
.coupon-title a { color: var(--ss-dark); }
.coupon-store-line { font-size: .88rem; color: var(--ss-muted); margin-bottom: 4px; }
.coupon-desc { font-size: .92rem; color: var(--ss-muted); margin: 0 0 6px; }
.coupon-foot { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ss-muted); }
.coupon-foot details summary { cursor: pointer; color: var(--ss-primary); font-weight: 600; }
.coupon-foot details[open] { flex-basis: 100%; }
.coupon-foot details div { margin-top: 6px; background: var(--ss-bg); padding: 10px; border-radius: 8px; }
.coupon-action { min-width: 180px; }

/* Click-to-reveal button with code "peek" */
.btn-reveal {
	position: relative; display: flex; align-items: stretch; width: 100%; min-height: 46px; padding: 0;
	border: 2px dashed var(--ss-primary); border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden;
}
.btn-reveal .reveal-peek {
	flex: 1; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px;
	font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; color: var(--ss-dark); letter-spacing: 1px;
}
.btn-reveal .reveal-label {
	position: absolute; inset: 0 34px 0 0; display: flex; align-items: center; justify-content: center;
	background: var(--ss-primary); color: #fff; font-weight: 800; font-size: .95rem;
	clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%); transition: inset .2s ease;
}
.btn-reveal:hover .reveal-label { inset: 0 46px 0 0; }
.coupon-card.is-expired { opacity: .7; }

/* ---------- Store page ---------- */
.store-hero { background: #fff; border-bottom: 1px solid var(--ss-border); padding: 28px 0; }
.store-hero-inner { display: flex; gap: 24px; align-items: center; }
.store-hero .store-logo { width: 120px; height: 120px; }
.store-hero h1 { margin-bottom: 6px; }
.store-hero .store-sub { color: var(--ss-muted); margin: 0 0 10px; }
.store-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; color: var(--ss-muted); }
.store-stats strong { color: var(--ss-dark); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding-top: 28px; padding-bottom: 48px; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tabs button {
	border: 1px solid var(--ss-border); background: #fff; padding: 8px 16px; border-radius: 999px;
	cursor: pointer; font-weight: 600; color: var(--ss-text);
}
.filter-tabs button.is-active { background: var(--ss-dark); border-color: var(--ss-dark); color: #fff; }
.widget, .box { background: #fff; border: 1px solid var(--ss-border); border-radius: var(--ss-radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--ss-shadow); }
.widget-title, .box h2, .box h3 { font-size: 1.05rem; margin-bottom: 12px; }
.widget ul, .box ul { list-style: none; margin: 0; padding: 0; }
.widget li, .box li { padding: 7px 0; border-bottom: 1px solid var(--ss-border); }
.widget li:last-child, .box li:last-child { border-bottom: 0; }
.store-about { margin-top: 28px; }
.expired-heading { margin-top: 36px; color: var(--ss-muted); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--ss-muted); padding-top: 14px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #c0c4cc; }

/* ---------- A–Z ---------- */
.az-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.az-nav a { min-width: 38px; text-align: center; padding: 7px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--ss-border); font-weight: 700; color: var(--ss-dark); }
.az-nav a.is-active, .az-nav a:hover { background: var(--ss-primary); border-color: var(--ss-primary); color: #fff; text-decoration: none; }

/* ---------- Page header ---------- */
.page-header { background: #fff; border-bottom: 1px solid var(--ss-border); padding: 28px 0; }
.page-header h1 { margin: 0; }
.page-header p { margin: 8px 0 0; color: var(--ss-muted); }

/* ---------- Content / posts ---------- */
.entry { background: #fff; border: 1px solid var(--ss-border); border-radius: var(--ss-radius); padding: 28px; margin-bottom: 24px; box-shadow: var(--ss-shadow); }
.entry-meta { font-size: .85rem; color: var(--ss-muted); margin-bottom: 12px; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-thumb { margin: -28px -28px 20px; border-radius: var(--ss-radius) var(--ss-radius) 0 0; overflow: hidden; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0; }
.page-numbers { padding: 8px 14px; background: #fff; border: 1px solid var(--ss-border); border-radius: 8px; color: var(--ss-dark); font-weight: 600; }
.page-numbers.current { background: var(--ss-primary); color: #fff; border-color: var(--ss-primary); }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { background: var(--ss-bg); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px; border: 1px solid var(--ss-border); border-radius: 8px;
}

/* ---------- FAQ ---------- */
.faq details { background: #fff; border: 1px solid var(--ss-border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ss-dark); }
.faq details p { margin: 10px 0 0; color: var(--ss-muted); }

/* ---------- 404 / empty ---------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .big { font-size: 5rem; font-weight: 900; color: var(--ss-primary); line-height: 1; margin-bottom: 10px; }
.empty-state .search-form { max-width: 480px; margin: 20px auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ss-dark); color: rgba(255,255,255,.75); padding: 48px 0 0; margin-top: 40px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.site-footer .widget { background: transparent; border: 0; padding: 0; box-shadow: none; }
.site-footer .widget li { border-color: rgba(255,255,255,.1); }
.site-footer h2, .site-footer h3, .site-footer .widget-title { color: #fff; font-size: 1rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.disclosure { font-size: .8rem; opacity: .7; }

/* ---------- Modal ---------- */
.ss-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ss-modal[hidden] { display: none; }
.ss-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 32, .6); }
.ss-modal-box {
	position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 520px; padding: 32px 28px 28px;
	text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: ss-pop .2s ease;
}
@keyframes ss-pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ss-modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ss-muted); }
.ss-modal-store { font-size: .85rem; font-weight: 700; color: var(--ss-primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ss-modal h3 { font-size: 1.3rem; margin-bottom: 18px; }
.ss-code-wrap { display: flex; border: 2px dashed var(--ss-primary); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.ss-code { flex: 1; border: 0; text-align: center; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.4rem; font-weight: 800; letter-spacing: 2px; padding: 12px; min-width: 0; color: var(--ss-dark); background: #f8fffc; }
.ss-copy { border-radius: 0; }
.ss-copy.is-copied { background: #12805c; }
.ss-modal-note { font-size: .88rem; color: var(--ss-muted); margin-bottom: 18px; }
.ss-modal .ss-deal-only .ss-code-wrap { display: none; }
body.ss-modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 760px) {
	h1 { font-size: 1.6rem; }
	.hero { padding: 40px 0 44px; }
	.hero h1 { font-size: 1.8rem; }
	.header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 0; }
	.header-search { order: 3; flex-basis: 100%; max-width: none; }
	.menu-toggle { display: block; }
	.main-navigation { flex-basis: 100%; order: 4; display: none; }
	.main-navigation.is-open { display: block; }
	.main-navigation ul { flex-direction: column; }
	.main-navigation ul ul { position: static; display: flex; box-shadow: none; border: 0; padding-left: 14px; }
	.coupon-card { grid-template-columns: 80px 1fr; }
	.coupon-action { grid-column: 1 / -1; }
	.coupon-discount { min-height: 80px; font-size: 1.1rem; }
	.grid-coupons { grid-template-columns: 1fr; }
	.grid-stores { grid-template-columns: repeat(2, 1fr); }
	.store-hero-inner { flex-direction: column; text-align: center; }
	.store-stats { justify-content: center; }
	.footer-cols { grid-template-columns: 1fr; }
}
