/* "Make It Extra Special" popup — opens when the customer taps Add to Cart on a product page.
   Gift wraps, wishing cards and add-on products as photo tiles with ADD / ✓ Added (FNP-style). */
.cgt-gift-popup-overlay { display: none; position: fixed; inset: 0; background: rgba(20,14,12,.58); z-index: 999999; align-items: center; justify-content: center; padding: 16px; }
.cgt-gift-popup-overlay.cgt-open { display: flex; animation: xs-fade .25s ease-out; }
@media (min-width:601px) { .cgt-gift-popup-overlay.cgt-open .cgt-gift-popup { animation: xs-rise .45s cubic-bezier(.16,1,.3,1); } }
@keyframes xs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xs-rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.cgt-gift-popup { background: #fff; border-radius: 18px; width: 100%; min-width: 0; max-width: 560px; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; font-family: Inter, sans-serif; color: #1c1b1f; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); }
.cgt-gift-popup button { min-height: 0 !important; box-shadow: none; }

.xs-pop-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 12px; }
.xs-pop-head h3 { margin: 0 !important; font: 700 20px/1.2 Fraunces, serif !important; color: #1c1b1f !important; }
.xs-pop-head p { margin: 4px 0 0 !important; font: 400 13px/1.4 Inter, sans-serif !important; color: #6d6a70 !important; }
.cgt-gift-popup .cgt-gift-popup-close { margin-left: auto; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50% !important; border: 1px solid #eee7e1 !important; background: #fff !important; color: #6d6a70 !important; font: 400 22px/1 Inter, sans-serif !important; padding: 0 !important; cursor: pointer; }

.xs-tabs { min-width: 0; flex: 0 0 auto; display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #f1ebe6; }
.xs-tabs::-webkit-scrollbar { display: none; }
.cgt-gift-popup .xs-tab { flex: 0 0 auto; padding: 7px 14px !important; border-radius: 999px !important; border: 1.5px solid #eee7e1 !important; background: #fff !important; color: #5f5b62 !important; font: 600 12.5px Inter, sans-serif !important; cursor: pointer; white-space: nowrap; }
.cgt-gift-popup .xs-tab.on { border-color: #880000 !important; background: #fbf1f0 !important; color: #880000 !important; }

.cgt-gift-popup-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 20px 16px; flex: 1 1 auto; }
.xs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xs-it { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border: 1px solid #eee7e1; border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.xs-it.cgt-selected { border-color: #880000; box-shadow: 0 0 0 1px #880000 inset; background: #fffafa; }
.xs-it.xs-hide, .xs-msg.xs-hide { display: none !important; }
.xs-img { width: 72px; height: 72px; border-radius: 9px; background: #f4efea center / cover no-repeat; display: grid; place-items: center; font-size: 26px; }
.xs-info { display: flex; flex-direction: column; min-width: 0; }
.xs-nm { font: 600 12.5px/1.3 Inter, sans-serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.xs-pr { margin: 3px 0 6px; font: 700 13.5px Inter, sans-serif; }
.cgt-gift-card-was { color: #8a858d; font-weight: 400; font-size: 11.5px; text-decoration: line-through; margin-left: 4px; }
.cgt-gift-popup .xs-btn { align-self: flex-start; height: 32px; min-width: 88px; padding: 0 14px !important; border-radius: 8px !important; border: 1.5px solid #880000 !important; background: #fff !important; color: #880000 !important; font: 700 12px Inter, sans-serif !important; letter-spacing: .03em; cursor: pointer; }
.cgt-gift-popup .xs-it.cgt-selected .xs-btn { background: #880000 !important; color: #fff !important; }

.cgt-addon-fields { grid-column: 1 / -1; background: #f7f4f0; border-radius: 8px; padding: 10px; margin: 0; }
.cgt-addon-field-wrap { margin: 0 0 8px; }
.cgt-addon-field-wrap:last-child { margin-bottom: 0; }
.cgt-addon-field-wrap label { display: block; font: 700 11px Inter, sans-serif; color: #6d6a70; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.cgt-addon-field-wrap input[type="text"], .cgt-addon-field-wrap select, .cgt-addon-field-wrap textarea, .cgt-addon-field-wrap input[type="file"] { width: 100%; padding: 9px 10px; border: 1px solid #e3dad3; border-radius: 8px; font: 13px Inter, sans-serif; box-sizing: border-box; background: #fff; margin: 0; }

.xs-msg { display: none; margin-top: 12px; }
.xs-msg.on { display: block; }
.xs-msg label { display: block; font: 700 12px Inter, sans-serif; margin-bottom: 6px; }
.cgt-wish-card-message { width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid #e3dad3; border-radius: 10px; font: 13px/1.5 Inter, sans-serif; box-sizing: border-box; resize: vertical; margin: 0; }

.xs-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #f1ebe6; background: #fff; }
.xs-sum { flex: 1 1 auto; font: 500 12.5px/1.35 Inter, sans-serif; color: #6d6a70; }
.xs-sum b { color: #1c1b1f; }
.cgt-gift-popup .cgt-gift-popup-addtocart { flex: 0 0 auto; height: 48px; padding: 0 26px !important; border: 0 !important; border-radius: 12px !important; background: #880000 !important; color: #fff !important; font: 700 15px Inter, sans-serif !important; cursor: pointer; }
.cgt-gift-popup .cgt-gift-popup-addtocart:hover { background: #6d0000 !important; }
.cgt-gift-popup .cgt-gift-popup-addtocart:disabled { opacity: .6; cursor: wait; }

.cgt-field-error { border-color: #C0392B !important; background: #FDECEA !important; box-shadow: 0 0 0 2px rgba(192,57,43,.15); }
.cgt-gift-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1F1F1F; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 1000001; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: 90vw; text-align: center; }
.cgt-gift-toast.cgt-open { opacity: 1; transform: translateX(-50%) translateY(0); }
.cgt-gift-popup img.emoji { width: 1em !important; height: 1em !important; margin: 0 .1em !important; vertical-align: -.1em !important; }

/* Phones: slides up from the bottom as a sheet, one tile per row */
@media (max-width: 600px) {
	.cgt-gift-popup-overlay { align-items: flex-end; padding: 0; }
	.cgt-gift-popup { max-width: none; border-radius: 18px 18px 0 0; max-height: 90vh; max-height: 90dvh; animation: xs-up .45s cubic-bezier(.16,1,.3,1); }
	.xs-grid { grid-template-columns: minmax(0, 1fr); }
	.xs-pop-head { padding: 16px 16px 10px; }
	.xs-tabs { padding: 0 16px 10px; }
	.cgt-gift-popup-scroll { padding: 12px 16px 14px; }
	.xs-foot { padding-left: 16px; padding-right: 16px; }
	.cgt-gift-popup .cgt-gift-popup-addtocart { padding: 0 20px !important; }
}
@keyframes xs-up { from { transform: translateY(100%); opacity: 1; } to { transform: none; opacity: 1; } }

/* page behind the extras popup stays put (body is pinned by gift-popup.js) */
body.cgt-gp-pinned { position: fixed !important; left: 0; right: 0; width: 100%; overflow: hidden; }
.cgt-gift-popup-overlay { overscroll-behavior: contain; }

/* ===== Desktop / laptop: roomier popup, big square photo cards in 3 columns, clearer footer ===== */
@media (min-width: 701px) {
	.cgt-gift-popup-overlay { padding: 24px; }
	.cgt-gift-popup { max-width: 860px; max-height: 86vh; max-height: 86dvh; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
	.xs-pop-head { padding: 26px 30px 14px; }
	.xs-pop-head h3 { font-size: 26px !important; }
	.xs-pop-head p { font-size: 14px !important; margin-top: 6px !important; }
	.cgt-gift-popup .cgt-gift-popup-close { width: 40px; height: 40px; transition: background .15s, transform .15s; }
	.cgt-gift-popup .cgt-gift-popup-close:hover { background: #f4efeb !important; transform: rotate(90deg); }
	.xs-tabs { padding: 0 30px 14px; gap: 10px; }
	.cgt-gift-popup .xs-tab { padding: 9px 20px !important; font-size: 13.5px !important; transition: border-color .15s, background .15s; }
	.cgt-gift-popup .xs-tab:hover { border-color: #880000 !important; }
	.cgt-gift-popup-scroll { padding: 22px 30px 24px; background: #fbf8f5; }
	.xs-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
	.xs-it { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-radius: 16px; overflow: hidden; background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s; }
	.xs-it:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(60,30,20,.28); }
	.xs-it.cgt-selected { box-shadow: 0 0 0 2px #880000 inset, 0 14px 30px -14px rgba(136,0,0,.35); }
	.xs-img { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 0; font-size: 46px; background-size: cover; }
	.xs-info { padding: 10px 12px 12px; flex: 1 1 auto; }
	.xs-nm { font-size: 13.5px; min-height: 2.6em; }
	.xs-pr { margin: 4px 0 10px; font-size: 15px; }
	.cgt-gift-popup .xs-btn { align-self: stretch; width: 100%; height: 36px; border-radius: 10px !important; font-size: 12.5px !important; transition: background .15s, color .15s; }
	.cgt-gift-popup .xs-btn:hover { background: #fbf1f0 !important; }
	.cgt-gift-popup .xs-it.cgt-selected .xs-btn:hover { background: #6d0000 !important; }
	.cgt-addon-fields { margin: 0 14px 14px; }
	.xs-foot { padding: 16px 30px; gap: 18px; box-shadow: 0 -8px 24px -16px rgba(0,0,0,.18); }
	.xs-sum { font-size: 14px; }
	.cgt-gift-popup .cgt-gift-popup-addtocart { height: 52px; min-width: 220px; font-size: 16px !important; border-radius: 14px !important; box-shadow: 0 10px 22px -8px rgba(136,0,0,.5); transition: transform .12s, background .15s; }
	.cgt-gift-popup .cgt-gift-popup-addtocart:hover { transform: translateY(-1px); }
}
