/**
 * Unified single-product action row: quantity stepper + up to three
 * conditional buttons, all in one line, filling the full row width.
 *
 * Width split: quantity ~15%, Add to Cart icon-square ~9%, Buy Now / Place
 * Order share whatever's left EQUALLY between them via flex-grow — this
 * naturally also handles the case where only one of the two exists (it just
 * takes all the remaining space instead of half of it), no separate rule
 * needed for that case.
 */

/* Hide WooCommerce's own quantity input + Add to Cart submit button visually
   — NOT removed from the DOM. The new Add to Cart button below triggers a
   real click on the hidden native button, so WooCommerce's own add-to-cart
   handling (AJAX, stock checks, variations) keeps running unchanged. */
.summary form.cart .quantity,
.summary form.cart button[type="submit"],
.summary form.cart .single_add_to_cart_button {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}


.summary .woocommerce-variation {
	display: none !important;
}

/* The form's own margin doesn't collapse just because its content is
   visually hidden — this is what was causing the big empty gap above the
   action row. Its content has no layout footprint anymore, so the form
   itself doesn't need any either. */
.single-product div.product form.cart {
	margin: 0 !important;
}

:root {
	--cm-action-radius: 10px;
	--cm-action-height: 50px;
}

.cm-product-actions-row {
	display: flex;
	align-items: stretch;
	width: 100%;
	gap: 10px;
	flex-wrap: nowrap;
	margin: 16px 0 0;
	box-sizing: border-box;
}

/* Shared quantity stepper — 15% of the row */
.cm-product-quantity-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #ddd;
	border-radius: var(--cm-action-radius);
	overflow: hidden;
	flex: 0 0 20%;
	height: var(--cm-action-height);
	box-sizing: border-box;
}

.cm-product-quantity-btn {
	background: transparent;
	border: none;
	flex: 1 1 auto;
	height: 100%;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

.cm-product-quantity-btn:hover { background: #f3f3f3; }

.cm-product-quantity-input {
	width: 30%;
	height: 100%;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	text-align: center;
	-moz-appearance: textfield;
	box-sizing: border-box;
}

.cm-product-quantity-input::-webkit-outer-spin-button,
.cm-product-quantity-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to Cart — icon + text, sized to its own content; same height as
   everything else in the row. */
.cm-product-add-to-cart-button {
	flex: 0 0 auto;
	height: var(--cm-action-height);
	border-radius: var(--cm-action-radius);
	border: 1px solid #ddd;
	background: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 18px;
	cursor: pointer;
	box-sizing: border-box;
	white-space: nowrap;
}

.cm-product-add-to-cart-button__text {
	font-weight: 600;
	font-size: 14px;
	color: #1d2327;
}

.cm-product-add-to-cart-button:hover { background: #f7f7f7; }

/* Buy Now / Place Order — split whatever space remains equally */
.cm-product-action-btn {
	height: var(--cm-action-height);
	flex: 1 1 0;
	min-width: 0;
	padding: 0 20px;
	border-radius: var(--cm-action-radius) !important;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	box-sizing: border-box;
}

.cm-product-action-btn--solid {
	background: #1d2327 !important;
	color: #fff !important;
	border: 1px solid #1d2327 !important;
}

.cm-product-action-btn--outline {
	background: transparent !important;
	color: #1d2327 !important;
	border: 1px solid #1d2327 !important;
}

@media (max-width: 480px) {
	.cm-product-actions-row {
		flex-wrap: wrap;
	}

	/* Quantity + Add to Cart share the first line */
	.cm-product-quantity-control,
	.cm-product-add-to-cart-button {
		flex: 1 1 auto;
	}

	/* Buy Now / Place Order each claim their own full-width line below */
	.cm-product-action-btn--solid,
	.cm-product-action-btn--outline {
		flex: 1 1 100%;
	}
}



/* =========================================================
   ACTION BUTTON LOADING ANIMATION
   ========================================================= */

.cm-product-action-loading {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-right: 8px;
	vertical-align: middle;
}

.cm-product-action-loading span {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	animation: cmProductActionPulse 0.9s ease-in-out infinite;
}

.cm-product-action-loading span:nth-child(2) {
	animation-delay: 0.15s;
}

.cm-product-action-loading span:nth-child(3) {
	animation-delay: 0.3s;
}

.cm-product-action-loading-text {
	display: inline-flex;
	align-items: center;
}

.cm-product-action-btn:disabled,
.cm-product-add-to-cart-button:disabled {
	cursor: wait !important;
	opacity: 0.8 !important;
	transform: none !important;
}

@keyframes cmProductActionPulse {
	0%,
	80%,
	100% {
		transform: scale(0.65);
		opacity: 0.5;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}


/* =========================================================
   QUANTITY BUTTON FEEDBACK
   ========================================================= */

.cm-product-quantity-btn {
	transition:
		background-color 0.15s ease,
		transform 0.1s ease;
}

.cm-product-quantity-btn:active {
	transform: scale(0.92);
}


/* =========================================================
   ADD TO CART BUTTON FEEDBACK
   ========================================================= */

.cm-product-add-to-cart-button {
	transition:
		background-color 0.15s ease,
		transform 0.1s ease,
		box-shadow 0.15s ease;
}

.cm-product-add-to-cart-button:active {
	transform: scale(0.94);
}


/* =========================================================
   BUY NOW / PLACE ORDER FEEDBACK
   ========================================================= */

.cm-product-action-btn {
	transition:
		background-color 0.15s ease,
		color 0.15s ease,
		transform 0.1s ease,
		box-shadow 0.15s ease;
}

.cm-product-action-btn:active {
	transform: translateY(1px) scale(0.99);
}


/* =========================================================
   OUT OF STOCK
   ========================================================= */

/* Visual cue — Buy Now and Add to Cart look disabled; the actual blocking
   happens in JS (still clickable, shows a notice) rather than a true
   disabled attribute, so the click can be caught and explained. */
.cm-product-actions-row[data-in-stock="0"] .cm-buy-now-button,
.cm-product-actions-row[data-in-stock="0"] .cm-product-add-to-cart-button {
	opacity: 0.5;
	cursor: not-allowed;
}

#cm-stock-toast {
	position: fixed;
	left: 50%;
	bottom: 30px;
	transform: translate(-50%, 20px);
	background: #1d2327;
	color: #fff;
	padding: 12px 22px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 9999;
	pointer-events: none;
}

#cm-stock-toast.cm-stock-toast--visible {
	opacity: 1;
	transform: translate(-50%, 0);
}




/* ==========================================================================
   CAMFORT MALL - UNIFIED PRODUCT ACTIONS RESPONSIVE FIX
   ========================================================================== */

.cm-product-actions-row {
    width: 100% !important;

    min-width: 0 !important;

    display: flex !important;

    align-items: stretch !important;

    flex-wrap: wrap !important;

    gap: 8px !important;

    box-sizing: border-box !important;
}


/* Quantity must never collapse */

.cm-product-actions-row .cm-product-quantity-control {
    flex: 0 0 auto !important;

    width: 118px !important;

    min-width: 118px !important;

    height: 48px !important;

    display: flex !important;

    align-items: center !important;

    justify-content: space-between !important;

    box-sizing: border-box !important;

    overflow: hidden !important;

    border: 1px solid var(--color-border-strong) !important;

    background: var(--color-bg) !important;

    border-radius: 999px !important;
}


.cm-product-actions-row .cm-product-quantity-btn {
    flex: 0 0 34px !important;

    width: 34px !important;
    min-width: 34px !important;

    height: 34px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;

    margin: 0 !important;

    border: none !important;

    border-radius: 50% !important;

    background: transparent !important;

    color: var(--color-text) !important;

    font-size: 16px !important;

    line-height: 1 !important;
}


.cm-product-actions-row .cm-product-quantity-input {
    flex: 1 1 auto !important;

    width: 42px !important;

    min-width: 42px !important;

    max-width: 46px !important;

    height: 34px !important;

    padding: 0 2px !important;

    margin: 0 !important;

    border: none !important;

    outline: none !important;

    background: transparent !important;

    text-align: center !important;

    color: var(--color-text) !important;

    font-size: 14px !important;

    font-weight: 800 !important;

    line-height: 34px !important;
}


.cm-product-actions-row .cm-product-quantity-input::-webkit-outer-spin-button,
.cm-product-actions-row .cm-product-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;

    margin: 0 !important;
}


.cm-product-actions-row .cm-product-quantity-input {
    -moz-appearance: textfield !important;
}


/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */

.cm-product-actions-row .cm-product-add-to-cart-button,
.cm-product-actions-row .cm-product-action-btn,
.cm-product-actions-row .cm-product-place-order-button {
    flex: 1 1 150px !important;

    min-width: 120px !important;

    min-height: 48px !important;

    box-sizing: border-box !important;

    white-space: nowrap !important;

    margin: 0 !important;
}


/* --------------------------------------------------------------------------
   NARROW DESKTOP
   -------------------------------------------------------------------------- */

@media (min-width: 769px) and (max-width: 1100px) {

    .cm-product-actions-row {
        gap: 7px !important;
    }


    .cm-product-actions-row .cm-product-quantity-control {
        width: 112px !important;

        min-width: 112px !important;
    }


    .cm-product-actions-row .cm-product-quantity-btn {
        flex-basis: 32px !important;

        width: 32px !important;

        min-width: 32px !important;
    }


    .cm-product-actions-row .cm-product-quantity-input {
        min-width: 38px !important;

        max-width: 42px !important;
    }


    .cm-product-actions-row .cm-product-add-to-cart-button,
    .cm-product-actions-row .cm-product-action-btn,
    .cm-product-actions-row .cm-product-place-order-button {
        flex: 1 1 135px !important;

        min-width: 115px !important;

        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}


/* --------------------------------------------------------------------------
   TABLET
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

    .cm-product-actions-row {
        width: 100% !important;

        display: grid !important;

        grid-template-columns:
            118px
            minmax(0, 1fr) !important;

        gap: 8px !important;
    }


    .cm-product-actions-row .cm-product-quantity-control {
        width: 118px !important;

        min-width: 118px !important;
    }


    .cm-product-actions-row .cm-product-add-to-cart-button,
    .cm-product-actions-row .cm-product-action-btn,
    .cm-product-actions-row .cm-product-place-order-button {
        width: 100% !important;

        min-width: 0 !important;
    }
}



@media (max-width: 768px) {
    .cm-product-actions-row .cm-product-action-btn--solid,
    .cm-product-actions-row .cm-product-action-btn--outline,
    .cm-product-actions-row .cm-product-place-order-button {
        grid-column: 1 / -1 !important;
    }
}

/* --------------------------------------------------------------------------
   SMALL PHONES
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {

    .cm-product-actions-row {
        grid-template-columns:
            108px
            minmax(0, 1fr) !important;
    }


    .cm-product-actions-row .cm-product-quantity-control {
        width: 108px !important;

        min-width: 108px !important;
    }


    .cm-product-actions-row .cm-product-quantity-btn {
        flex-basis: 29px !important;

        width: 29px !important;

        min-width: 29px !important;
    }


    .cm-product-actions-row .cm-product-quantity-input {
        min-width: 34px !important;

        max-width: 38px !important;

        font-size: 13px !important;
    }
}


.cm-product-add-to-cart-button {
	background: var(--color-accent);
	border: 1px solid var(--color-accent-dark);
	color: var(--color-white);
}

.cm-product-add-to-cart-button__text {
	color: var(--color-white);
}

.cm-product-add-to-cart-button:hover {
	background: var(--color-accent-dark);
	border-color: var(--color-accent-dark);
}


.cm-product-add-to-cart-button__text {
	font-weight: 600;
	font-size: 16px;
	color: var(--color-white);
}


.tm-timer-wrapper {
	padding: 10px !important;
}



/* ==========================================================
   CLEAN PLACE ORDER LINK
   Full-width, own line, left aligned
   ========================================================== */

.cm-product-actions-row {
	overflow: visible !important;
}

.cm-product-place-order-button {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;

	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;

	box-sizing: border-box !important;

	margin: 4px 0 0 !important;
	padding: 4px 0 !important;

	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;

	color: var(--color-primary) !important;

	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;

	text-align: left !important;
	text-decoration: none !important;

	cursor: pointer !important;

	gap: 7px !important;

	transition:
		color 0.2s ease,
		gap 0.2s ease,
		transform 0.2s ease !important;
}

/* Order/document icon */
.cm-place-order-icon {
	flex: 0 0 18px !important;
	width: 18px !important;
	height: 18px !important;
	display: block !important;
	color: currentColor !important;
}

/* Arrow */
.cm-place-order-arrow {
	flex: 0 0 15px !important;
	width: 15px !important;
	height: 15px !important;
	display: block !important;

	transition: transform 0.2s ease !important;
}

/* Hover */
.cm-product-place-order-button:hover {
	color: var(--color-primary-hover) !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	gap: 9px !important;
	text-decoration: none !important;
}

.cm-product-place-order-button:hover .cm-place-order-arrow {
	transform: translateX(2px);
}

/* Focus / active */
.cm-product-place-order-button:focus,
.cm-product-place-order-button:active,
.cm-product-place-order-button:visited {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	text-decoration: none !important;
}

/* Prevent Storefront/WooCommerce button rules from interfering */
.cm-product-actions-row
.cm-product-place-order-button.cm-product-action-btn,
.cm-product-actions-row
.cm-product-place-order-button.cm-product-action-btn--outline {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;

	height: auto !important;
	min-height: 0 !important;

	margin: 4px 0 0 !important;
	padding: 4px 0 !important;

	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 767px) {
	.cm-product-place-order-button {
		grid-column: 1 / -1 !important;
		width: 100% !important;
		max-width: 100% !important;

		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 0 !important;

		justify-content: flex-start !important;
		text-align: left !important;

		font-size: 16px !important;
		font-weight: 700 !important;
	}
}



.cm-product-actions-row.cm-product-order-controls .cm-product-place-order-button {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1 !important;
}