/* ==========================================================================
   Reelify Shorts — Frontend Styles
   All colors/radii driven by CSS custom properties set in PHP from
   Settings → Reelify Shorts (see class-reelify-frontend.php).
   ========================================================================== */
:root {
	--reelify-primary: #b58c65;
	--reelify-secondary: #7f6051;
	--reelify-dark: #1e1412;
	--reelify-radius: 20px;
	--reelify-card-desktop: 230px;
	--reelify-card-mobile: 152px;
}

.reelify-root, .reelify-root * , #reelify-modal, #reelify-modal *, #reelify-drawer, #reelify-drawer *, .reelify-bubble, .reelify-bubble * {
	box-sizing: border-box;
}

/* ==========================================================================
   BUTTON ARMOR — many WordPress themes apply a global reset to every
   <button>/[type=button] element (forced min-height, padding, background,
   color, position:relative, uppercase text, etc). At equal CSS specificity
   the theme's rule can win purely on load order, which is what was making
   Reelify's icons invisible and breaking arrow/close button positioning.
   This block re-asserts every property theme resets commonly touch, scoped
   only to Reelify's own controls, so it renders identically in any theme.
   ========================================================================== */
.reelify-root button, #reelify-modal button, #reelify-drawer button, .reelify-bubble button {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0 !important;
	text-transform: none !important;
	text-shadow: none !important;
	text-decoration: none !important;
	font-family: inherit !important;
	font-style: normal !important;
	line-height: 1 !important;
	box-shadow: none !important;
	outline: none !important;
	cursor: pointer !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.reelify-root button svg, #reelify-modal button svg, #reelify-drawer button svg, .reelify-bubble button svg {
	display: block !important;
	flex-shrink: 0 !important;
}

.reelify-root {
	--rf-grad: linear-gradient(90deg, var(--reelify-secondary), var(--reelify-primary), #f3dab3, var(--reelify-primary), var(--reelify-secondary));
	position: relative;
	margin: 32px 0;
	font-family: inherit;
}

.reelify-heading {
	font-size: clamp(20px, 3vw, 30px);
	font-weight: 700;
	margin: 0 0 18px;
}

/* ---- Track / rail ---- */
.reelify-track-outer {
	position: relative; overflow: hidden; border-radius: var(--reelify-radius);
	cursor: grab; touch-action: pan-y;
}
.reelify-track-outer.is-dragging { cursor: grabbing; }
.reelify-track {
	display: flex; gap: 14px; align-items: flex-start;
	will-change: transform; transform: translate3d(0,0,0);
	backface-visibility: hidden; -webkit-backface-visibility: hidden;
}

/* ---- Overlay nav arrows (desktop, sit on top of the rail) ---- */
.reelify-arrow {
	position: absolute !important; top: 42% !important; transform: translateY(-50%); z-index: 30 !important;
	width: 38px !important; height: 38px !important; border-radius: 50% !important; background: rgba(255,255,255,.92) !important;
	box-shadow: 0 6px 20px rgba(0,0,0,.18) !important; border: none !important; cursor: pointer !important;
	padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important;
	color: var(--reelify-dark, #1e1412) !important;
	transition: transform .18s ease, background .18s ease; opacity: .95;
}
.reelify-arrow:hover { background: var(--reelify-primary) !important; color: #fff !important; transform: translateY(-50%) scale(1.08); }
.reelify-arrow svg { width: 16px !important; height: 16px !important; color: inherit !important; }
.reelify-arrow--prev { left: 10px; }
.reelify-arrow--prev svg { transform: rotate(180deg); }
.reelify-arrow--next { right: 10px; }
@media (max-width: 767px) { .reelify-arrow { display: none; } }

/* ---- Card (carousel + strip) ---- */
.reelify-card {
	flex: 0 0 var(--reelify-card-desktop); width: var(--reelify-card-desktop);
	display: flex; flex-direction: column; position: relative; border-radius: var(--reelify-radius);
	overflow: hidden; background: var(--reelify-dark, #1e1412);
	box-shadow: 0 10px 34px rgba(0,0,0,.16); transition: transform .25s ease;
	user-select: none; -webkit-user-select: none; transform: translateZ(0);
}
.reelify-layout-strip .reelify-card { flex-basis: 130px; width: 130px; }
.reelify-card:hover { transform: translateY(-4px) translateZ(0); }

.reelify-card__media { position: relative; width: 100%; aspect-ratio: 9/16; cursor: pointer; background: var(--reelify-dark, #1e1412); }

.reelify-card__thumb, .reelify-card__video {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.reelify-card__video { opacity: 0; transition: opacity .3s ease; z-index: 2; }
.reelify-card__video.is-playing { opacity: 1; }
.reelify-card__thumb.is-hidden { opacity: 0; }

.reelify-card__grad-top, .reelify-card__grad-bot { position: absolute; left: 0; right: 0; z-index: 5; pointer-events: none; }
.reelify-card__grad-top { top: 0; height: 90px; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.reelify-card__grad-bot { bottom: 0; height: 110px; background: linear-gradient(to top, rgba(0,0,0,.8), transparent); }

.reelify-card__tag {
	position: absolute; top: 10px; left: 10px; z-index: 10;
	background: var(--rf-grad); color: #fff; font-size: 9px; font-weight: 700;
	letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 40px;
}
.reelify-card__mute {
	position: absolute !important; top: 8px !important; right: 8px !important; z-index: 10 !important; width: 28px !important; height: 28px !important;
	border-radius: 50% !important; background: rgba(0,0,0,.55) !important; border: none !important; cursor: pointer !important; padding: 0 !important;
	display: flex !important; align-items: center !important; justify-content: center !important; color: #fff !important;
}
.reelify-card__mute svg { width: 14px !important; height: 14px !important; display: block !important; color: inherit !important; }

.reelify-card__play {
	position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
	pointer-events: none; transition: opacity .25s ease;
}
.reelify-card__play.is-hidden { opacity: 0; }
.reelify-card__play-circle {
	width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.18);
	border: 1.5px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center;
	backdrop-filter: blur(6px);
}
.reelify-card__play-circle svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }

.reelify-card__meta { position: absolute; bottom: 0; left: 0; right: 0; z-index: 10; padding: 10px 10px 12px; }
.reelify-card__meta-title {
	color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3; margin-bottom: 3px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.reelify-card__meta-sub { color: rgba(255,255,255,.65); font-size: 10px; }

.reelify-card__progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.2); z-index: 15; }
.reelify-card__progress-fill { height: 100%; width: 0%; background: var(--rf-grad); }

/* ---- Product footer (below the video, matches reference reel-rail layout) ---- */
.reelify-card__footer {
	display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: #fff; cursor: pointer;
	transition: background .15s ease;
}
.reelify-card__footer:hover { background: #f7f5f3; }
.reelify-card__footer img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #f0f0f0; }
.reelify-card__footer-info { min-width: 0; }
.reelify-card__footer-name {
	font-size: 11px; font-weight: 600; color: #171412; line-height: 1.3;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reelify-card__footer-price { font-size: 11px; color: var(--reelify-secondary); font-weight: 700; margin-top: 1px; }

/* ---- Dots ---- */
.reelify-dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.reelify-dot { width: 6px !important; height: 6px !important; min-height: 0 !important; border-radius: 50% !important; background: rgba(0,0,0,.15) !important; border: none !important; cursor: pointer !important; padding: 0 !important; margin: 0 !important; transition: all .25s ease; }
.reelify-dot.is-active { width: 20px; border-radius: 3px; background: var(--rf-grad); }

/* ---- Stories layout ---- */
.reelify-layout-stories .reelify-track { gap: 18px; }
.reelify-layout-stories .reelify-card {
	flex-basis: 84px; width: 84px; aspect-ratio: 1/1; border-radius: 50%;
	border: 3px solid; border-image: var(--rf-grad) 1; box-shadow: none;
}
.reelify-layout-stories .reelify-card__meta,
.reelify-layout-stories .reelify-card__footer,
.reelify-layout-stories .reelify-card__progress,
.reelify-layout-stories .reelify-card__mute,
.reelify-layout-stories .reelify-card__play { display: none; }
.reelify-layout-stories .reelify-story-label {
	text-align: center; font-size: 11px; margin-top: 6px; max-width: 84px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reelify-layout-stories .reelify-story-wrap { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }

/* ---- Responsive card sizing ---- */
@media (max-width: 599px) {
	.reelify-card { flex-basis: var(--reelify-card-mobile); width: var(--reelify-card-mobile); }
	.reelify-layout-strip .reelify-card { flex-basis: 110px; width: 110px; }
}

/* ==========================================================================
   MODAL
   ========================================================================== */
#reelify-modal {
	position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center;
	background: rgba(10,6,5,0); backdrop-filter: blur(0px); opacity: 0; pointer-events: none;
	transition: opacity .32s cubic-bezier(.22,.61,.36,1), background-color .32s ease, backdrop-filter .32s ease;
}
#reelify-modal.is-open, #reelify-modal.is-closing { pointer-events: all; }
#reelify-modal.is-open { opacity: 1; background: rgba(10,6,5,.92); backdrop-filter: blur(10px); }
.reelify-modal__inner {
	position: relative; width: min(420px, 92vw); aspect-ratio: 9/16; max-height: 92vh;
	border-radius: var(--reelify-radius); overflow: hidden; background: #000;
	transform: scale(.94) translateY(16px); opacity: 0;
	transition: transform .38s cubic-bezier(.22,.61,.36,1), opacity .3s ease;
}
#reelify-modal.is-open .reelify-modal__inner { transform: scale(1) translateY(0); opacity: 1; }
#reelify-modal.is-closing .reelify-modal__inner { transform: scale(.96) translateY(10px); opacity: 0; }

@media (max-width: 768px) {
	#reelify-modal.is-open { background: #000; backdrop-filter: none; }
	.reelify-modal__inner { width: 100%; height: 100%; max-height: 100%; aspect-ratio: unset; border-radius: 0; transform: none !important; opacity: 1 !important; }
}

.reelify-modal__stage { position: absolute; inset: 0; }
.reelify-modal__slide { position: absolute; left: 0; right: 0; height: 100%; background: #000; overflow: hidden; }
.reelify-modal__slide video, .reelify-modal__slide iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }

.reelify-modal__close {
	position: absolute !important; top: 12px !important; right: 12px !important; z-index: 30 !important; width: 34px !important; height: 34px !important; border-radius: 50% !important;
	background: rgba(0,0,0,.5) !important; border: none !important; color: #fff !important; cursor: pointer !important; padding: 0 !important;
	display: flex !important; align-items: center !important; justify-content: center !important;
}
.reelify-modal__close svg { width: 16px !important; height: 16px !important; color: inherit !important; }
.reelify-modal__controls { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 12px; }
.reelify-modal__ctrl {
	position: relative !important; width: 38px !important; height: 38px !important; border-radius: 50% !important; background: rgba(0,0,0,.45) !important;
	border: none !important; color: #fff !important; cursor: pointer !important; padding: 0 !important;
	display: flex !important; align-items: center !important; justify-content: center !important; transition: transform .15s ease;
}
.reelify-modal__ctrl svg { width: 18px !important; height: 18px !important; color: inherit !important; }
.reelify-modal__ctrl:active { transform: scale(.9); }
.reelify-modal__gradbot { position: absolute; bottom: 0; left: 0; right: 0; height: 200px; background: linear-gradient(to top, rgba(10,6,5,.95), transparent); z-index: 10; pointer-events: none; }
.reelify-modal__meta { position: absolute; bottom: 0; left: 0; right: 0; z-index: 15; padding: 18px 18px 34px; }
.reelify-modal__tag { display: inline-block; background: var(--rf-grad); color: #1e1412; font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border-radius: 40px; margin-bottom: 8px; }
.reelify-modal__title { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.reelify-modal__sub { color: rgba(255,255,255,.6); font-size: 12px; }
.reelify-modal__progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,.15); z-index: 20; cursor: pointer; }
.reelify-modal__progress-fill { height: 100%; width: 0%; background: var(--rf-grad); pointer-events: none; }

.reelify-modal__pin {
	position: absolute; bottom: 100px; left: 16px; z-index: 22; display: flex; align-items: center; gap: 8px;
	background: rgba(0,0,0,.55); backdrop-filter: blur(12px); border-radius: 40px; padding: 6px 14px 6px 6px;
	max-width: calc(100% - 60px); cursor: pointer;
}
.reelify-modal__pin img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.reelify-modal__pin-name { color: #fff; font-size: 12px; font-weight: 700; }
.reelify-modal__pin-price { color: #f3dab3; font-size: 11px; }

.reelify-swipe-hint { position: absolute; bottom: 76px; left: 50%; transform: translateX(-50%); z-index: 25; text-align: center; color: rgba(255,255,255,.75); opacity: 0; font-size: 11px; }
.reelify-swipe-hint.show { animation: reelify-hint 2.2s ease forwards; }
@keyframes reelify-hint { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (min-width: 769px) { .reelify-swipe-hint { display: none; } }

/* ==========================================================================
   PRODUCT DRAWER — lives inside .reelify-modal__inner so it's visually part
   of the reel frame (matches the reference: product card slides up from
   inside the video, never spanning the full browser width on desktop).
   ========================================================================== */
#reelify-drawer-overlay { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,0); pointer-events: none; transition: background .3s ease; }
#reelify-drawer-overlay.is-open { background: rgba(0,0,0,.45); pointer-events: all; }
#reelify-drawer {
	position: absolute; left: 0; right: 0; bottom: 0; transform: translateY(100%); width: 100%;
	max-height: 82%; background: #fff; border-radius: 18px 18px 0 0; z-index: 41;
	display: flex; flex-direction: column; transition: transform .4s cubic-bezier(.22,.61,.36,1); overflow: hidden;
}
#reelify-drawer.is-open { transform: translateY(0); }
.reelify-drawer__header { display: none; }
.reelify-drawer__close {
	position: absolute !important; top: 14px !important; right: 14px !important; z-index: 2 !important;
	width: 28px !important; height: 28px !important; border-radius: 50% !important; background: rgba(0,0,0,.06) !important; border: none !important; cursor: pointer !important;
	display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; color: #171412 !important;
}
.reelify-drawer__close svg { width: 13px !important; height: 13px !important; color: inherit !important; }
.reelify-drawer__body { overflow-y: auto; padding: 16px 44px 24px 16px; position: relative; }
.reelify-drawer__hero { display: flex; gap: 12px; margin-bottom: 14px; padding-right: 4px; }
.reelify-drawer__hero img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: #f4f4f4; flex-shrink: 0; }
.reelify-drawer__title { font-size: 15px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.reelify-drawer__price { font-size: 18px; font-weight: 700; color: var(--reelify-secondary); }
.reelify-drawer__price-compare { font-size: 12px; text-decoration: line-through; color: rgba(0,0,0,.35); margin-left: 8px; }
.reelify-drawer__divider { height: 1px; background: rgba(0,0,0,.07); margin: 12px 0; }
.reelify-drawer__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(0,0,0,.4); margin-bottom: 8px; }
.reelify-variant-group { margin-bottom: 12px; }
.reelify-variant-btn {
	font-size: 12px; background: #f4f4f4; border: 2px solid transparent; border-radius: 10px; padding: 6px 11px;
	cursor: pointer; margin: 0 6px 6px 0;
}
.reelify-variant-btn.is-selected { border-color: var(--reelify-secondary); background: rgba(127,96,81,.1); }
.reelify-qty { display: inline-flex; align-items: center; border: 1.5px solid rgba(0,0,0,.1); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.reelify-qty button { width: 32px !important; height: 32px !important; min-height: 0 !important; border: none !important; background: transparent !important; font-size: 16px !important; cursor: pointer !important; color: #171412 !important; padding: 0 !important; }
.reelify-qty span { width: 30px; text-align: center; font-weight: 700; font-size: 13px; }
.reelify-btn-atc, .reelify-btn-buy {
	width: 100%; padding: 12px; border: none; border-radius: 12px; font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .08em; cursor: pointer; margin-bottom: 8px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
}
.reelify-btn-atc { background: var(--reelify-secondary); color: #fff; }
.reelify-btn-buy { background: var(--rf-grad); color: #1e1412; }
.reelify-btn-atc:disabled, .reelify-btn-buy:disabled { opacity: .5; cursor: not-allowed; }
.reelify-view-link { display: block; text-align: center; font-size: 12px; color: rgba(0,0,0,.4); text-decoration: none; padding: 4px; }

@media (max-width: 768px) {
	#reelify-drawer { max-height: 78vh; border-radius: 20px 20px 0 0; }
}

#reelify-toast {
	position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 1100000;
	background: var(--reelify-secondary); color: #fff; font-size: 13px; padding: 11px 20px; border-radius: 40px;
	opacity: 0; pointer-events: none; transition: all .3s ease; white-space: nowrap;
}
#reelify-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.reelify-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: reelify-spin .7s linear infinite; }
@keyframes reelify-spin { to { transform: rotate(360deg); } }

.reelify-out-of-stock { opacity: .5; text-decoration: line-through; }

/* ==========================================================================
   STICKY VIDEO BUBBLE (single product page)
   ========================================================================== */
.reelify-layout-bubble.reelify-root { margin: 0; position: static; }
.reelify-bubble {
	position: fixed; right: 20px; bottom: 20px; z-index: 99998;
	width: 76px; height: 76px; border-radius: 50%; overflow: visible;
	cursor: pointer; animation: reelify-bubble-in .4s cubic-bezier(.22,.61,.36,1);
}
@keyframes reelify-bubble-in { 0% { transform: scale(0) translateY(20px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.reelify-bubble__media {
	width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
	border: 2.5px solid var(--reelify-primary); box-shadow: 0 8px 26px rgba(0,0,0,.28);
	background: var(--reelify-dark, #1e1412); position: relative;
}
.reelify-bubble__media img, .reelify-bubble__media video {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.reelify-bubble__media video { opacity: 0; transition: opacity .3s ease; }
.reelify-bubble__media video.is-playing { opacity: 1; }
.reelify-bubble__close {
	position: absolute !important; top: -6px !important; right: -6px !important; z-index: 2 !important; width: 22px !important; height: 22px !important;
	min-height: 0 !important; border-radius: 50% !important; background: #1e1412 !important; border: 2px solid #fff !important; color: #fff !important; cursor: pointer !important;
	padding: 0 !important; margin: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important;
}
.reelify-bubble__close svg { width: 9px !important; height: 9px !important; color: inherit !important; }
@media (max-width: 599px) {
	.reelify-bubble { width: 64px; height: 64px; right: 14px; bottom: 14px; }
}
