/**
 * Quote cart / checkout — mobile & tablet.
 * Stacked rows so labels and values never overlap.
 */

/* Checkout: stack form + summary earlier to avoid right-side clipping */
@media (max-width: 1100px) {
	.ddd-quote--checkout .ddd-quote__layout {
		grid-template-columns: 1fr;
	}

	.ddd-quote--checkout .ddd-quote__aside {
		position: static;
		order: 2;
	}

	.ddd-quote--checkout .ddd-quote-form__main,
	.ddd-quote--checkout .ddd-quote-review__main {
		order: 1;
	}

	.ddd-quote-form__grid {
		grid-template-columns: 1fr;
	}

	.ddd-quote-form__delivery {
		grid-template-columns: 1fr;
	}

	.ddd-quote-summary__rows > div {
		grid-template-columns: 1fr;
	}

	.ddd-quote-summary__rows dd {
		text-align: left;
	}
}

@media (max-width: 1200px) {
	.ddd-quote-table--editable {
		--ddd-q-row-cols: 56px minmax(160px, 2fr) 110px minmax(110px, 0.95fr) minmax(120px, 1fr);
	}

	.ddd-quote-table--readonly {
		--ddd-q-ro-cols: minmax(180px, 2fr) 100px minmax(100px, 0.95fr) minmax(110px, 1fr);
	}

	.ddd-quote-item {
		gap: 0.4rem 0.75rem;
	}
}

@media (max-width: 900px) {
	.ddd-quote__layout,
	.ddd-quote--checkout .ddd-quote__layout {
		grid-template-columns: 1fr;
	}

	.ddd-quote__aside {
		position: static;
		order: 2;
	}

	.ddd-quote__main,
	.ddd-quote__list,
	.ddd-quote-form__main,
	.ddd-quote-review__main {
		order: 1;
	}

	.ddd-quote-steps__list {
		gap: 0.4rem;
	}

	.ddd-quote-steps__link {
		min-height: 0;
		padding: 0.5rem 0.55rem;
	}

	.ddd-quote-steps__label {
		font-size: 0.78rem;
	}

	/* One product = stacked card */
	.ddd-quote-table__head {
		display: none;
	}

	.ddd-quote-table--editable .ddd-quote-item__col-label {
		display: block;
	}

	.ddd-quote-item {
		display: grid;
		grid-template-columns: 64px minmax(0, 1fr);
		grid-template-areas:
			"media info"
			"qty qty"
			"price price"
			"total total"
			"note note";
		gap: 0;
		padding: 0;
		align-items: stretch;
	}

	.ddd-quote-table--readonly .ddd-quote-table__row,
	.ddd-quote-table--readonly .ddd-quote-table__row--compact {
		display: grid;
		grid-template-columns: 1fr;
		gap: 0.55rem;
		padding: 0.9rem 1rem;
	}

	.ddd-quote-table--readonly .ddd-quote-table__cell--qty,
	.ddd-quote-table--readonly .ddd-quote-table__cell--price,
	.ddd-quote-table--readonly .ddd-quote-table__cell--total {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 1rem;
		text-align: right;
		padding-top: 0.35rem;
		border-top: 1px dashed var(--ddd-q-line);
	}

	.ddd-quote-table--readonly .ddd-quote-table__cell--qty::before,
	.ddd-quote-table--readonly .ddd-quote-table__cell--price::before,
	.ddd-quote-table--readonly .ddd-quote-table__cell--total::before {
		content: attr(data-label);
		font-size: 0.72rem;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--ddd-q-muted);
		text-align: left;
	}

	.ddd-quote-item__media {
		grid-area: media;
		padding: 0.9rem 0 0.75rem 0.9rem;
		align-self: start;
	}

	.ddd-quote-item__media img {
		width: 64px;
		height: 64px;
	}

	.ddd-quote-item__info {
		grid-area: info;
		padding: 0.9rem 0.9rem 0.75rem 0.75rem;
		min-width: 0;
	}

	.ddd-quote-item__name {
		font-size: 0.95rem;
		margin-bottom: 0.35rem;
	}

	.ddd-quote-item__name a {
		-webkit-line-clamp: 3;
		word-break: break-word;
	}

	.ddd-quote-item__meta {
		gap: 0.25rem 0.65rem;
		font-size: 0.75rem;
	}

	.ddd-quote-item__qty-wrap,
	.ddd-quote-item__price,
	.ddd-quote-item__line-total,
	.ddd-quote-item__note-wrap {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.4rem 0.75rem;
		padding: 0.7rem 0.9rem;
		border-top: 1px solid var(--ddd-q-line);
		text-align: left;
		width: auto;
		max-width: none;
		min-width: 0;
	}

	.ddd-quote-item__qty-wrap { grid-area: qty; }
	.ddd-quote-item__price { grid-area: price; }
	.ddd-quote-item__line-total { grid-area: total; }

	.ddd-quote-item__note-wrap {
		grid-area: note;
		flex-direction: column;
		align-items: stretch;
		background: #f8fbff;
	}

	.ddd-quote-item__col-label {
		margin: 0;
		flex: 1 1 auto;
		min-width: 0;
		max-width: 48%;
		font-size: 0.78rem;
		line-height: 1.35;
		text-transform: none;
		letter-spacing: 0;
		font-weight: 600;
	}

	.ddd-quote-item__qty {
		flex: 0 0 auto;
		margin-left: auto;
	}

	.ddd-quote-item__price strong,
	.ddd-quote-item__line-total strong {
		display: inline;
		font-size: 0.98rem;
		margin-left: auto;
		text-align: right;
	}

	.ddd-quote-item__per {
		display: inline;
		margin-left: 0.25rem;
		white-space: nowrap;
	}

	.ddd-quote-item__na {
		margin-left: auto;
	}

	.ddd-quote-item__remove {
		display: block;
		width: 100%;
		margin-top: 0.35rem;
		text-align: right;
		font-size: 0.82rem;
	}

	.ddd-quote-item__note-wrap .ddd-quote-item__col-label {
		max-width: none;
		margin-bottom: 0.35rem;
	}

	.ddd-quote-item__note {
		width: 100%;
		max-width: none;
		height: 2.65rem;
		font-size: 16px;
	}

	.ddd-quote-summary__rows > div {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.2rem;
		padding: 0.65rem 0;
	}

	.ddd-quote-summary__rows dd {
		text-align: left;
	}

	.ddd-quote-summary__muted {
		max-width: none;
	}

	.ddd-quote-summary .ddd-quote__btn {
		margin-left: 0.9rem;
		margin-right: 0.9rem;
		width: calc(100% - 1.8rem);
	}

	.ddd-quote__panel-head {
		flex-wrap: wrap;
		gap: 0.4rem 0.75rem;
		padding: 0.75rem 0.9rem;
	}

	.ddd-quote-review__dl > div {
		grid-template-columns: 1fr;
		gap: 0.2rem;
	}

	.ddd-quote-review__lines li {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	.ddd-quote-review__line-total {
		text-align: left;
	}
}

@media (max-width: 560px) {
	.ddd-quote {
		padding: 0.85rem 0.65rem 2.5rem;
	}

	.ddd-quote-steps__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.3rem;
	}

	.ddd-quote-steps__link {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 0.3rem;
		padding: 0.45rem 0.25rem;
	}

	.ddd-quote-steps__label {
		font-size: 0.68rem;
		line-height: 1.2;
		display: block;
		width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.ddd-quote__title {
		font-size: 1.35rem;
	}

	.ddd-quote__intro {
		font-size: 0.88rem;
	}

	.ddd-quote-item__media {
		padding: 0.8rem 0 0.65rem 0.75rem;
	}

	.ddd-quote-item__media img {
		width: 56px;
		height: 56px;
	}

	.ddd-quote-item__info {
		padding: 0.8rem 0.75rem 0.65rem 0.65rem;
	}

	.ddd-quote-item__name {
		font-size: 0.9rem;
	}

	.ddd-quote-item__qty-wrap,
	.ddd-quote-item__price,
	.ddd-quote-item__line-total,
	.ddd-quote-item__note-wrap {
		padding: 0.65rem 0.75rem;
	}

	.ddd-quote-item__col-label {
		max-width: 46%;
		font-size: 0.75rem;
	}

	.ddd-quote-item__step {
		width: 2.15rem;
		height: 2.15rem;
	}

	.ddd-quote-item__qty-input {
		width: 3.1rem;
		height: 2.15rem;
		font-size: 16px;
	}

	.ddd-quote-form__main .ddd-quote-form__section,
	.ddd-quote-review__block {
		padding: 0.95rem 0.85rem 1rem;
	}

	.ddd-quote-form__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.ddd-quote-form__actions .ddd-quote__btn {
		width: 100%;
	}

	.ddd-quote-form__delivery {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 360px) {
	.ddd-quote-steps__label {
		font-size: 0.62rem;
	}

	.ddd-quote-item {
		grid-template-columns: 48px minmax(0, 1fr);
	}

	.ddd-quote-item__media img {
		width: 48px;
		height: 48px;
	}

	.ddd-quote-item__col-label {
		max-width: 100%;
		flex: 1 0 100%;
	}

	.ddd-quote-item__qty,
	.ddd-quote-item__price strong,
	.ddd-quote-item__line-total strong,
	.ddd-quote-item__na {
		margin-left: 0;
	}
}
