/*
Theme Name: DM Gift Shop
Theme URI: https://www.dmgiveway.com
Author: DM Gift Shop
Description: ثيم متجر DM Gift Shop (WooCommerce): المتجر، صفحة المنتج وتجهيز الهدية، صفحة الرسالة، ومش عارف تجيب إيه. يشتغل مع إضافة DM Gift Core.
Version: 2.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: dm-giftshop
*/

:root {
	--cream: #FFF6EE;
	--ink: #2B1E2F;
	--coral: #F2604E;
	--coral-text: #E5533F;
	--muted: #5A4A5E;
	--muted2: #6B5A6E;
	--line: #E6D9D0;
	--green: #23735F;
	--gold: #E8A33D;
	--mint: #2E9C86;
	--pink: #D9577A;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--cream);
	font-family: 'Tajawal', sans-serif;
	color: var(--ink);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
img { max-width: 100%; }
button { font-family: inherit; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
	background: var(--ink); color: var(--cream);
	text-align: center; padding: 11px 16px;
	font-size: 15px; font-weight: 500;
	display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ---------- Header ---------- */
.site-header .container {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	padding-top: 20px; padding-bottom: 20px;
}
.brand {
	display: flex; align-items: center; gap: 10px; direction: ltr;
	font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 30px;
	text-decoration: none; color: var(--ink);
}
.brand .dm { color: var(--coral-text); }
.main-nav { display: flex; flex-wrap: wrap; gap: 28px; font-size: 17px; font-weight: 500; }
.main-nav a { text-decoration: none; padding: 6px 0; transition: color .2s; }
.main-nav a:hover { color: var(--coral-text); }
.main-nav a.current { font-weight: 800; border-bottom: 2px solid var(--coral-text); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
	position: relative; width: 44px; height: 44px; border-radius: 999px; border: none;
	background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn.dark { background: var(--ink); }
.cart-count {
	position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 999px; background: var(--coral); color: var(--ink);
	font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden; background: #fff; border-radius: 28px;
	padding: 44px 40px; margin-top: 8px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.hero-text { position: relative; flex: 1 1 420px; min-width: 0; }
.crumbs { font-size: 14px; color: var(--muted2); }
.hero h1 { margin: 10px 0 0; font-size: 46px; font-weight: 800; line-height: 1.2; }
.hero h1 span { color: var(--coral-text); }
.hero p { margin: 12px 0 0; font-size: 19px; line-height: 1.7; color: var(--muted); max-width: 520px; }
.chips { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
	font-size: 15px; font-weight: 700; padding: 10px 20px; min-height: 44px;
	border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
	transition: background .3s, color .3s, border-color .3s, transform .25s, box-shadow .3s;
}
.chip:hover { transform: translateY(-3px); box-shadow: 0 8px 16px -10px rgba(43,30,47,.45); }
.chip.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.hero-art { position: relative; flex: 0 0 auto; width: 240px; height: 220px; display: flex; align-items: center; justify-content: center; }
.abs { position: absolute; }

/* ---------- Layout ---------- */
.shop-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; padding-top: 32px; }
.filters {
	flex: 1 1 240px; background: #fff; border-radius: 22px; padding: 24px;
	display: flex; flex-direction: column; gap: 26px;
}
.filter-group { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0; }
.filter-group legend, .filter-group h2 { margin: 0 0 4px; padding: 0; font-size: 17px; font-weight: 800; }
.filter-group label { display: flex; gap: 10px; align-items: center; font-size: 15px; min-height: 32px; cursor: pointer; }
.filter-group input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.products { flex: 999 1 560px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar .count { font-size: 16px; color: var(--muted); }
.toolbar .count b { color: var(--ink); }
.sort { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.sort select {
	font-family: inherit; font-size: 15px; padding: 8px 14px; min-height: 44px;
	border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}

/* ---------- Product cards ---------- */
.grid { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.card {
	background: #fff; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
	animation: fadeUp .8s cubic-bezier(.2,.7,.2,1) both;
	transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 26px 44px -20px rgba(43,30,47,.38); }
.card.hidden { display: none; }
.card-media { position: relative; aspect-ratio: 1 / 1; background: #F4EFEA; overflow: hidden; }
.card-media img.gift { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.3,1.7,.5,1); }
.card:hover img.gift { transform: scale(1.08); }
.glint {
	position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.75) 50%, transparent 62%);
	transform: translateX(-130%);
}
.card:hover .glint { transform: translateX(130%); transition: transform 1s ease; }
.tilespark { position: absolute; opacity: 0; transition: opacity .4s; }
.card:hover .tilespark { opacity: 1; animation: twinkle 1.6s ease-in-out infinite; }
.badge {
	position: absolute; top: 14px; right: 14px; color: var(--ink);
	font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px;
	background: linear-gradient(90deg, #fff 0%, #FFE3D9 50%, #fff 100%); background-size: 200% 100%;
	animation: shine 3.5s linear infinite;
}
.like {
	position: absolute; top: 10px; left: 10px; width: 44px; height: 44px; border-radius: 999px;
	border: none; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.like svg { fill: none; stroke: var(--ink); }
.like.liked svg { fill: var(--coral-text); stroke: var(--coral-text); animation: pop .5s cubic-bezier(.3,1.8,.5,1); }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.occ { font-size: 13px; font-weight: 500; color: var(--muted2); }
.card h3 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.4; }
.card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.video-tag { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--green); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price { font-size: 21px; font-weight: 800; }
.price small { font-size: 14px; font-weight: 500; }
.add-wrap { position: relative; }
.btn { transition: transform .2s, background .35s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.95); }
.add {
	font-size: 15px; font-weight: 800; padding: 10px 18px; min-height: 44px;
	border-radius: 14px; border: none; background: var(--ink); color: #fff; cursor: pointer;
}
.add.added { background: var(--green); }
.confetti {
	position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 2px;
	pointer-events: none; animation: burst .9s cubic-bezier(.1,.7,.3,1) forwards;
}
.empty { display: none; margin-top: 24px; background: #fff; border-radius: 22px; padding: 40px; text-align: center; font-size: 17px; color: var(--muted); }
.empty.show { display: block; }

/* ---------- How the message works ---------- */
.how {
	margin-top: 40px; position: relative; overflow: hidden;
	background: #fff; border-radius: 26px; padding: 36px 40px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px;
}
.how-text { flex: 1 1 340px; min-width: 0; position: relative; }
.how-eyebrow { margin: 0; font-size: 15px; font-weight: 800; color: var(--coral-text); }
.how h2 { margin: 6px 0 18px; font-size: 32px; font-weight: 800; line-height: 1.3; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .num {
	flex: 0 0 auto; width: 38px; height: 38px; border-radius: 999px;
	background: var(--cream); color: var(--coral-text); font-weight: 800; font-size: 17px;
	display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; font-size: 17px; font-weight: 800; }
.steps li span:not(.num) { display: block; margin-top: 2px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.how-cta {
	margin-top: 24px; display: inline-flex; align-items: center; gap: 10px;
	background: var(--ink); color: var(--cream); text-decoration: none;
	font-size: 16px; font-weight: 800; padding: 14px 24px; min-height: 48px; border-radius: 16px;
}
.how-cta:hover { color: var(--cream); }
.qr-card {
	flex: 0 0 auto; width: 230px; margin: 0 auto; text-decoration: none;
	background: var(--ink); color: var(--cream); border-radius: 22px; padding: 20px 20px 16px;
	display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
	box-shadow: 0 30px 50px -26px rgba(43,30,47,.7);
}
.qr-card:hover { color: var(--cream); }
.qr-top { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: #E8A33D; }
.qr { display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--cream); border-radius: 14px; padding: 12px; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr svg rect { fill: transparent; }
.qr svg path { fill: var(--ink); }
.qr-bottom { font-size: 13px; color: #E9DCE6; }
.qr-brand { display: inline-flex; align-items: center; gap: 6px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px; }
.qr-brand b { color: var(--coral); font-weight: 600; }

/* ---------- Build-your-box banner ---------- */
.box-banner {
	margin-top: 40px; position: relative; overflow: hidden; background: var(--ink); color: var(--cream);
	border-radius: 26px; padding: 36px 40px;
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px;
}
.box-banner .txt { flex: 1 1 320px; min-width: 0; position: relative; }
.box-banner h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.35; }
.box-banner p { margin: 10px 0 0; font-size: 17px; line-height: 1.7; color: #E9DCE6; }
.box-cta {
	display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
	background: var(--coral); color: var(--ink); font-size: 17px; font-weight: 800;
	padding: 14px 26px; min-height: 44px; border-radius: 16px; position: relative;
}
.box-cta:hover { color: var(--ink); }

/* ---------- Pagination ---------- */
.pager { margin-top: 36px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pager a {
	min-width: 44px; height: 44px; padding: 0 14px; border-radius: 12px; background: #fff;
	display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700;
}
.pager a[aria-current] { background: var(--ink); color: var(--cream); font-weight: 800; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: #fff; border-top: 1px solid #EFE4DA; }
.site-footer .container { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 36px; }
.site-footer .about { flex: 1 1 260px; min-width: 0; }
.site-footer .about p { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.foot-col { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.foot-col h2 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.foot-col a { text-decoration: none; }
.foot-col a:hover { color: var(--coral-text); }
.foot-col.pay { flex: 1 1 220px; color: var(--muted); }
.copyright { border-top: 1px solid #EFE4DA; padding: 16px 24px; text-align: center; font-size: 14px; color: var(--muted2); }

/* ---------- Recorder test page ---------- */
.rec-wrap { max-width: 560px; padding-top: 8px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 16px; }
.rec-card { background: #fff; border-radius: 26px; padding: 24px 20px; }
.rec-card[hidden] { display: none; }
.rec-eyebrow { margin: 0; font-size: 14px; font-weight: 800; color: var(--coral-text); }
.rec-card h1 { margin: 4px 0 0; font-size: 30px; font-weight: 800; }
.rec-card h2 { margin: 0 0 12px; font-size: 21px; font-weight: 800; }
.rec-lead { margin: 6px 0 18px; font-size: 16px; line-height: 1.7; color: var(--muted); }
.rec-dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rec-dl div { background: var(--cream); border-radius: 14px; padding: 10px 12px; }
.rec-dl dt { font-size: 13px; color: var(--muted2); }
.rec-dl dd { margin: 4px 0 0; font-size: 17px; font-weight: 800; }
.rec-download {
	margin-top: 14px; display: flex; align-items: center; justify-content: center; min-height: 50px;
	border-radius: 16px; background: var(--ink); color: var(--cream); text-decoration: none; font-weight: 800; font-size: 16px;
}
.rec-download:hover { color: var(--cream); }
.rec-note { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--muted2); }

/* ---------- Motion ---------- */
.spark { animation: twinkle 2.6s ease-in-out infinite; }
.floaty { animation: floaty 6s ease-in-out infinite; }
.lid { transform-box: fill-box; transform-origin: 50% 100%; animation: lid 3s ease-in-out infinite; }
.bumpA { animation: bumpA .55s ease; }
.bumpB { animation: bumpB .55s ease; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%,100% { opacity: .15; transform: scale(.5) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(25deg); } }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }
@keyframes lid { 0%,55%,100% { transform: translateY(0) rotate(0deg); } 65% { transform: translateY(-16px) rotate(-9deg); } 75% { transform: translateY(-6px) rotate(5deg); } 85% { transform: translateY(-2px) rotate(-2deg); } }
@keyframes pop { 0% { transform: scale(.5); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes bumpA { 0%,100% { transform: scale(1); } 40% { transform: scale(1.3) rotate(-8deg); } }
@keyframes bumpB { 0%,100% { transform: scale(1); } 40% { transform: scale(1.3) rotate(8deg); } }
@keyframes burst { 0% { opacity: 1; transform: translate(0,0) scale(1) rotate(0deg); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3) rotate(220deg); } }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Animated background ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-fx span {
	position: absolute; bottom: -60px; display: block;
	animation: rise linear infinite;
}
.bg-fx svg { display: block; animation: sway 4s ease-in-out infinite alternate; }
.page { position: relative; z-index: 1; }
@keyframes rise {
	0% { transform: translateY(0); opacity: 0; }
	10% { opacity: var(--o, .35); }
	85% { opacity: var(--o, .35); }
	100% { transform: translateY(-115vh); opacity: 0; }
}
@keyframes sway { from { transform: translateX(-14px) rotate(-12deg); } to { transform: translateX(14px) rotate(12deg); } }

/* sticky header */
.site-header {
	position: sticky; top: 0; z-index: 20;
	background: rgba(255,246,238,.88);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* filters toggle (phones only) */
.filters-toggle { display: none; }
.filters summary { list-style: none; }
.filters-inner { display: flex; flex-direction: column; gap: 26px; }
.chev { transition: transform .3s; }
.filters summary::-webkit-details-marker { display: none; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
	.container { padding: 0 16px; }
	.site-header .container { padding-top: 12px; padding-bottom: 12px; gap: 10px; }
	.brand { font-size: 22px; }
	.brand svg { width: 40px; height: 40px; }
	.main-nav {
		order: 3; width: 100%; gap: 22px; font-size: 15px;
		flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
		margin: 0 -16px; padding: 0 16px;
	}
	.main-nav::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
	.chips { flex-wrap: nowrap; overflow-x: auto; margin: 22px -22px 0; padding: 4px 22px 8px; scrollbar-width: none; }
	.chip { flex: 0 0 auto; }
	.topbar { font-size: 13px; padding: 9px 12px; }
	.topbar svg:last-child { display: none; }
	.hero-art { height: 170px; }
	.filters { padding: 0; gap: 0; flex-basis: 100%; }
	.filters summary.filters-toggle {
		display: flex; align-items: center; justify-content: space-between;
		min-height: 52px; padding: 0 20px; font-size: 16px; font-weight: 800; cursor: pointer;
	}
	.filters[open] summary.filters-toggle { border-bottom: 1px solid #EFE4DA; }
	.filters .filters-inner { padding: 20px; }
	.filters[open] .chev { transform: rotate(180deg); }
	.hero { padding: 28px 22px; border-radius: 22px; }
	.hero h1 { font-size: 34px; }
	.hero p { font-size: 17px; }
	.hero-art { width: 100%; height: 190px; }
	.box-banner { padding: 28px 22px; }
	.box-banner h2 { font-size: 24px; }
	.how { padding: 28px 22px; gap: 26px; }
	.how h2 { font-size: 25px; }
	.how-cta { width: 100%; justify-content: center; }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.card-body { padding: 14px; }
	.card h3 { font-size: 16px; }
	.card p { display: none; }
	.card-foot { flex-direction: column; align-items: stretch; }
	.add { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
