/**
 * Power Coupons - BOGO Styles
 *
 * @package Power_Coupons
 * @since 1.0.0
 */

.power-coupons-bogo-notifications {
	margin: 20px 0;
	clear: both;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.power-coupons-bogo-offer-wrapper {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 16px;
	background-color: #fff;
	display: flex;
	gap: 8px;
	transition: all 0.2s ease;
}

/* Unclaimed offer - lighter background */
.power-coupons-bogo-offer-wrapper.power-coupons-bogo-offer-unclaimed {
	background-color: #f9fafb;
	border: 1px solid #e5e7eb;
}

.power-coupons-bogo-notifications .power-coupons-bogo-offer-wrapper img {
	width: 50px;
	height: 50px;
	border-radius: 4px;
}

.power-coupons-bogo-offer-right {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 4px;
	flex: 1;
}

p.power-coupons-bogo-offer-badge {
	margin: 0;
	font-weight: 500;
	font-size: 12px;
	line-height: 14px;
	padding: 4px 6px;
	border-radius: 100px;
	width: max-content;
	display: flex;
	gap: 2px;
	align-items: center;
}

/* Claimed offer badge - green */
p.power-coupons-bogo-offer-badge.power-coupons-bogo-badge-claimed {
	background: #dcfce7;
	color: #166534;
}

/* Available offer badge - blue */
p.power-coupons-bogo-offer-badge.power-coupons-bogo-badge-available {
	background: #dbeafe;
	color: #1e40af;
}

p.power-coupons-bogo-offer-description {
	font-weight: 400;
	font-size: 14px;
	line-height: 20px;
	margin: 0;
	margin-top: 2px;
	color: #6b7280;
}

strong.power-coupons-bogo-offer-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	color: #111827;
}

button.power-coupons-bogo-offer-button {
	background-color: #15803d;
	color: #fff;
	padding: 8px 16px;
	font-weight: 500;
	font-style: normal;
	text-transform: none;
	font-size: 13px;
	line-height: 16px;
	text-align: center;
	cursor: pointer;
	width: fit-content;
	border: 1px solid #15803d;
	box-shadow: 0 1px 2px 0 #1018280d;
	border-radius: 4px;
	transition: all 0.2s ease;
}

button.power-coupons-bogo-offer-button:hover,
button.power-coupons-bogo-offer-button:focus {
	background-color: #166534;
	border: 1px solid #166534;
}

button.power-coupons-bogo-offer-button:active {
	background-color: #14532d;
	border: 1px solid #14532d;
}

span.power-coupons-bogo-offer-applied-text {
	font-size: 13px;
	line-height: 16px;
	color: #059669;
	font-weight: 500;
}

/* "Change gift options" — a secondary, outlined control shown on an applied
   variable BOGO offer so it reads as "edit" rather than a primary CTA. */
button.power-coupons-bogo-offer-button.power-coupons-bogo-change-options {
	display: block;
	margin-top: 8px;
	background-color: transparent;
	color: #15803d;
	border: 1px solid #15803d;
	box-shadow: none;
}

button.power-coupons-bogo-offer-button.power-coupons-bogo-change-options:hover,
button.power-coupons-bogo-offer-button.power-coupons-bogo-change-options:focus {
	background-color: #f0fdf4;
	border-color: #166534;
	color: #166534;
}

button.power-coupons-bogo-offer-button.power-coupons-bogo-change-options:active {
	background-color: #dcfce7;
	border-color: #14532d;
	color: #14532d;
}

.power-coupons-bogo-free-gift-msg {
	color: #059669;
	font-size: 13px;
	font-weight: 500;
	margin: 0 !important;
}

/* Block cart/checkout — fit BOGO notifications into WC block order summary. */
.wp-block-woocommerce-cart .power-coupons-bogo-notifications,
.wp-block-woocommerce-checkout .power-coupons-bogo-notifications {
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid #e0e0e0;
}

/* Variation picker modal — opens when "Apply Offer" is clicked on a BOGO whose
   "get" product is variable, so the customer can pick attributes before the
   gift is added to the cart. */

/* The PHP-rendered modal sits dormant inside the offer wrapper; keep it hidden
   there. The script clones it onto <body> (outside the wrapper) to show it. */
.power-coupons-bogo-offer-wrapper .power-coupons-bogo-modal-overlay {
	display: none;
}

.power-coupons-bogo-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 17, 24, 39, 0.55 );
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.power-coupons-bogo-modal {
	position: relative;
	background: #fff;
	border-radius: 8px;
	width: 100%;
	max-width: 480px;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	padding: 24px;
	box-shadow: 0 10px 25px rgba( 0, 0, 0, 0.15 );
	box-sizing: border-box;
}

.power-coupons-bogo-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 18px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
}

.power-coupons-bogo-modal-close:hover,
.power-coupons-bogo-modal-close:focus {
	color: #111827;
	background: #f3f4f6;
}

.power-coupons-bogo-modal-title {
	font-size: 18px;
	line-height: 24px;
	font-weight: 600;
	color: #111827;
	margin: 0 24px 4px 0;
}

.power-coupons-bogo-modal-subtitle {
	font-size: 14px;
	line-height: 20px;
	color: #6b7280;
	margin: 0 0 16px 0;
}

.power-coupons-bogo-modal-product {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 12px;
	margin-bottom: 12px;
	background: #f9fafb;
}

.power-coupons-bogo-modal-product-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.power-coupons-bogo-modal-product-header img {
	width: 36px;
	height: 36px;
	border-radius: 4px;
	object-fit: cover;
}

.power-coupons-bogo-modal-product-name {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
}

.power-coupons-bogo-modal-field {
	display: block;
	margin-bottom: 8px;
}

.power-coupons-bogo-modal-field:last-child {
	margin-bottom: 0;
}

.power-coupons-bogo-modal-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 4px;
}

.power-coupons-bogo-modal-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	color: #111827;
	box-sizing: border-box;
}

.power-coupons-bogo-modal-select:focus {
	outline: 2px solid #15803d;
	outline-offset: -2px;
	border-color: #15803d;
}

.power-coupons-bogo-modal-error {
	color: #b91c1c;
	background: #fee2e2;
	border-radius: 4px;
	padding: 8px 12px;
	font-size: 13px;
	margin: 12px 0 0 0;
}

.power-coupons-bogo-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

.power-coupons-bogo-modal-cancel,
.power-coupons-bogo-modal-submit {
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.15s ease;
}

.power-coupons-bogo-modal-cancel,
.power-coupons-bogo-modal-cancel:hover,
.power-coupons-bogo-modal-cancel:focus,
.power-coupons-bogo-modal-cancel:active {
	color: #374151;
	text-decoration: none;
}

.power-coupons-bogo-modal-cancel {
	background: #fff;
	border-color: #d1d5db;
}

.power-coupons-bogo-modal-cancel:hover,
.power-coupons-bogo-modal-cancel:focus {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.power-coupons-bogo-modal-submit {
	background: #15803d;
	border-color: #15803d;
	color: #fff;
}

.power-coupons-bogo-modal-submit:hover:not( :disabled ),
.power-coupons-bogo-modal-submit:focus:not( :disabled ) {
	background: #166534;
	border-color: #166534;
}

.power-coupons-bogo-modal-submit:disabled {
	background: #9ca3af;
	border-color: #9ca3af;
	cursor: not-allowed;
}
