/* Üldised stiilid */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;

	/* Teemavärvid */
	--tumehall: #262626;
	--punane: #BF344D;
	--punane2: #D94343;
	--lilla: #D973D2;
	--helehall: #F2F2F2;

	/* Muud olulised värvid */
	--tumepunane: #800000;
	--roheline: #0a8c3f;
	--hall: #666;
	--helesarm: #ddd;
	--peaaegu-valge: #fefefe;
	--valge: #fff;



	/* Kättetoimetamise taustavärvid */
	--kätte-rohekas: #e8f5e9;
	--kätte-sinakas: #e3f2fd;
	--kätte-oranžikas: #fff3e0;
	--kätte-lillakas: #f3e5f5;
}

html {
	color-scheme: light;
}

body {
	min-height: 100dvh;
	font-family: system-ui;
	font-weight: 400;
	margin: 0 max(2px, 2vw);
	line-height: 1.6;
	color: var(--tumehall);
	background-color: #fff;
	padding-block: 136px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 300;
	text-transform: uppercase;
}

h1 {
	font-size: min(7vw, 2rem);
}

button {
	all: unset;
	cursor: pointer;
}

a,
a:visited {
	color: var(--punane);
	text-decoration: none;
}

th a:visited {
	color: var(--helehall);
}

a:hover,
a:focus {
	color: var(--tumepunane);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

button, .button-like, .btn-submit {
	background-blend-mode: difference;
	border: 1px solid var(--punane);
	border-radius: 3vw;
	padding-inline: min(1rem, 2vw);
	padding-block: .5rem;
	font-size: .86rem;
	text-transform: uppercase;
	letter-spacing: 0.073em;
	display: flex;
	place-content: center;
	place-items: center;
	text-align: center;
}

button:hover,
button:focus,
.button-like:hover,
.button-like:focus {
	background-color: var(--punane);
	color: var(--peaaegu-valge);
	filter: brightness(1.1);
}

a.btn-submit, a.btn-submit:visited {
	background: var(--punane2);
	color: var(--peaaegu-valge);
	min-width: 180px;
	text-align: center;
}
.btn-submit:hover {
	border-color: var(--hall);
	filter: brightness(1.1);
}
.btn-save {
	box-sizing: border-box;
}

.back-link {
	width: max-content;
	margin: auto;
}

/* Ostukorv */

#cart {
	position: fixed;
	top: 0;
	right: 0;
	background: #fff;
	box-shadow: 0 0 4px var(--tumehall);
	max-height: 95dvh;
	overflow-y: auto;
	z-index: 1000;
	width: 100vw;
}

.cart-summary {
	color: var(--helehall);
	background: var(--punane2);
	padding-block: 1rem;
	padding-inline: 2vw;
	font-size: 1.1rem;
}

.cart-header-holder {
	display: flex;
	justify-content: end;
	column-gap: 2vw;
	align-items: center;
}

.is-hidden {
	display: none;
	opacity: 0;
	pointer-events: none;
}

#toggle-cart-btn {
	width: min(25vw, 10rem);
	box-sizing: border-box;
	text-align: center;
	height: min-content;
	background: transparent;
	border: 1px solid;
}

.cart-content {
	transition: opacity 0.6s ease, transform 0.6s ease;
	opacity: 1;
	transform: translateY(0);
	padding-block-end: 1rem;
}

.cart-content.is-hidden {
	opacity: 0;
	transform: translateY(-10px);
}

#cart-total-final {
	font-weight: 600;
}

#cart-discount-note {
	font-size: 12px;
	text-align: center;
}

#cart-discount-note-value {
	font-size: 1rem;
	font-weight: 600;
}

.cart-list {
	display: grid;
	column-gap: 3rem;
	row-gap: .8rem;
	grid-template-columns: repeat( auto-fit, minmax(360px, 1fr));
	justify-items: start;
	padding-inline: 2vw;
	margin-block: 1.6rem;
}

.cart-item-thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border: 1px solid var(--helesarm);
	border-radius: 3px;
}
.cart-item {
	display: flex;
	gap: 1rem;
	list-style: none;
	width: max-content;
}
#cart-items p {
	text-align: center;
}
.cart-item-sizes {
	margin-block-start: .4rem;
	display: grid;
	gap: .4rem;
}
.cart-size-row {
	display: flex;
	gap: .4rem;
}
.cart-actions {
	justify-content: end;
	gap: 2vw;
	padding-inline: 2vw;
}

@media screen and (width < 750px) {

	body {
		padding-block-start: 160px;
	}
	.cart-header-holder {
	padding-inline-end: 0;
	flex-flow: wrap;
	justify-content: center;
}

#cart-discount-note {
	order: 4;
	flex: 0 0 100%;
	margin-block-start: 0;
}

}

#clear-cart-btn {
	background-color: var(--helehall);
}
#clear-cart-btn:hover {
	color: var(--punane);
}

/* Esileht */

.index-page {
	text-align: center;
}

.locations-menu {
	display: grid;

	ul {
		display: flex;
		list-style: none;
		gap: 1rem;
		padding: 0;
		justify-content: center;
		text-transform: uppercase;
		flex-flow: wrap;
	}

	li {
		display: grid;
	}
}

.albums-container {
	display: flex;
	justify-content: center;
	flex-flow: wrap;
	gap: 1rem;
}

.album {
	max-width: 330px;
	border: 1px solid var(--helesarm);
}
.album-photo-preview {
    aspect-ratio: 3/2;
    display: flex;
    overflow: hidden;
    justify-content: center;
}


/* Ühised ostukorvis ja fotode valimisel */

.size-options {
	display: flex;
	gap: .9rem;
	margin: .8rem;
	justify-content: space-around;
	flex-flow: wrap;
}

.size-price {
	display: flex;
	justify-content: space-evenly;
	font-weight: 600;
	gap: .5rem;
}
.price {
	color: var(--punane);
}

.quantity-control {
	display: flex;
	justify-content: space-between;
	margin-block-start: .4rem;
}

.qty-btn {
	padding: 0;
	border-radius: 3px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
	width: 28px;
	height: 28px;
	border-color: var(--helesarm);
	font-size: 1.2rem;
	font-family: monospace;
	background-color: var(--helehall);
}

.qty-btn:hover, .qty-btn:focus {
	background-color: var(--helehall);
	color: var(--tumehall);
}

.qty-btn:active {
	background-color: var(--tumehall);
}

/* Album lehel */

.photo-selection-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
	align-content: center;
	gap: 1rem;
}

.photo {
	width: 100%;
	max-width: 500px;
	margin: 20px auto;
	border: 1px solid var(--helesarm);
	text-align: center;
}

.photo h2 {
	margin-top: 0;
	margin-block: .1rem;
	font-size: 1.1rem;
}

.photo-holder {
	aspect-ratio: 3/2;
	overflow: hidden;
}

.photo-img {
	width: 100%;
	height: 100%;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	cursor: zoom-in;
	border-radius: 4px;
	position: relative;
	overflow: hidden;
	transition: background-size 0.5s ease;
	touch-action: none;
}

.photo-img.transitioning {
	transition: background-position .5s ease, background-size 0.5s ease;
}

.photo-img:hover {
	background-size: auto;
}

.photo-bg {
	width: 100%;
	height: 400px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	cursor: zoom-in;
	border: 1px solid var(--helesarm);
	border-radius: 4px;
	position: relative;
	overflow: hidden;
	transition: none;
}

.photo-bg.portrait {
	height: 600px;
}

.photo-bg.zoomed {
	cursor: grab;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	border-radius: 0;
	border: none;
	background-color: rgba(0, 0, 0, 0.2);
	z-index: 1000;
	background-size: contain;
	background-repeat: no-repeat;
}

.photo-bg.zoomed:active {
	cursor: grabbing;
}

.zoom-controls {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background-color: white;
	padding: 10px 20px;
	border-radius: 4px;
	display: none;
	gap: 10px;
	z-index: 1001;
}

.zoom-controls.active {
	display: flex;
}

.zoom-controls button {
	padding: 5px 10px;
	background-color: var(--punane);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.zoom-controls button:hover {
	background-color: var(--punakaspruun);
}

.zoom-info {
	position: fixed;
	top: 20px;
	right: 20px;
	background-color: white;
	padding: 10px 15px;
	border-radius: 4px;
	display: none;
	z-index: 1001;
	font-size: 0.9em;
}

.zoom-info.active {
	display: block;
}

/* Tellimuse esitamine */

.order-page .button-like.back-link {
	margin-inline-end: 0;
	margin-block-start: 1rem;
}


/* Admin paneeli kontaktinfo */
.contact-info-section {
	font-size: 0.9rem;
}

.contact-info-email {
	font-size: 0.9rem;
}

.contact-info-email a {
	color: var(--punane);
	text-decoration: none;
}

.contact-info-phone {
	font-size: 0.9rem;
	color: var(--hall);
}

/* Telimuste tabeli stiilidõ */
.text-center {
	text-align: center;
}

.amount-bold {
	font-weight: 600;
	text-align: center;
}



/* Detailide modal */
.order-details-album {
	margin-bottom: 1rem;
}

.order-details-album-name {
	font-weight: bold;
}

.order-details-sizes-list {
	margin: 0.3rem 0 0 1.25rem;
}

.order-detail-total {
	font-weight: bold;
	color: var(--roheline);
}

/* Admin paneel */
.admin-container {
	width: 100%;
	margin-inline: auto;
}


.admin-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.25rem;
}

.search-box {
	margin-bottom: 1.25rem;
}

.search-box input {
	padding: 0.625rem;
	width: 18.75rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.25rem;
}

.search-box button {
	padding: 0.625rem 1.25rem;
	background: var(--punane2);
	color: white;
	border: none;
	border-radius: 0.25rem;
	cursor: pointer;
}

/* Tabel stiilid */
table {
	width: 100%;
	border-collapse: collapse;
	background: white;
}

thead {
	position: sticky;
	top: 1vh;
	z-index: 1;
	background: var(--punane);
}

th {
	background: var(--punane2);
	color: white;
	padding: 0.75rem;
	text-align: left;
	cursor: pointer;
}

th a {
	color: white;
	text-decoration: none;
}

th a:hover {
	text-decoration: underline;
}

td {
	padding-block: 0.75rem;
	border-bottom: 1px solid var(--helesarm);
	padding-inline: 0.5rem;
	max-height: 31.25rem;
	overflow-y: auto;
}

tr:hover {
	background: var(--peaaegu-valge);
}

.order-id {
	font-weight: bold;
	color: var(--punane);
}

.order-date {
	font-size: 0.9rem;
	color: var(--hall);
}

/* Kättetoimetamise märgendid */
.delivery-pickup,
.delivery-mail,
.delivery-parcel,
.delivery-agreement {
	padding: 0.25rem 0.5rem;
	border-radius: 0.1875rem;
	font-size: 0.9rem;
	display: flex;
	width: 9.375rem;
}

.delivery-pickup {
	background: var(--kätte-rohekas);
}

.delivery-mail {
	background: var(--kätte-oranžikas);
}

.delivery-parcel {
	background: var(--kätte-sinakas);
}

.delivery-agreement {
	background: var(--kätte-lillakas);
}

.details-btn {
	padding: 0.375rem 0.75rem;
	background: var(--punane);
	color: white;
	border: none;
	border-radius: 0.1875rem;
	cursor: pointer;
	font-size: 0.7rem;
}

.details-btn:hover {
	background: var(--punane2);
}

.logout-btn {
	padding: 0.5rem 1rem;
	background: var(--tumehall);
	color: white;
	border: none;
	border-radius: 0.25rem;
	cursor: pointer;
}

.logout-btn:hover {
	color: var(--helehall);
	filter: brightness(1.1);
}

/* Settings button */
a.settings-btn {
	padding: 0.5rem 1rem;
	background: var(--lilla);
	color: white;
	border: none;
	border-radius: 0.25rem;
	cursor: pointer;
	align-items: center;
	gap: 0.375rem;
}

a.settings-btn:hover {
	filter: brightness(1.1);
}

button.settings-btn {
	background: var(--punane2);
	color: var(--valge);
	border-radius: 0.25rem;
	cursor: pointer;
	padding: 0.5rem 1rem;
	border: none;
}

.settings-icon {
	display: inline-block;
	width: 1.125rem;
	height: 1.125rem;
	position: relative;
}

.settings-icon::before {
	content: '';
	display: block;
	width: 100%;
	height: 100%;
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M12 1v6m0 6v6M4.22 4.22l4.24 4.24m5.08 5.08l4.24 4.24M1 12h6m6 0h6M4.22 19.78l4.24-4.24m5.08-5.08l4.24-4.24M19.78 19.78l-4.24-4.24m-5.08-5.08l-4.24-4.24"></path></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

/* Modal stiilidõ */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.4);
}

.modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	background-color: var(--peaaegu-valge);
	padding: 1.25rem;
	border: 1px solid var(--helehall);
	border-radius: 0.5rem;
	width: 96vw;
	box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
	max-height: 86vh;
	overflow-y: auto;
	max-width: 1500px;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.25rem;
	padding-bottom: 0.625rem;
	border-bottom: 2px solid var(--punane);
}

.modal-header h2 {
	margin: 0;
	color: var(--punane);
}

.close-btn {
	font-size: 2rem;
	font-weight: bold;
	cursor: pointer;
	color: var(--punane);
	display: flex;
	justify-content: end;
	border: none;
}

.close-btn:hover {
	color: var(--punana2);
}

.modal-body {
	margin-bottom: 1.25rem;
	display: flex;
	gap: 1rem;
	flex-flow: wrap;
}

.modal-body label {
	display: block;
	margin-block-start: 1rem;
	font-weight: 500;
	color: var(--tumehall);
}

.modal-body input {
	width: 100%;
	padding: 0.625rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.25rem;
	font-size: 1rem;
	margin-top: 0.3125rem;
	box-sizing: border-box;
}

.modal-footer {
	text-align: right;
	gap: 0.625rem;
	display: flex;
	justify-content: flex-end;
}

.modal-footer button {
	padding: 0.625rem 1.25rem;
	border: none;
	border-radius: 0.25rem;
	cursor: pointer;
	font-weight: 500;
}

.modal-footer .btn-save {
	background: var(--punane);
	color: white;
}

.modal-footer .btn-save:hover {
	background: var(--punane2);
}

.modal-footer .btn-cancel {
	background: var(--hall);
	color: var(--helehall);
}

.modal-footer .btn-orange {
	background: var(--oranž);
}

.modal-footer .btn-orange:hover {
	background: var(--tumeranž);
}

.no-orders {
	text-align: center;
	padding: 2.5rem;
	color: var(--hall);
}

/* Tekstiväljad */
.notes-textarea {
	width: 100%;
	min-height: 3.75rem;
	padding: 0.5rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.25rem;
	font-family: Arial, sans-serif;
	font-size: 0.9rem;
	resize: vertical;
}

.notes-textarea:focus {
	outline: none;
	border-color: var(--punane2);
	box-shadow: 0 0 0.3125rem rgba(192, 0, 0, 0.2);
}

.paid-input {
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	width: 4.5rem;
	height: 2rem;
	border: 1px solid var(--tumehall);
	font-size: .9rem;
}
.paid-input-unpaid {
	border-color: var(--punane2);
	border-width: 1px;
}

/* Settings modaali stiilidõ */
.price-section {
	background: var(--helesarm-dark);
	padding: 0.75rem;
	border-radius: 0.25rem;
	border: 1px solid var(--helesarm);
}

.price-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.625rem;
}

.price-table th {
	padding: 0.625rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--helesarm);
	font-size: 0.9rem;
	color: var(--peaaegu-valge);
}

.price-table td {
	padding: 0.625rem;
	border-bottom: 1px solid var(--helesarm);
	text-align: left;
}

.price-table tr:last-child td {
	border-bottom: none;
}

.price-size-col {
	min-width: 6.25rem;
	font-weight: bold;
	color: var(--punane);
}

.price-column {
	min-width: 7.5rem;
	color: var(--punane);
}

.price-column input {
	width: 5rem;
	padding: 0.3125rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.1875rem;
	font-size: 0.9rem;
}

.price-column input:disabled {
	background-color: var(--helesarm-dark);
	color: var(--hall);
	cursor: not-allowed;
}

.price-date {
	font-size: 0.8rem;
	color: var(--hall-light);
	font-weight: normal;
}

.price-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--helesarm);
	gap: 0.625rem;
}

.price-item span:first-child {
	min-width: 5rem;
	font-weight: bold;
}

.price-item input {
	width: 5rem;
	padding: 0.3125rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.1875rem;
}

.price-item span:last-child {
	min-width: 1.25rem;
}

.last-update {
	color: var(--hall);
	font-size: 0.9rem;
	margin: 0 0 0.625rem 0;
}

.no-prices {
	color: var(--hall-light);
	margin: 0;
}

/* Asukohtade tabel */


.locations-table th {
	padding: 0.625rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--helesarm);
	font-size: 0.9rem;
}

.locations-table td {
	padding: 0.625rem;
	border-bottom: 1px solid var(--helesarm);
	text-align: left;
}

.locations-table tr:last-child td {
	border-bottom: none;
}

.locations-table ul {
	font-size: 0.9rem;
	color: var(--tumehall);
}

.password-section {
	background: var(--peaaegu-valge);
	padding: 0.75rem;
	border-radius: 0.25rem;
	border: 1px solid var(--sinekas-2);
}

.password-section label {
	display: block;
	margin-top: 0.625rem;
}

.password-section label:first-child {
	margin-top: 0;
}

/* Settings grid */
.settings-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.9375rem;
}

.settings-grid-2 label {
	display: block;
	margin-bottom: 0.3125rem;
	font-weight: 500;
	color: var(--tumehall);
}

.settings-grid-2 input {
	width: 100%;
	padding: 0.625rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.25rem;
	font-size: 1rem;
	box-sizing: border-box;
}

/* Header nupud */
.header-actions {
	display: flex;
	gap: 1rem;
	text-transform: uppercase;
	font-size: .9rem;
}

a.header-action-btn {
	background: green;
	margin-inline-end: 0;
	color: var(--helehall);
	border-radius: 0.25rem;
	padding: 0.5rem 1rem;
}
a.header-action-btn:hover {
	filter: brightness(1.1);
}

.section-label {
	margin-top: 1.25rem;
	padding-top: 0.9375rem;
	display: block;
}

/* Otsinguvorm */
.search-form {
	display: flex;
	gap: 0.625rem;
}

.search-reset-link {
	padding: 0.625rem 0.9375rem;
	border: 1px solid var(--helesarm);
	border-radius: 0.25rem;
}

/* Settings sektsioonid */
.settings-section {
	margin-bottom: 1.5625rem;
	flex-grow: 1;
}

.settings-section-title {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--punane);
	margin-bottom: 0.9375rem;
	padding-bottom: 0.625rem;
	border-bottom: 2px solid var(--punane);
}
.settings-section thead {
	position: initial;
}

.settings-section-content {
	background: var(--helehall);
	padding: 0.9375rem;
	border-radius: 0.25rem;
	border: 1px solid var(--helesarm);
	min-height: 350px;
}
.settings-section-content.settings-albums-list {
	display: flex;
	gap: 1rem;
}
#new-album-location {
	display: flex;
	width: 100%;
	height: fit-content;
	min-height: 2.4rem;
	border-radius: 6px;
	border: 1px solid var(--helesarm);
	padding: .4rem;
}

input[type="checkbox"] {
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid #666;
  border-radius: 4px;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background-color: var(--roheline); 
  border-color: var(--helesarm);
}
input[type="checkbox"]:checked::after {
	content: "✔";
	color: var(--peaaegu-valge);
	font-size: 1rem;
	position: relative;
	left: -.4rem;
	top: -.7rem;
}
input[type="checkbox"].done-checkbox {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 2rem;
	width: 2rem;
	border: 1px solid var(--hall);
	margin: auto;
}

input[type="checkbox"].done-checkbox:checked::after {
	font-size: 1.4rem;
	left: 0;
	top: -.1rem;
}

#detailsModal .modal-content {
	width: max-content;
}

.client-notes {
	font-size: .86rem;
	color: var(--hall);
}

