/**
 * Frontend styles — Opcionalia Domains
 *
 * Inherits from Salepush theme design system.
 * Uses theme CSS variables and matches exact design tokens.
 *
 * @package Opcionalia\Domains
 */

/* ============================================
   Domain Search — Container
   ============================================ */

.od-domain-search {
	max-width: 780px;
	margin: 0 auto;
}

/* ============================================
   Search Bar
   ============================================ */

.od-search-form {
	margin-bottom: 20px;
}

.od-search-bar {
	display: flex;
	gap: 12px;
	align-items: stretch;
}

.od-search-input-wrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #dadada;
	border-radius: 26px;
	padding: 0 20px;
	height: 56px;
	transition: all 250ms linear 0s;
}

.od-search-input-wrap:focus-within {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.od-search-icon {
	color: #707070;
	flex-shrink: 0;
	margin-right: 10px;
}

.od-search-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 16px;
	font-weight: 400;
	font-family: var(--body-font-family);
	color: var(--heading-color);
	background: transparent;
	height: 100%;
}

.od-search-input::placeholder {
	color: #b0b0b0;
}

.od-search-btn {
	flex-shrink: 0;
	height: 56px;
	padding: 0 36px;
	line-height: 56px;
}

/* TLD pills */
.od-tld-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.od-tld-pill {
	display: inline-block;
	padding: 4px 14px;
	border: 1px solid #dadada;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: #707070;
	cursor: pointer;
	transition: all 250ms linear 0s;
	user-select: none;
}

.od-tld-pill:hover,
.od-tld-pill.is-active {
	border-color: var(--primary-color);
	color: var(--primary-color);
	background: rgba(0, 0, 0, 0.02);
}

/* ============================================
   Loading State
   ============================================ */

.od-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 30px 20px;
	color: #707070;
	font-size: 15px;
}

.od-loading-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #dadada;
	border-top-color: var(--primary-color);
	border-radius: 50%;
	animation: od-spin 0.7s linear infinite;
}

@keyframes od-spin {
	to { transform: rotate(360deg); }
}

/* ============================================
   Results Wrapper
   ============================================ */

.od-results {
	margin-top: 24px;
}

.od-results-wrapper {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ============================================
   Result Card
   ============================================ */

.od-result {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	background: #fff;
	border-radius: 15px;
	padding: 20px 24px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
	border: 1px solid transparent;
	transition: all 250ms linear 0s;
}

.od-result--primary {
	padding: 24px 28px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.od-result--available {
	border-color: rgba(39, 174, 96, 0.3);
}

.od-result--transfer {
	border-color: rgba(var(--primary-color), 0.2);
	border-color: #dadada;
}

.od-result--unavailable {
	background: #fafafa;
	border-color: #ececec;
}

.od-result:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.od-result--unavailable:hover {
	transform: none;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Result info (left side) */
.od-result-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.od-result-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	width: fit-content;
}

.od-result-badge--available {
	background: rgba(39, 174, 96, 0.1);
	color: #27ae60;
}

.od-result-badge--transfer {
	background: rgba(255, 178, 55, 0.12);
	color: #d48a00;
}

.od-result-badge--taken {
	background: rgba(214, 42, 40, 0.08);
	color: #c0392b;
}

.od-result-domain {
	font-family: var(--heading-font-family);
	font-size: 20px;
	font-weight: 700;
	color: var(--heading-color);
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.od-result--primary .od-result-domain {
	font-size: 26px;
}

.od-result--unavailable .od-result-domain {
	color: #999;
}

/* Result action (right side) */
.od-result-action {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
}

.od-result-price {
	text-align: right;
}

.od-price-amount {
	font-family: var(--heading-font-family);
	font-size: 22px;
	font-weight: 700;
	color: var(--heading-color);
}

.od-result--primary .od-price-amount {
	font-size: 28px;
}

.od-price-period {
	font-size: 13px;
	color: #707070;
	display: block;
	margin-top: -2px;
}

.od-result-unavailable-msg {
	font-size: 13px;
	color: #bbb;
	margin: 0;
}

/* ============================================
   Suggestions Section
   ============================================ */

.od-suggestions {
	margin-top: 8px;
}

.od-suggestions-title {
	font-family: var(--heading-font-family);
	font-size: 14px;
	font-weight: 600;
	color: #707070;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 20px 0 10px;
}

.od-suggestions-grid {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.od-suggestions-grid .od-result {
	padding: 14px 20px;
	box-shadow: none;
	border: 1px solid #ececec;
}

.od-suggestions-grid .od-result:hover {
	border-color: #dadada;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
	transform: none;
}

.od-suggestions-grid .od-result-domain {
	font-size: 16px;
}

.od-suggestions-grid .od-price-amount {
	font-size: 18px;
}

/* ============================================
   Error Card
   ============================================ */

.od-result--error {
	background: #fff;
	border-color: rgba(214, 42, 40, 0.3);
}

.od-result--error p {
	color: #d62a28;
	margin: 0;
}

/* ============================================
   Buttons (Salepush-compatible)
   ============================================ */

.od-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 35px;
	border-radius: 25px;
	font-family: 'GT Walsheim Pro', sans-serif;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	line-height: 40px;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: all 250ms linear 0s;
	white-space: nowrap;
}

.od-btn--primary {
	background: var(--primary-color);
	color: #fff;
	border: 1px solid transparent;
}

.od-btn--primary:hover {
	background: var(--additional01-color);
	color: #fff;
}

.od-btn--secondary {
	background: var(--additional01-color);
	color: #fff;
}

.od-btn--secondary:hover {
	background: var(--primary-color);
}

.od-btn--outline {
	border: 1px solid var(--primary-color);
	background: transparent;
	color: var(--primary-color);
}

.od-btn--outline:hover {
	background: var(--primary-color);
	color: #fff;
}

.od-btn--small {
	padding: 3px 20px;
	font-size: 12px;
	line-height: 30px;
}

.od-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ============================================
   Status Badges
   ============================================ */

.od-status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.od-status--active,
.od-status--provisioned {
	background: rgba(39, 174, 96, 0.1);
	color: #27ae60;
}

.od-status--pending {
	background: rgba(255, 178, 55, 0.1);
	color: #FFB237;
}

.od-status--expired,
.od-status--suspended,
.od-status--deleted {
	background: rgba(214, 42, 40, 0.1);
	color: #d62a28;
}

.od-type-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

/* ============================================
   Tables (My Account)
   ============================================ */

.od-my-domains h2,
.od-my-hostings h2,
.od-billing h2,
.od-billing h3 {
	font-family: var(--heading-font-family);
	color: var(--heading-color);
	margin-bottom: 20px;
}

.od-domains-table,
.od-hostings-table,
.od-billing-table {
	width: 100%;
	border-collapse: collapse;
}

.od-domains-table th,
.od-domains-table td,
.od-hostings-table th,
.od-hostings-table td,
.od-billing-table th,
.od-billing-table td {
	padding: 12px 15px;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
}

.od-domains-table th,
.od-hostings-table th,
.od-billing-table th {
	font-weight: 600;
	background: #F2F2F2;
}

.od-domains-table tr:hover td,
.od-hostings-table tr:hover td,
.od-billing-table tr:hover td {
	background: #fafafa;
}

.od-no-domains,
.od-no-hostings {
	color: #707070;
	margin-bottom: 20px;
}

/* ============================================
   Hosting Plans — Pricing Cards
   ============================================ */

.opcionalia-hosting-plans {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 15px;
}

/* Period toggle */
.opcionalia-hosting-plans__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 40px;
}

.opcionalia-hosting-plans__label {
	font-family: var(--heading-font-family);
	font-size: 15px;
	font-weight: 500;
	color: #707070;
	cursor: pointer;
	transition: all 250ms linear 0s;
}

.opcionalia-hosting-plans__label.is-active {
	color: var(--heading-color);
	font-weight: 700;
}

.opcionalia-hosting-plans__save-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	background: linear-gradient(var(--gradient01-angle, 72deg), var(--gradient01-color-from), var(--gradient01-color-to));
	color: #fff;
	margin-left: 6px;
	vertical-align: middle;
}

/* Toggle switch */
.opcionalia-hosting-plans__switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 26px;
	cursor: pointer;
}

.opcionalia-hosting-plans__switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.opcionalia-hosting-plans__slider {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #dadada;
	border-radius: 13px;
	transition: all 250ms linear 0s;
}

.opcionalia-hosting-plans__slider::before {
	content: '';
	position: absolute;
	height: 20px;
	width: 20px;
	left: 3px;
	bottom: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: all 250ms linear 0s;
}

.opcionalia-hosting-plans__switch input:checked + .opcionalia-hosting-plans__slider {
	background-color: var(--primary-color);
}

.opcionalia-hosting-plans__switch input:checked + .opcionalia-hosting-plans__slider::before {
	transform: translateX(22px);
}

/* Cards grid */
.opcionalia-hosting-plans__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	justify-content: center;
}

.opcionalia-hosting-card {
	flex: 1;
	min-width: 280px;
	max-width: 380px;
	background: #fff;
	border-radius: 15px;
	padding: 30px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	text-align: center;
	position: relative;
	transition: all 250ms linear 0s;
	display: flex;
	flex-direction: column;
}

.opcionalia-hosting-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.opcionalia-hosting-card--popular {
	border: 2px solid var(--primary-color);
}

.opcionalia-hosting-card__badge {
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	padding: 4px 16px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	background: linear-gradient(var(--gradient01-angle, 72deg), var(--gradient01-color-from), var(--gradient01-color-to));
	color: #fff;
	white-space: nowrap;
}

.opcionalia-hosting-card__title {
	font-family: var(--heading-font-family);
	font-size: var(--heading-font-size-h4, 22px);
	font-weight: var(--heading-font-weight, 700);
	color: var(--heading-color);
	margin: 10px 0 20px;
}

.opcionalia-hosting-card__price {
	margin-bottom: 8px;
}

.opcionalia-hosting-card__currency {
	font-size: 24px;
	font-weight: 700;
	color: var(--heading-color);
	vertical-align: super;
}

.opcionalia-hosting-card__amount {
	font-size: 38px;
	font-weight: 700;
	color: var(--heading-color);
}

.opcionalia-hosting-card__period {
	font-size: 14px;
	font-weight: 400;
	color: var(--body-color);
}

.opcionalia-hosting-card__billed {
	font-size: 13px;
	color: #707070;
	margin-bottom: 20px;
}

.opcionalia-hosting-card__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #f0f0f0;
}

.opcionalia-hosting-card__spec {
	font-size: 13px;
	color: var(--body-color);
}

.opcionalia-hosting-card__spec strong {
	display: block;
	font-size: 16px;
	color: var(--heading-color);
	margin-bottom: 2px;
}

.opcionalia-hosting-card__features {
	list-style: none;
	padding: 0;
	margin: 0 0 24px;
	flex: 1;
	text-align: left;
}

.opcionalia-hosting-card__feature {
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
	color: var(--body-color);
}

.opcionalia-hosting-card__check {
	color: var(--primary-color);
	margin-right: 8px;
	font-weight: 700;
}

.opcionalia-hosting-card__cta {
	margin-top: auto;
	width: 100%;
}

.opcionalia-hosting-card__cta.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* ============================================
   WHOIS Fields (Checkout)
   ============================================ */

#opcionalia-whois-fields {
	margin-top: 30px;
	padding: 30px;
	background: #fff;
	border: 1px solid #dadada;
	border-radius: 15px;
}

#opcionalia-whois-fields h3 {
	font-family: var(--heading-font-family);
	color: var(--heading-color);
	margin-top: 0;
	margin-bottom: 16px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 767px) {
	/* Search bar: stack */
	.od-search-bar {
		flex-direction: column;
		gap: 10px;
	}

	.od-search-btn {
		width: 100%;
		justify-content: center;
	}

	/* Results: stack action below info */
	.od-result {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}

	.od-result-action {
		width: 100%;
		justify-content: space-between;
	}

	.od-result-domain {
		font-size: 18px;
	}

	.od-result--primary .od-result-domain {
		font-size: 20px;
	}

	.od-result--primary .od-price-amount {
		font-size: 22px;
	}

	/* Tables: card layout on mobile */
	.od-domains-table thead,
	.od-hostings-table thead,
	.od-billing-table thead {
		display: none;
	}

	.od-domains-table tr,
	.od-hostings-table tr,
	.od-billing-table tr {
		display: block;
		margin-bottom: 16px;
		border: 1px solid #dadada;
		border-radius: 15px;
		overflow: hidden;
	}

	.od-domains-table td,
	.od-hostings-table td,
	.od-billing-table td {
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #f0f0f0;
	}

	.od-domains-table td::before,
	.od-hostings-table td::before,
	.od-billing-table td::before {
		content: attr(data-title);
		font-weight: 600;
	}

	/* Hosting plans: stack on mobile */
	.opcionalia-hosting-plans__grid {
		flex-direction: column;
		align-items: center;
	}

	.opcionalia-hosting-card {
		max-width: 100%;
	}
}

@media (max-width: 575px) {
	.opcionalia-hosting-card {
		padding: 20px;
	}

	.opcionalia-hosting-card__amount {
		font-size: 32px;
	}
}
