/**
 * Rouzhina Smart Cart - scoped styles (.rzsc-* / .rzsc-*)
 * RTL-first, matches the Ayrin MDC button scale.
 */

/* ---- minus -> trash morph (qty == 1) ---- */
.quantity .minus.rzsc-trash {
    color: #ef394e;
}

.quantity .minus.rzsc-trash .mdc-button__label svg,
.quantity .minus.rzsc-trash > svg {
    color: #ef394e;
    fill: #ef394e;
}

.quantity .minus.rzsc-trash:hover {
    background-color: rgba(239, 57, 78, .10);
}

.quantity .minus.rzsc-trash:active {
    background-color: rgba(239, 57, 78, .18);
}

/* ---- undo mode: hide stepper, show restore ring ---- */
.quantity.rzsc-undo-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quantity.rzsc-undo-mode > *:not(.rzsc-undo) {
    display: none !important;
}

.rzsc-undo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.rzsc-undo-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    margin: 0;
    padding: 3px 8px;
    background: transparent;
    cursor: pointer;
    direction: rtl;
}

.rzsc-undo-btn:hover .rzsc-undo-label {
    text-decoration: underline;
}

.rzsc-ring {
    position: relative;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
}

.rzsc-ring svg {
    display: block;
    width: 26px;
    height: 26px;
    transform: rotate(-90deg);
}

.rzsc-ring-bg {
    fill: none;
    stroke: #e9e9ec;
    stroke-width: 2.6;
}

.rzsc-ring-fg {
    fill: none;
    stroke: #ef394e;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 5000ms linear;
}

/* counter-clockwise drain: dashoffset grows toward pathLength */
.rzsc-running .rzsc-ring-fg {
    stroke-dashoffset: 100;
}

.rzsc-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #23254e;
}

.rzsc-undo-label {
    font-size: 12px;
    font-weight: 600;
    color: #23254e;
    white-space: nowrap;
}

/* ---- removed-row state during the undo window ---- */
li.rzsc-removed {
    opacity: .55;
    filter: grayscale(.35);
    transition: opacity .25s ease, filter .25s ease;
}

li.rzsc-removed * {
    pointer-events: none !important;
}

li.rzsc-removed .rzsc-undo,
li.rzsc-removed .rzsc-undo * {
    pointer-events: auto !important;
}

/* collapse animation when the undo window expires */
li.rzsc-expiring {
    overflow: hidden;
    transition: height .35s ease, opacity .3s ease, padding .35s ease, margin .35s ease;
}

li.rzsc-expiring .rzsc-undo {
    display: none;
}

/* ============================================
   v1.1.0 - product-card stepper (Digikala style)
   Tune colors here once, applies everywhere.
   ============================================ */
.rzsc-card-stepper {
	--rzsc-step-bg: #ffffff;
	--rzsc-step-border: #dcdcdf;
	--rzsc-step-fg: #3f4064;
	--rzsc-step-radius: 8px;
	--rzsc-danger: #ef394e;
}

.rzsc-card-hidden {
	display: none !important;
}

.rzsc-card-stepper {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	width: 78px;
	height: 32px;
	padding: 0 2px;
	background: var(--rzsc-step-bg);
	border: 1px solid var(--rzsc-step-border);
	border-radius: var(--rzsc-step-radius);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
	direction: rtl;
	flex: 0 0 auto;
	transition: width .25s ease, border-color .15s ease, box-shadow .15s ease;
}

.rzsc-card-stepper:hover {
	box-shadow: 0 1px 4px rgba(0, 0, 0, .10);
}

.rzsc-card-step {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.rzsc-card-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 26px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rzsc-step-fg);
	cursor: pointer;
	border-radius: 6px;
}

.rzsc-card-btn:hover {
	background: rgba(0, 0, 0, .05);
}

.rzsc-card-btn:active {
	background: rgba(0, 0, 0, .10);
}

.rzsc-card-qty {
	flex: 1 1 auto;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: #23254e;
	direction: ltr;
}

/* minus -> red trash at qty 1 */
.rzsc-card-btn.rzsc-trash {
	color: var(--rzsc-danger);
}

.rzsc-card-btn.rzsc-trash:hover {
	background: rgba(239, 57, 78, .10);
}

.rzsc-card-btn.rzsc-trash:active {
	background: rgba(239, 57, 78, .18);
}

/* card stepper during the undo window */
.rzsc-card-stepper.rzsc-undo-mode {
	width: 118px;
	border-color: rgba(239, 57, 78, .45);
}

.rzsc-card-stepper.rzsc-undo-mode > *:not(.rzsc-undo) {
	display: none !important;
}

.rzsc-card-stepper.rzsc-card-removed {
	opacity: .85;
}

/* generic undo pill host (works on cards and cart widgets) */
.rzsc-host.rzsc-undo-mode {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
