/*
Theme Name: PercentPocket
Theme URI: https://percentpocket.com/
Author: Huy
Description: Theme web coupon PercentPocket: trang chủ, trang store, mã giảm giá với nút Show Code mở link affiliate, ô tìm kiếm có gợi ý khi gõ.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: percentpocket
*/

:root {
	--red: #D63B3F;
	--red-dark: #A1262B;
	--purple: #8E24AA;
	--blue: #1F5FBF;
	--green: #2E7D32;
	--ink: #222222;
	--muted: #666666;
	--line: #E6E6E6;
	--soft: #F7F8FA;
	--field: #F2F3F5;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink);
	background: #FFFFFF;
}
a { color: #C8343A; }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 22px; border: 0; border-radius: 4px;
	background: var(--red); color: #FFFFFF; font: inherit; font-weight: 500;
	text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); color: #FFFFFF; }
.btn--orange { background: #C94F00; }
.btn--orange:hover { background: #A64100; }
.btn--block { width: 100%; }

/* Header */
.site-header { background: #FFFFFF; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; line-height: 1; text-decoration: none; color: var(--ink); }
.brand__mark { flex: 0 0 auto; display: block; }
.brand__words { display: flex; flex-direction: column; gap: 4px; }
.brand__name { font-size: 25px; font-weight: 900; letter-spacing: -0.02em; color: var(--ink); }
.brand__name span { color: var(--red); }
.brand__tag { font-size: 12px; color: var(--muted); letter-spacing: 0.01em; }
.brand:hover .brand__name { color: var(--ink); }
.brand img { max-height: 48px; width: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: 17px; }
.main-nav a:hover { color: var(--red); }
.search-box { position: relative; flex: 1 1 260px; display: flex; align-items: center; height: 44px; padding: 0 6px 0 18px; border-radius: 8px; background: var(--field); }
.search-box input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline-offset: 4px; }
.search-box button { width: 36px; height: 36px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Live search suggestions */
.search-box:focus-within { box-shadow: 0 0 0 2px var(--red) inset; background: #FFFFFF; }
.search-box input:focus { outline: none; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; margin: 0; padding: 6px; list-style: none; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); max-height: 70vh; overflow-y: auto; }
.suggest[hidden] { display: none; }
.suggest__head { padding: 8px 10px 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.suggest a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.suggest a.is-active, .suggest a:hover { background: var(--field); color: var(--ink); }
.suggest__logo { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-size: 13px; font-weight: 700; background: #FFFFFF; border: 1px solid var(--line); }
.suggest__logo img { width: 100%; height: 100%; object-fit: contain; }
.suggest__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.suggest__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest__name mark { background: transparent; color: var(--red); font-weight: 700; }
.suggest__sub { font-size: 13px; color: var(--muted); }
.suggest__deal { flex: 0 0 auto; padding: 3px 8px; border-radius: 4px; background: #FDECEC; color: var(--red); font-size: 13px; font-weight: 700; }
.suggest__all { justify-content: center; border-top: 1px solid #F0F0F0; border-radius: 0 0 8px 8px !important; margin-top: 4px; font-size: 14px; color: var(--red) !important; }
.suggest__empty { padding: 14px 10px; font-size: 14px; color: var(--muted); }

/* Hero */
.hero { padding-top: 24px; }
.hero__box { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 48px 56px; border-radius: 12px; background: #FFF6DB; }
.hero__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 34px; font-weight: 500; line-height: 1.2; }
.hero h1 span { color: #C94F00; }
.hero p { margin: 0; font-size: 17px; color: #444444; max-width: 540px; }
.hero__art { flex: 1 1 280px; min-height: 220px; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero__svg { width: 100%; max-width: 420px; height: auto; display: block; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; }

/* Sections */
.section { padding-top: 56px; }
.section--soft { background: var(--soft); margin-top: 56px; padding-top: 48px; padding-bottom: 56px; }
.section-title { margin: 0 0 26px; text-align: center; font-size: 24px; font-weight: 500; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-head h2 { margin: 0; font-size: 24px; font-weight: 500; }
.row-head a { text-decoration: none; }

/* Store tiles */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.store-tile { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.store-tile__top { height: 112px; border-radius: 6px 6px 0 0; display: flex; align-items: center; justify-content: center; }
.store-tile__logo { width: 84px; height: 84px; border-radius: 999px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 700; font-size: 15px; text-align: center; padding: 6px; background: #FFFFFF; }
.store-tile__logo img { width: 100%; height: 100%; object-fit: contain; }
.store-tile__top--img { background: #FFFFFF !important; border: 1px solid var(--line); border-bottom: 0; }
.store-tile__logo--img { width: 100%; height: 100%; border-radius: 0; padding: 14px 16px; }
.store-tile:hover .store-tile__top { box-shadow: inset 0 0 0 2px var(--red); }
.store-tile__count { padding: 8px 6px; border-radius: 0 0 6px 6px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.store-tile__checked { margin-top: 10px; padding: 8px; border: 1px solid #D9D9D9; border-radius: 6px; text-align: center; font-size: 13px; color: var(--muted); }
.store-tile:hover .store-tile__name { color: var(--red); }

/* Latest codes rows */
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split__side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; }
.latest { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 20px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 8px; }
.latest__logo { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 6px; background: var(--field); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #555555; overflow: hidden; text-decoration: none; }
.latest__logo img { width: 100%; height: 100%; object-fit: contain; }
.latest__body { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; }
.latest__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.pill { padding: 3px 10px; border-radius: 999px; background: #EEF3FF; color: var(--blue); text-decoration: none; }
.latest__title { font-size: 18px; font-weight: 500; }
.latest__btn { width: 140px; flex: 0 0 140px; }
.top-list { background: #FFFFFF; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.top-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid #F0F0F0; color: var(--ink); text-decoration: none; }
.top-list a:first-child { border-top: 0; }
.top-list b { color: var(--red); margin-right: 12px; }
.top-list span.n { font-size: 14px; color: var(--muted); }

/* Store page */
.store-page { background: var(--soft); }
.store-page > .wrap { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-top: 28px; padding-bottom: 64px; }
.store-side { flex: 1 1 270px; display: flex; flex-direction: column; gap: 18px; }
.store-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 8px; }
.card--pad { padding: 22px 24px; }
.store-card__top { padding: 30px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.store-card__logo { max-width: 200px; max-height: 90px; display: flex; align-items: center; justify-content: center; }
.store-card__logo img { max-height: 90px; width: auto; }
.store-card__logo-text { font-size: 28px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }
.store-nav a { display: block; padding: 15px 24px 15px 28px; border-top: 1px solid #EEEEEE; color: var(--ink); text-decoration: none; }
.store-nav a.is-current { border-left: 4px solid var(--red); padding-left: 24px; }
.filter-title { font-weight: 500; font-size: 17px; margin: 0 0 12px; }
.filter-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 10px; padding: 0 14px; border: 0; border-radius: 4px; background: var(--field); color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.filter-btn .box { width: 16px; height: 16px; border: 1.5px solid #9A9A9A; border-radius: 3px; background: #FFFFFF; flex: 0 0 auto; }
.filter-btn[aria-pressed="true"] .box { background: var(--red); border-color: var(--red); }
.editor { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.editor__avatar { width: 52px; height: 52px; border-radius: 999px; background: var(--field); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.editor__name { font-weight: 500; font-size: 17px; display: block; }
.editor__role { font-size: 14px; font-style: italic; color: var(--muted); }
.small-note { margin: 0; padding: 0 4px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.store-head h1 { margin: 0; font-size: 26px; font-weight: 500; line-height: 1.25; }
.store-head p { margin: 6px 0 4px; font-size: 15px; color: #555555; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }

/* Coupon card */
.coupon { background: #FFFFFF; border: 1px solid var(--line); border-radius: 8px; }
.coupon.is-hidden { display: none; }
.coupon__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 0; padding: 22px 24px; }
.coupon__badge {
	--b: var(--red); --bg: #FFF1F1; --bd: #F4B4B6;
	position: relative; flex: 0 0 112px; width: 112px; min-height: 96px; padding: 12px 8px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	border: 1.5px dashed var(--bd); border-radius: 10px; background: var(--bg); color: var(--b); text-align: center; word-break: break-word;
}
.coupon__badge::before, .coupon__badge::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #FFFFFF; border: 1.5px dashed var(--bd); }
.coupon__badge::before { left: -8px; clip-path: inset(0 0 0 50%); }
.coupon__badge::after { right: -8px; clip-path: inset(0 50% 0 0); }
.coupon__amount { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.coupon__badge small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.coupon__badge--deal { --b: #2E7D32; --bg: #EEF7EF; --bd: #A8D5AB; }
.coupon--best .coupon__badge { --b: var(--purple); --bg: #F6ECF9; --bd: #D7A6E2; }
.coupon__body { flex: 1 1 280px; padding: 0 24px 0 28px; display: flex; flex-direction: column; gap: 6px; }
.coupon__type { font-size: 14px; font-weight: 500; color: var(--blue); letter-spacing: 0.02em; }
.coupon__type--deal { color: var(--green); }
.coupon__title { margin: 0; font-size: 19px; font-weight: 500; line-height: 1.35; }
.coupon__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.coupon__foot { padding: 10px 24px; border-top: 1px solid #F0F0F0; text-align: center; font-size: 14px; color: var(--muted); }
.coupon--best { border-color: var(--purple); overflow: hidden; }
.coupon__ribbon { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--purple); color: #FFFFFF; font-size: 15px; }
.coupon__ribbon strong { letter-spacing: 0.02em; }

/* Show code button: red block + dashed box with code tail + folded corner */
.code-btn { position: relative; width: 172px; height: 44px; padding: 0; border: 1.5px dashed var(--red); border-radius: 4px; background: #FFFFFF; font: inherit; cursor: pointer; flex: 0 0 auto; }
.code-btn__tail { position: absolute; right: 8px; top: 0; bottom: 0; display: flex; align-items: center; font-weight: 700; color: var(--red); }
.code-btn__face { position: absolute; left: -1.5px; top: -1.5px; bottom: -1.5px; width: 128px; display: flex; align-items: center; justify-content: center; border-radius: 4px 0 0 4px; background: var(--red); color: #FFFFFF; font-weight: 500; transition: width .15s ease; }
.code-btn__fold { position: absolute; left: 109px; top: -1.5px; width: 18px; height: 18px; background: linear-gradient(225deg, #FFFFFF 50%, #F2A7A9 50%); }
.code-btn:hover .code-btn__face { width: 118px; }
.code-btn:hover .code-btn__fold { left: 99px; }
.code-btn--deal { text-decoration: none; }
.code-btn--deal .code-btn__face { width: calc(100% + 3px); border-radius: 4px; }
.code-btn--deal:hover .code-btn__face { width: calc(100% + 3px); background: var(--red-dark); color: #FFFFFF; }
.coupon--best .code-btn { border-color: var(--purple); }
.coupon--best .code-btn__face { background: var(--purple); }
.coupon--best .code-btn__tail { color: var(--purple); }
.coupon--best .code-btn__fold { background: linear-gradient(225deg, #FFFFFF 50%, #D7A6E2 50%); }

.code-reveal { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 4px 4px 4px 14px; border: 1.5px dashed var(--red); border-radius: 4px; flex: 0 0 auto; }
.code-reveal__code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 16px; }
.code-reveal button { height: 34px; padding: 0 12px; border: 0; border-radius: 4px; background: var(--red); color: #FFFFFF; font: inherit; font-size: 14px; cursor: pointer; }
.coupon--best .code-reveal { border-color: var(--purple); }
.coupon--best .code-reveal button { background: var(--purple); }
.coupon.is-open .code-btn { display: none; }
.coupon.is-open .code-reveal { display: inline-flex; }

/* Content blocks */
.content-card { padding: 24px; }
.content-card h2 { margin: 0 0 12px; font-size: 21px; font-weight: 500; }
.content-card ol, .content-card ul { margin: 0; padding-left: 22px; line-height: 1.6; color: #333333; }
.content-card p { line-height: 1.65; color: #333333; }
.content-card p:first-of-type { margin-top: 0; }
.faq details { padding: 14px 0; border-top: 1px solid #F0F0F0; }
.faq summary { font-weight: 500; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: #555555; line-height: 1.6; }
.expired summary { cursor: pointer; font-weight: 500; }
.expired ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Generic pages */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 40px 24px 64px; }
.page-wrap h1 { font-size: 32px; font-weight: 500; margin: 0 0 20px; }
.page-wrap .entry { line-height: 1.7; }
.az { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.az a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #D9D9D9; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.store-list { columns: 3 220px; column-gap: 28px; }
.store-list h2 { font-size: 20px; font-weight: 500; margin: 0 0 8px; break-after: avoid; }
.store-list ul { list-style: none; margin: 0 0 22px; padding: 0; break-inside: avoid; }
.store-list li { padding: 4px 0; }
.store-list a { color: var(--ink); text-decoration: none; }
.store-list a:hover { color: var(--red); }

/* Footer */
.site-footer { background: var(--ink); color: #CCCCCC; margin-top: 0; }
.site-footer .wrap { padding-top: 44px; padding-bottom: 44px; display: flex; flex-direction: column; gap: 18px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.site-footer a { color: #FFFFFF; }
.site-footer p { margin: 0; font-size: 14px; line-height: 1.6; max-width: 820px; }

@media (max-width: 640px) {
	.site-header .wrap { gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; padding-left: 16px; padding-right: 16px; }
	.brand { flex: 1 1 auto; }
	.brand__mark { width: 34px; height: 34px; }
	.brand__name { font-size: 21px; }
	.brand__tag { display: none; }
	.main-nav ul { gap: 6px 16px; }
	.main-nav a { font-size: 15px; }
	.main-nav li:nth-child(n+2) { display: none; }
	.search-box { flex-basis: 100%; height: 42px; }
	.wrap { padding-left: 16px; padding-right: 16px; }
	.hero__box { padding: 32px 22px; }
	.hero h1 { font-size: 28px; }
	.coupon__row { padding: 18px; }
	.coupon__badge { flex-basis: 88px; width: 88px; min-height: 80px; }
	.coupon__amount { font-size: 24px; }
	.latest__btn { width: 100%; flex-basis: 100%; }
	.coupon__body { padding: 0 0 0 16px; flex-basis: 180px; }
	.code-btn, .code-reveal { width: 100%; }
	.code-btn__face { width: calc(100% - 44px); }
	.code-btn__fold { left: auto; right: 44px; }
	.code-btn:hover .code-btn__face { width: calc(100% - 44px); }
	.code-btn:hover .code-btn__fold { left: auto; }
	.code-btn--deal .code-btn__face, .code-btn--deal:hover .code-btn__face { width: calc(100% + 3px); }
}
