/* Suuruste tabelid (task #59082): size buttons and size chart popup, see t/js/size-charts.js */

/* the select stays in the page (site.js reads it) but the buttons replace it */
body.sc-on #product-size,
body.sc-on #product_size_chosen,
body.sc-on #product #shop .chosen-container { display: none !important; }

.sc-picker { clear: both; margin: 0 0 20px; font-size: 14px; color: #222; }
.sc-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sc-picker-title { font-weight: 700; font-size: 16px; }

.sc-switch { display: inline-flex; border: 1px solid #d6d6d6; border-radius: 6px; overflow: hidden; }
.sc-switch-btn { border: 0; background: #fff; color: #333; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.sc-switch-btn + .sc-switch-btn { border-left: 1px solid #d6d6d6; }
.sc-switch-btn.sc-active { background: #333; color: #fff; }

.sc-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.sc-size {
	position: relative; min-height: 46px; padding: 6px 4px; border: 1px solid #d6d6d6; border-radius: 6px;
	background: #fff; color: #222; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.2;
}
.sc-size:hover { border-color: #333; }
.sc-size.sc-selected { border: 2px solid #e56524; padding: 5px 3px; }
.sc-size.sc-out {
	cursor: default; color: #8a8a8a; font-weight: 400; background-color: #f3f3f3;
	background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), #c9c9c9 50%, transparent calc(50% + 0.5px));
}
.sc-size.sc-out:hover { border-color: #d6d6d6; }
.sc-eu-tag { display: block; font-size: 10px; font-weight: 400; color: #777; }
/* "Viimane paar selles suuruses": one line for the picked size, not a badge on every button */
.sc-last-note { margin: 12px 0 0; color: #2e8540; font-size: 14px; font-weight: 700; }
.sc-last-note::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2e8540; margin-right: 8px; vertical-align: 1px; }
.sc-last-note[hidden] { display: none; }

.sc-note { margin: 12px 0 0; color: #555; font-size: 13px; }
.sc-open {
	display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0; border: 0; background: none;
	color: #e56524; font-weight: 700; font-size: 15px; text-decoration: underline; cursor: pointer;
}
.sc-ruler { display: inline-block; width: 18px; height: 9px; border: 2px solid #e56524; border-radius: 2px; position: relative; }
.sc-ruler::after { content: ""; position: absolute; left: 3px; right: 3px; top: 0; height: 3px; background: repeating-linear-gradient(to right, #e56524 0 1.5px, transparent 1.5px 4px); }

/* popup */
body.sc-modal-open { overflow: hidden; }
/* the Askly chat button and its bubble (z-index 999999999) must not cover the popup:
   the popup sits on the top layer and the chat is hidden while it is open */
body.sc-modal-open #tw-chat-root,
body.sc-modal-open iframe[src*="askly"] { display: none !important; }
.sc-overlay {
	position: fixed; inset: 0; z-index: 2147483647; background: rgba(0, 0, 0, .45);
	display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.sc-dialog { background: #fff; width: 100%; max-width: 720px; border-radius: 10px; padding: 22px 24px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.25); color: #222; font-size: 14px; }
.sc-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sc-dialog-titlewrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc-logo { max-height: 30px; max-width: 110px; }
.sc-dialog-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; text-transform: none; }
.sc-universal { display: inline-block; margin-left: 10px; vertical-align: middle; font-size: 11px; font-weight: 700; letter-spacing: .5px; background: #333; color: #fff; padding: 2px 7px; border-radius: 4px; }
.sc-preview-tag { display: inline-block; margin-left: 10px; vertical-align: middle; font-size: 11px; font-weight: 700; background: #fef3c7; color: #92400e; padding: 2px 7px; border-radius: 4px; }
.sc-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f0f0f0; font-size: 22px; line-height: 1; cursor: pointer; color: #333; }
.sc-close:hover { background: #e2e2e2; }
.sc-dialog-intro { margin: 6px 0 14px; color: #555; font-size: 13px; }
.sc-dialog-intro + .sc-body-note { margin-top: -8px; }

/* tabs wrap onto a second line when they don't fit (no hidden sideways scroll); the underline is drawn
   inside the tab (no negative margin, so nothing overflows vertically) */
.sc-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #e3e3e3; margin-bottom: 16px; }
.sc-tab { flex: none; border: 0; background: none; padding: 10px 14px; font-size: 15px; font-weight: 700; color: #777; cursor: pointer; white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; }
.sc-tab.sc-active { color: #222; box-shadow: inset 0 -3px 0 #e56524; }

.sc-measure { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: #f4f4f4; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.sc-measure-label { font-weight: 700; }
.sc-measure-input { width: 84px; padding: 7px 8px; border: 1px solid #c8c8c8; border-radius: 6px; font-size: 15px; background: #fff; }
.sc-measure-input:focus { outline: 2px solid #2266cc; outline-offset: 0; }
.sc-measure-result { color: #e56524; font-weight: 700; }
.sc-measure-note { color: #555; font-weight: 400; }
.sc-help { margin: 0 0 12px; font-size: 13px; color: #444; }
.sc-help summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.sc-help ol { margin: 6px 0 0 20px; padding: 0; }
.sc-help li { margin: 2px 0; list-style: decimal; }

.sc-table-wrap { overflow-x: auto; }
.sc-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 14px; }
.sc-table th { font-size: 12px; font-weight: 400; text-transform: uppercase; color: #666; letter-spacing: .4px; padding: 10px 8px; border-bottom: 1px solid #e3e3e3; }
.sc-table td { padding: 9px 8px; border-bottom: 1px solid #ececec; }
.sc-table td.sc-key { font-weight: 700; }
/* foot-length recommendation: peach row; the size picked on the page: orange outline and a
   "Valitud" tag (both together when they are the same row) */
.sc-table tr.sc-recommended td { background: #fdeadf; }
.sc-table tr.sc-current td { box-shadow: inset 0 2px 0 #e56524, inset 0 -2px 0 #e56524; font-weight: 700; }
.sc-table tr.sc-current td:first-child { box-shadow: inset 2px 0 0 #e56524, inset 0 2px 0 #e56524, inset 0 -2px 0 #e56524; }
.sc-table tr.sc-current td:last-child { box-shadow: inset -2px 0 0 #e56524, inset 0 2px 0 #e56524, inset 0 -2px 0 #e56524; }
.sc-picked { display: inline-block; background: #e56524; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 5px; }
.sc-all-link { display: inline-block; margin-top: 16px; color: #e56524; font-weight: 700; text-decoration: underline; }
/* the Vali button stays compact in the row, its touch area reaches 44 px */
.sc-choose { position: relative; min-height: 32px; border: 1px solid #d0d0d0; background: #fff; border-radius: 5px; padding: 4px 14px; font-size: 13px; cursor: pointer; }
.sc-choose::after { content: ""; position: absolute; inset: -6px -4px; }
.sc-choose:hover { border-color: #333; }
.sc-na { color: #777; }

@media (max-width: 600px) {
	.sc-overlay { padding: 0; }
	.sc-dialog { min-height: 100%; border-radius: 0; padding: 16px; }
	.sc-dialog-title { font-size: 17px; }
	.sc-table { font-size: 13px; }
	.sc-table th, .sc-table td { padding: 8px 4px; }
	.sc-sizes { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
	/* wide tables (Icepeak, Luhta) scroll sideways: the Selles tootes column with Vali stays in view */
	.sc-table th.sc-stock-col, .sc-table td.sc-stock-col { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 6px -6px rgba(0, 0, 0, .3); }
	.sc-table tr.sc-recommended td.sc-stock-col { background: #fdeadf; }
}
