* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  scroll-behavior: smooth;
}

body {
  font-family: "Hind Siliguri", sans-serif;
  font-weight: 300;
  background: #eee url("../images/m05_spiral.jpg") center/cover no-repeat fixed;
  height: 100vh; 
}

#cookie-info {
  background-color: #f5f5f5;
  padding: 15px;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 9999;
  text-align: center;
  display: none;
  box-sizing: border-box;
}

#cookie-info .button {
  margin-top: 15px;
}

#header {
  color: white;
  min-height: 60px;
  justify-content: center;
  align-items: center;
  background: #222 url("../images/carbon.jpg");
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.2);
  color: white;
  font-size: 1.4em;
  position: relative;
}

#mobilemenu {
  background: #222 url("../images/carbon.jpg");
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 999;
  cursor: pointer;
}

.visible {
  transform: translateY(0) !important;
}

.logo {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: white;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: 30px;
  padding-top: 15px;
}

.highlight {
  color: #135ab6;
}

.gray {
  opacity: 0.5;
  filter: grayscale(100%);
}

#newsarea {
  text-align: center;
  background: #135ab6;
}

#newsarea div {
  padding: 10px;
}

#newsarea a:link, #newsarea a:visited {
  color: white;
}

#newsarea div:hover {
  background: white;
  color: #135ab6;
}

.newspreviewimage {
  max-width: 200px;
  overflow: hidden;
}

.bannerarea {
  background-color: #28A745;
  color: white;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bannertext {
  background: rgba(0,0,0,0.6);
  padding: 2%;
  width: 50%;
  box-sizing: border-box;
  border-radius: 5px;
}

.bannertext h1, .bannertext h2, .bannertext h3, .bannertext h4, .bannertext h5, .bannertext h6 {
  margin-bottom: 10px;
  color: white;
}

.productarea {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Säädä minimiarvo tarpeen mukaan */
  gap: 10px; /* Väli tuotteiden välillä */
  padding: 10px;
  background-color: #fff;
  background: linear-gradient(#fff, #ddd);
  justify-content: space-between;
}

.alltwelve {
  grid-column: span 12; /* Leveydeltään täysi rivi */
}

.productareaheader, .allproductslink {
  grid-column: span 12; /* Leveydeltään täysi rivi */
  text-align: center;
  padding: 2%;
  color: #888;
}

.productareaheader {
  background: #fff;
}

.allproductslink {
  background: #ddd;
  padding: 1%;
}

.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Jakaa tilan kuvan ja tekstien välillä */
  height: 100%; /* Varmistaa, että tuote täyttää käytettävissä olevan korkeuden */
  background-color: #fff;
  color: #333;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  box-sizing: border-box; /* Sisältää paddingin tuotteen mittoihin */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  line-height: 1em;
  min-height: 260px;
}

.product.discount::before {
  content: 'Tarjous';
  position: absolute;
  top: 10px;
  right: -30px; /* Sijoita nauha hieman ulkopuolelle kulman saamiseksi */
  background: #FFC107; /* Keltainen väri */
  color: #fff;
  padding: 5px 30px;
  font-size: 14px;
  font-weight: bold;
  transform: rotate(45deg); /* Kallistaa nauhan */
  z-index: 1; /* Varmistaa, että nauha näkyy tuotteen päällä */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Lisää varjon */
}

.product.finished::before {
  content: 'Loppu';
  position: absolute;
  top: 8px;
  right: -28px; /* Sijoita nauha hieman ulkopuolelle kulman saamiseksi */
  background: #aaa;
  color: #fff;
  padding: 5px 30px;
  font-size: 14px;
  font-weight: bold;
  transform: rotate(45deg); /* Kallistaa nauhan */
  z-index: 2; /* Varmistaa, että nauha näkyy tuotteen päällä */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Lisää varjon */
}

.product.hidden::before {
  content: 'Piilotettu';
  position: absolute;
  top: 8px;
  right: -36px; /* Sijoita nauha hieman ulkopuolelle kulman saamiseksi */
  background: black;
  color: #fff;
  padding: 5px 30px;
  font-size: 14px;
  font-weight: bold;
  transform: rotate(45deg); /* Kallistaa nauhan */
  z-index: 3; /* Varmistaa, että nauha näkyy tuotteen päällä */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Lisää varjon */
}

.product:hover {
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.product .image {
  justify-content: top;
  align-items: center;
  height: 100%;
  margin-bottom: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  min-height: 200px;
}

.product img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
  border-radius: 5px;
}

.product .name {
  padding-top: 15px;
  font-weight: bold;
  padding-bottom: 5px;
}

.product .name, .product .price, .product .amount {
  margin-top: 1px;
}

.product .amount {
  padding-top: 5px;
  font-size: 8pt;
}

#footer {
  color: white;
  min-height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #222 url("../images/carbon.jpg");
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.2);
  font-size: 10pt;
  padding: 2%;
}

#footer a:link, #footer a:visited, #footer a:hover {
  color: white;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Russo One", sans-serif;
  font-weight: 700;
  margin-top: 0;
  padding-top: 0;
  color: #333;
  text-transform: uppercase;
  margin-bottom: 15px;
}

a:link, a:hover, a:visited {
  text-decoration: none;
  color: #333;
}

#menuicon {
  height: 40px;
  cursor: pointer;
  margin-right: 30px;
  position: absolute;
  top: 10px;
  right: 0px;
}

#shopicon img {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
}

#shopicon {
  width: 40px;
  height: 40px;
  cursor: pointer;
  position: relative;
  position: absolute;
  top: 10px;
  right: 100px;
}

.cart-count {
  position: absolute;
  top: -5px;
  left: 25px;
  background-color: #135ab6;
  border: 2px solid white;
  color: white;
  border-radius: 50%;
  padding: 3px 10px;
  font-size: 14px;
  font-weight: bold;
  display: none; /* Piilotetaan, kun ostoskori on tyhjä */
}

.empty {
  opacity: 0.2;
}

.mobilemenuitem {
  width: 100%;
  padding: 1%;
  box-sizing: border-box;
  text-align: center;
  z-index: 50;
  color: white;
  font-weight: bold;
  border-bottom: 1px solid #333;
  border-top: 1px solid #333;
}

.mobilemenuitem:hover {
  background: rgba(200,200,200,0.3);
}

p {
  margin-bottom: 15px;
}

.smallbutton {
  color: white;
  background: #135ab6;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border: 0px;
  border-radius: 5px 5px 5px 5px;
  margin: 1px;
  padding: 3px 10px 3px 10px;
  box-sizing: border-box;
  border: 1px solid #fff;
  display: inline-block;
  font-size: 10pt;
}

.smallbutton:hover {
  background: #2b78dc;
}

.deletebutton {
  color: white;
  background: #ff3333;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border: 0px;
  border-radius: 5px 5px 5px 5px;
  margin: 1px;
  padding: 3px 10px 3px 10px;
  box-sizing: border-box;
  border: 1px solid #fff;
  display: inline-block;
  font-size: 10pt;  
}

.deletebutton:hover {
  background: #ff6666;
}

button, .button {
  color: white;
  background: #135ab6;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border: 0px;
  border-radius: 5px 5px 5px 5px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.button, .disabledbutton {
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border: 0px;
  border-radius: 5px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  font-size: 12pt;
  font-family: "Hind Siliguri", sans-serif;
}

.ui-dialog-buttonpane {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
}

.ui-dialog-buttonset {
  display: flex;
  gap: 10px;
  width: 100%;
}

.ui-dialog-buttonset button {
  background: #135ab6;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 12pt;
  font-family: "Hind Siliguri", sans-serif;
  cursor: pointer;
  width: 50%;
  margin: 0;
  box-sizing: border-box;
}

.disabledbutton {
  background-color: #888 !important;
  color: #666 !important;
  cursor: not-allowed !important;
}

form > button {
  margin-top: 20px;
}

.button:hover {
  background: #2b78dc;
}

/* GENERAL PAGE */

#pagecontent {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 4fr 1fr;
}

#pagecontent h1 {
  padding-top: 10px;
  padding-bottom: 10px;
  text-align: center;
}

#pagecontent img {
  max-width: 100%;
}

.center {
  text-align: center;
}

.left {
  text-align: left;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

th {
  background: #333;
  color: white;
}

td {
  border-bottom: 1px solid #333;
  vertical-align: top;
}

td:first-child {
  padding-left: 10px;
}

.orderrow:hover {
  background: #135ab6;
  color: white;
}

.square {
  width: 15px;
  height: 15px;
  border: 2px solid #333;
  float: left;
  margin-right: 15px;
  margin-top: 7px;
  border-radius: 3px;
}

.peruttu {background: red;}
.tilattu {background: yellow;}
.maksettu {background: green;}
.lähetetty, .luovutettu {background: rgb(0,100,255);}

#chart, #page-views-chart {z-index: 1;}

.paddingleftandright {
  padding-left: 10px;
  padding-right: 10px;
}

.paddingtop {
  padding-top: 30px;
}

.paddingbottom {
  padding-bottom: 30px;
}

.whitepage {
  background: #fff;
  padding: 4%;
  box-sizing: border-box;
  min-height: 100vh; 
}

/* PRODUCT PAGE */

#content {
  width: 60%;
  margin-left: 20%;

  margin-top: 30px;
  box-sizing: border-box;
  padding-bottom: 30px;

  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

#productfacts {
  grid-column: span 3;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  width: 100%;
  box-sizing: border-box;
  padding: 4% 4% 0;
  background: #fff;
  border: 10px #e5dba2 solid;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

#productfactsimage {
  margin-bottom: 30px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

#productfactstext {
  margin-bottom: 30px;
  text-align: center;
  box-sizing: border-box;
}

#productfacts .addtocart {
  margin-top: 30px;
}

/* Kuva-alueen tyylit */

.image {
  width: 100%;
  background-color: #fff;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 10px;
}

.productarea .image img {
  width: 90%;
  margin-left: 5%;
}

#imagecontent {
  grid-template-columns: 1fr;

  align-items: start;
  background-color: #222;
  border: 10px solid #444;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  padding: 5%;
  box-sizing: border-box;
  color: white;
}

#imagecontent h3, #textcontent h3 {
  padding-bottom: 15px;
  color: white;
}

#imagecontent .image:hover, #productfacts .image:hover {
  cursor: zoom-in;
}

.image:hover img {
  transform: scale(1.2);
}

.image2 {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.image img {
  width: 100%;
  transition: transform 0.3s ease;
}

.lb-image {
  width: 80vw;
  height: 80vw;
  max-width: 600px;
  max-height: 600px;
  object-fit: cover;
}

textarea {
  resize: none;
  overflow: hidden;
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
  border: 0;
  font-family: "Hind Siliguri", sans-serif;
  font-size: 12pt;
}

#tuotekooste {
  color: #000;
  background: #fff;
}

#tuotekuvaus {
  color: #fff;
  background: #222;
}

#textcontent {
  box-sizing: border-box;
  padding: 3%;
  background: #222;
  color: white;
  border: 10px solid #444;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  align-items: start;  
}

#textcontent p, #textcontent ul {
  margin-bottom: 15px;
}

#textcontent ul {
  list-style-image: url('../images/bullet.png');  
}

#textcontent li {
  list-style-type: square;
  margin-left: 20px;
  padding-left: 10px;
}

/* Popup */

/* Popup-tyylit */
#popup, #confirmpopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 98;
}

#popup-content, #confirmpopup-content {
  background: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
}

#message {
  display: none;
}

/* Modalin tyyli */
.modal {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.5); 
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-content {
  position: fixed; /* tärkeä: pitää siirron näkyvissä */
  top: 100px;       /* määritä alkuarvot – ei `margin`! */
  left: 50%;
  transform: translateX(-50%); /* vain vaakasuuntaan keskitys */
  margin: 0;
  background-color: #fff;
  padding: 20px;
  border: 1px solid #888;
  width: 600px; 
  text-align: center;
  box-sizing: border-box;
}

.modal-content input {
  min-width: 80%;
  text-align: center;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Ostoskorityylit */
#productlist {
  display: grid;
  grid-template-columns: 1fr 10fr 1fr;
  margin-bottom: 15px;
}

.shoppingcartproduct {
  text-align: center;
  border: 1px solid #ccc;
  padding: 2%;
  box-sizing: border-box;
  margin-bottom: 10px;
  grid-column: span 10;
  position: relative;
  min-height: 150px;
}

.shoppingcartproduct h3 {
  padding-bottom: 10px;
}

.shoppingcartimage {
  position: absolute;
  left: 10px;
  top: 40px;
  width: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;  
  overflow: hidden;
}

.shoppingcartimage img {
  width: 100%;
}

.noselect {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.plus, .minus {
  width: 80px;
  color: white;
  text-align: center;
  margin-bottom: 10px;
  font-size: 3em;
  font-weight: bold;
  padding-top: 15px;
}

.minus {
  background: red;
  border-radius: 20px 0px 0px 20px;
}

.minus:hover {
  cursor: pointer;
  background: rgb(200,0,0);
}

.plus {
  background: green;
  border-radius: 0px 20px 20px 0px;
}

.plus:hover {
  cursor: pointer;
  background: rgb(0,200,0);
}

.clearsshoppingcart {
  cursor: pointer;
  grid-column: span 12;
}

#payerinfoform {
  grid-column: span 12;
}

#payerinfo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 2%;
  border: 1px solid #ccc;
  margin-bottom: 15px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: #eee;
}

#payerinfo label {
  box-sizing: border-box;
  display: block;
  margin-right: 20px;
  font-weight: bold;
}

#payerinfo div {
  border-bottom: 1px solid #ddd;
}

#payerinfo input {
  border: 1px solid #ddd;
}

#payerinfo input[type="text"], #payerinfo input[type="email"], #payerinfo input[type="tel"], #payerinfo select {
  width: 100%;
  box-sizing: border-box;
  border-top: 0px;
  border-left: 0px;
  border-right: 0px;
  padding: 8px;
  border-radius: 3px;
  position: relative;
  top: 0px;
}

#payerinfo input[type="radio"] {
  padding-top: 5px;
}

#shipmentmethod, #paymentmethod {
  position: relative;
  padding-top: 5px;
}

#submitOrderButton {
  grid-column: span 2;
  border: 2px solid #fff;
}

#pagetextarea {
  background: white;
  width: 100%;
  padding: 20px 2%;
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.2);
  padding-bottom: 100px;
}

/* Hallinta */

.tilaus {
  background: #eee;
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  padding: 30px;
  display: inline-block;
}

.order-products {
  min-width: 600px;
}

.changeshowonfrontpage, .changeproductvisibility {
  cursor: pointer;
}

.graybg {
  background: #ddd;
}

.imagebuttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  gap: 3px;
  box-sizing: border-box;
}

.imagebuttons button {
  flex: 1 0 20%;
  box-sizing: border-box;
  text-align: center;
}

#new-dialog {
  width: 400px;
  text-align: center;
}

#new-dialog input, #new-dialog select {
  width: 100%;
  text-align: center;
}

.order-products, .order-payments {
  text-align: left;
}

.order-products th, .order-products td, .order-payments th, .order-payments td {
  padding-left: 3px;
  padding-right: 3px;
}

.order-products th:first-child, .order-products td:first-child {
  text-align: center;
}

.order-products button, .order-payments button {
  margin-top: 4px;
  padding: 4px 8px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background-color: #0056cc;
  color: white;
  cursor: pointer;
}

.order-products td.actions, .order-payments td.actions {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.inventoryrow:hover, .graybg:hover {
  background-color: #0056cc;
  color: white;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.form-row label {
  width: 150px;
  text-align: right;
  font-weight: bold;
}

.form-row input,
.form-row select {
  flex: 1;
  padding: 4px 8px;
}

/* RESPONSIVE STYLES */

@media only screen and (min-width: 900px) and (max-width: 1200px) {
  .bannertext {
    width: 70%;
  }
}

@media only screen and (max-width: 899px) {
  .bannertext {
    width: 90%;
  }
  .mobilemenuitem {
    padding: 2%;
  }
  #content {
    width: 100%;
    margin: 0;
    margin-top: 30px;
    grid-template-columns: 1fr;
    display: block;
  }
  #productfacts h1, #productfacts h2, #productfacts h3, #productfacts h4, #productfacts h5, #productfacts h6 {
    font-size: 95%;
  }
  #productfacts {
    grid-template-columns: 1fr;
    overflow: hidden;
    position: relative;
    max-width: 100%;
  }
  #productfactsimage {
    width: 70%;
    margin: 0 auto;
  }
  #productfactstext {
    max-width: 100%;
  }
  #imagecontent .headertext, .addimage {
    grid-column: span 2;
  }
  #image-gallery {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr 1fr;
  }
  #image-gallery img {
    aspect-ratio: 1 / 1;
  }
  #textcontent {
    margin-top: 15px;
  }
  #pagecontent {
    grid-template-columns: 1fr;
  }
  .whitepage {
    padding: 2%;
  }
  .noshow {
    display: none;
  }
  #payerinfo {
    display: grid;
    grid-template-columns: 1fr;
  }
  .shoppingcartimage {
    display: none;
  }
  .productarea {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}