/* Apex Weligama — Design System */

:root {
	--apex-black: #111111;
	--apex-charcoal: #1a1a1a;
	--apex-text: #2b2b2b;
	--apex-muted: #6f6f6f;
	--apex-white: #ffffff;
	--apex-cream: #f7f3ec;
	--apex-light: #fafafa;
	--apex-gold: #c8a96a;
	--apex-gold-dark: #a98b50;
	--apex-border: rgba(0, 0, 0, 0.1);

	--apex-space-xs: 8px;
	--apex-space-sm: 16px;
	--apex-space-md: 24px;
	--apex-space-lg: 40px;
	--apex-space-xl: 64px;
	--apex-space-xxl: 96px;
	--apex-section-desktop: 100px;
	--apex-section-mobile: 64px;

	--apex-max-width: 1180px;
	--apex-text-max: 760px;

	--apex-font: "Inter", Arial, sans-serif;
	--apex-transition: 600ms ease-out;
}

/* Reset scoped to plugin */
.apex-site *,
.apex-site *::before,
.apex-site *::after {
	box-sizing: border-box;
}

.apex-site {
	font-family: var(--apex-font);
	font-size: 17px;
	line-height: 1.7;
	color: var(--apex-text);
	-webkit-font-smoothing: antialiased;
}

.apex-site img:not(.apex-logo__img) {
	max-width: 100%;
	height: auto;
	display: block;
}

.apex-site a {
	color: inherit;
	text-decoration: none;
}

.apex-wrap {
	width: 100%;
	max-width: var(--apex-max-width);
	margin: 0 auto;
	padding-left: 40px;
	padding-right: 40px;
}

.apex-section {
	padding-top: var(--apex-section-desktop);
	padding-bottom: var(--apex-section-desktop);
}

.apex-section--cream {
	background-color: var(--apex-cream);
}

.apex-section--dark {
	background-color: var(--apex-black);
	color: var(--apex-white);
}

/* Typography */
.apex-eyebrow {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--apex-gold);
	margin: 0 0 var(--apex-space-sm);
}

.apex-eyebrow--light {
	color: var(--apex-gold);
}

.apex-section__title {
	font-size: 52px;
	font-weight: 700;
	line-height: 1.12;
	margin: 0 0 var(--apex-space-md);
	color: var(--apex-text);
}

.apex-section__title--light {
	color: var(--apex-white);
}

.apex-section__intro {
	max-width: var(--apex-text-max);
	margin-bottom: var(--apex-space-xl);
}

.apex-body {
	margin: 0 0 var(--apex-space-md);
}

.apex-body--light {
	color: rgba(255, 255, 255, 0.88);
}

.apex-muted {
	color: var(--apex-muted);
}

/* Buttons */
.apex-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px 28px;
	font-family: var(--apex-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	border-radius: 2px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color var(--apex-transition), color var(--apex-transition), border-color var(--apex-transition);
	text-align: center;
}

.apex-btn--primary {
	background-color: var(--apex-gold);
	color: var(--apex-white);
	border-color: var(--apex-gold);
}

.apex-btn--primary:hover,
.apex-btn--primary:focus {
	background-color: var(--apex-gold-dark);
	border-color: var(--apex-gold-dark);
	color: var(--apex-white);
}

.apex-btn--secondary {
	background-color: transparent;
	color: var(--apex-white);
	border-color: var(--apex-white);
}

.apex-btn--secondary:hover,
.apex-btn--secondary:focus {
	background-color: var(--apex-white);
	color: var(--apex-black);
}

.apex-section--cream .apex-btn--secondary,
.apex-overview .apex-btn--secondary {
	color: var(--apex-text);
	border-color: var(--apex-text);
}

.apex-btn--whatsapp {
	margin-top: var(--apex-space-md);
	background-color: transparent;
	color: var(--apex-white);
	border-color: var(--apex-gold);
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.apex-btn--whatsapp:hover,
.apex-btn--whatsapp:focus {
	background-color: var(--apex-gold);
	color: var(--apex-white);
}

.apex-btn--whatsapp-outline {
	background-color: transparent;
	color: var(--apex-white);
	border-color: rgba(255, 255, 255, 0.55);
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.apex-btn--whatsapp-outline:hover,
.apex-btn--whatsapp-outline:focus {
	background-color: #25d366;
	border-color: #25d366;
	color: var(--apex-white);
}

.apex-whatsapp-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* Header */
.apex-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	padding: var(--apex-space-md) 0;
	transition: background-color var(--apex-transition), box-shadow var(--apex-transition), padding var(--apex-transition);
}

.apex-header.is-scrolled {
	background-color: rgba(17, 17, 17, 0.96);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
	padding: var(--apex-space-sm) 0;
}

.apex-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--apex-space-md);
}

.apex-logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	width: auto;
	max-width: none;
	height: auto;
	overflow: visible;
	line-height: 1;
	gap: 12px;
}

.apex-site .apex-header .apex-logo .apex-logo__img {
	display: block;
	width: 64px !important;
	height: 64px !important;
	max-width: 64px !important;
	max-height: 64px !important;
	min-width: 0;
	object-fit: contain;
	border-radius: 50%;
	flex-shrink: 0;
}

.apex-logo__text {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: var(--apex-white);
	white-space: nowrap;
}

.apex-nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
}

.apex-nav-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background-color: var(--apex-white);
	transition: transform var(--apex-transition), opacity var(--apex-transition);
}

.apex-nav {
	display: flex;
	align-items: center;
	gap: var(--apex-space-lg);
}

.apex-nav__list {
	display: flex;
	align-items: center;
	gap: var(--apex-space-md);
	list-style: none;
	margin: 0;
	padding: 0;
}

.apex-nav__list a {
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.88);
	transition: color var(--apex-transition);
}

.apex-nav__list a:hover,
.apex-nav__list a:focus {
	color: var(--apex-gold);
}

.apex-header__cta {
	padding: 12px 20px;
	font-size: 14px;
}

/* Hero */
.apex-hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	padding-top: 120px;
	padding-bottom: var(--apex-section-desktop);
	overflow: hidden;
}

.apex-hero__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-color: var(--apex-black);
	background-repeat: no-repeat;
}

.apex-hero__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.42);
}

.apex-hero__content {
	position: relative;
	z-index: 1;
	max-width: var(--apex-text-max);
	color: var(--apex-white);
}

.apex-hero__title {
	font-size: 72px;
	font-weight: 700;
	line-height: 1.05;
	margin: 0 0 var(--apex-space-md);
}

.apex-hero__subhead {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 var(--apex-space-md);
	color: var(--apex-gold);
}

.apex-hero__body {
	font-size: 20px;
	line-height: 1.7;
	margin: 0 0 var(--apex-space-lg);
	color: rgba(255, 255, 255, 0.9);
}

.apex-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apex-space-sm);
	margin-bottom: var(--apex-space-xl);
}

.apex-badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apex-space-sm);
	list-style: none;
	margin: 0;
	padding: 0;
}

.apex-badge {
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: var(--apex-white);
}

/* Overview */
.apex-overview__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-xl);
	align-items: start;
	margin-bottom: var(--apex-space-xl);
}

.apex-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--apex-space-md);
	list-style: none;
	margin: 0;
	padding: var(--apex-space-lg) 0 0;
	border-top: 1px solid var(--apex-border);
}

.apex-stat {
	text-align: center;
	padding: var(--apex-space-md);
}

.apex-stat__value {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: var(--apex-text);
	margin-bottom: var(--apex-space-xs);
}

.apex-stat__label {
	display: block;
	font-size: 14px;
	color: var(--apex-muted);
}

/* Residences */
.apex-residences__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-md);
}

.apex-residence-card {
	padding: 36px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background-color: var(--apex-white);
}

.apex-residence-card__title {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 var(--apex-space-sm);
}

/* Amenities */
.apex-amenities__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--apex-space-md);
}

.apex-amenity {
	padding: var(--apex-space-md) 0;
	border-top: 1px solid var(--apex-border);
}

.apex-amenity__title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 var(--apex-space-xs);
}

/* Gallery */
.apex-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--apex-space-md);
}

.apex-gallery__item {
	margin: 0;
	overflow: hidden;
}

.apex-gallery__item img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform var(--apex-transition);
}

.apex-gallery__item:hover img {
	transform: scale(1.03);
}

.apex-gallery__caption {
	padding: var(--apex-space-sm) 0 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.7);
}

/* Location */
.apex-location__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-xl);
	align-items: start;
}

.apex-location__points {
	list-style: none;
	margin: var(--apex-space-md) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-xs) var(--apex-space-md);
}

.apex-location__points li {
	position: relative;
	padding-left: 18px;
	font-size: 16px;
}

.apex-location__points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	width: 6px;
	height: 6px;
	background-color: var(--apex-gold);
	border-radius: 50%;
}

.apex-map-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 360px;
	padding: var(--apex-space-lg);
	background-color: var(--apex-light);
	border: 1px solid var(--apex-border);
	text-align: center;
}

/* About */
.apex-about__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-xl);
	align-items: start;
}

/* Contact */
.apex-contact__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apex-space-xl);
	align-items: start;
}

.apex-contact__detail a {
	color: var(--apex-gold);
}

.apex-contact__channels {
	margin: var(--apex-space-md) 0;
}

.apex-contact__label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 4px;
}

.apex-contact__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apex-space-sm);
	margin-top: var(--apex-space-md);
}

.apex-contact__actions .apex-btn--whatsapp {
	margin-top: 0;
}

/* Floating WhatsApp button */
.apex-whatsapp-float {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1100;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background-color: #25d366;
	color: var(--apex-white);
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
	transition: transform var(--apex-transition), box-shadow var(--apex-transition), background-color var(--apex-transition);
}

.apex-whatsapp-float:hover,
.apex-whatsapp-float:focus {
	background-color: #1ebe57;
	color: var(--apex-white);
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.apex-whatsapp-float .apex-whatsapp-icon {
	width: 22px;
	height: 22px;
}

.apex-whatsapp-float__text {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.apex-form__row {
	margin-bottom: var(--apex-space-md);
}

.apex-form label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: var(--apex-space-xs);
	color: rgba(255, 255, 255, 0.9);
}

.apex-form input,
.apex-form select,
.apex-form textarea {
	width: 100%;
	padding: 14px 16px;
	font-family: var(--apex-font);
	font-size: 16px;
	color: var(--apex-text);
	background-color: var(--apex-white);
	border: 1px solid var(--apex-border);
	border-radius: 2px;
}

.apex-form input:focus,
.apex-form select:focus,
.apex-form textarea:focus {
	outline: 2px solid var(--apex-gold);
	outline-offset: 2px;
}

.apex-form__note {
	font-size: 14px;
	margin-bottom: var(--apex-space-md);
	color: rgba(255, 255, 255, 0.6);
}

.apex-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.apex-form__notice {
	padding: 14px 16px;
	margin-bottom: var(--apex-space-md);
	border-radius: 2px;
	font-size: 15px;
	line-height: 1.6;
}

.apex-form__notice--success {
	background-color: rgba(37, 211, 102, 0.15);
	border: 1px solid rgba(37, 211, 102, 0.45);
	color: #d8ffe7;
}

.apex-form__notice--error {
	background-color: rgba(220, 53, 69, 0.15);
	border: 1px solid rgba(220, 53, 69, 0.45);
	color: #ffd8dc;
}

body.apex-modal-open {
	overflow: hidden;
}

.apex-modal[hidden] {
	display: none !important;
}

.apex-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.apex-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.apex-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	padding: 36px 32px 32px;
	background: var(--apex-white);
	color: var(--apex-text);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.apex-modal__dialog--success {
	border-top: 4px solid #25d366;
}

.apex-modal__dialog--error {
	border-top: 4px solid #dc3545;
}

.apex-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: var(--apex-muted);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.apex-modal__eyebrow {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--apex-gold);
}

.apex-modal__title {
	margin: 0 0 12px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--apex-text);
}

.apex-modal__message {
	margin: 0 0 24px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--apex-muted);
}

.apex-modal__button {
	width: 100%;
}

.apex-btn:disabled {
	opacity: 0.7;
	cursor: wait;
}

/* Footer */
.apex-footer {
	background-color: var(--apex-charcoal);
	color: rgba(255, 255, 255, 0.8);
	padding-top: var(--apex-space-xl);
}

.apex-footer__grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: var(--apex-space-xl);
	padding-bottom: var(--apex-space-xl);
}

.apex-footer__name {
	font-size: 18px;
	font-weight: 700;
	color: var(--apex-white);
	margin: 0 0 var(--apex-space-sm);
}

.apex-footer__desc {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
}

.apex-footer__heading {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--apex-white);
	margin: 0 0 var(--apex-space-sm);
}

.apex-footer__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.apex-footer__links li {
	margin-bottom: var(--apex-space-xs);
}

.apex-footer__links a:hover,
.apex-footer__contact a:hover {
	color: var(--apex-gold);
}

.apex-footer__developer {
	font-weight: 600;
	color: var(--apex-white);
}

.apex-footer__bottom {
	padding: var(--apex-space-md) 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 14px;
	color: rgba(255, 255, 255, 0.5);
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
	.apex-section {
		animation: apex-fade-up var(--apex-transition) ease-out both;
	}
}

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

@keyframes apex-fade-up {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Theme overrides moved to apex-weligama-theme.css */

/* Tablet */
@media (max-width: 1024px) {
	.apex-section__title {
		font-size: 42px;
	}

	.apex-hero__title {
		font-size: 56px;
	}

	.apex-amenities__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.apex-gallery__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.apex-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile */
@media (max-width: 768px) {
	.apex-wrap {
		padding-left: 24px;
		padding-right: 24px;
	}

	.apex-section {
		padding-top: var(--apex-section-mobile);
		padding-bottom: var(--apex-section-mobile);
	}

	.apex-section__title {
		font-size: 34px;
	}

	.apex-hero {
		min-height: 78vh;
		padding-top: 100px;
	}

	.apex-hero__title {
		font-size: 40px;
	}

	.apex-hero__body {
		font-size: 17px;
	}

	.apex-hero__actions {
		flex-direction: column;
	}

	.apex-hero__actions .apex-btn {
		width: 100%;
		padding: 14px 22px;
	}

	.apex-whatsapp-float {
		right: 16px;
		bottom: 16px;
		padding: 14px;
		border-radius: 50%;
	}

	.apex-whatsapp-float__text {
		display: none;
	}

	.apex-nav-toggle {
		display: flex;
	}

	.apex-logo {
		gap: 10px;
	}

	.apex-site .apex-header .apex-logo .apex-logo__img {
		width: 52px !important;
		height: 52px !important;
		max-width: 52px !important;
		max-height: 52px !important;
	}

	.apex-logo__text {
		font-size: 11px;
		letter-spacing: 0.1em;
	}

	.apex-nav {
		position: fixed;
		top: 0;
		right: 0;
		width: min(320px, 85vw);
		height: 100vh;
		flex-direction: column;
		align-items: flex-start;
		padding: 80px var(--apex-space-md) var(--apex-space-md);
		background-color: var(--apex-charcoal);
		transform: translateX(100%);
		transition: transform var(--apex-transition);
		overflow-y: auto;
	}

	.apex-nav.is-open {
		transform: translateX(0);
	}

	.apex-nav__list {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
		gap: var(--apex-space-sm);
	}

	.apex-nav__list a {
		font-size: 16px;
		padding: var(--apex-space-xs) 0;
	}

	.apex-header__cta {
		width: 100%;
		margin-top: var(--apex-space-sm);
	}

	.apex-overview__grid,
	.apex-residences__grid,
	.apex-location__grid,
	.apex-about__grid,
	.apex-contact__grid,
	.apex-footer__grid {
		grid-template-columns: 1fr;
	}

	.apex-amenities__grid,
	.apex-gallery__grid {
		grid-template-columns: 1fr;
	}

	.apex-residence-card {
		padding: 24px;
	}

	.apex-location__points {
		grid-template-columns: 1fr;
	}

	.apex-stats {
		grid-template-columns: 1fr 1fr;
	}

	.apex-nav-toggle.is-active span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.apex-nav-toggle.is-active span:nth-child(2) {
		opacity: 0;
	}

	.apex-nav-toggle.is-active span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}
}
