html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

:root {
  --body-background-color: #ffffff;
  --main-theme-color: #0070a0;
  --main-text-color: #ffffff;
  --secondary-theme-color: #79a9d1;
  --secondary-text-color: #ffffff;
  --button-color: #dbd39b;
  --button-text-color: #000000;
  --link-color: #003333;
}

#CCartLayout header,
#CCartLayout nav,
#CartContainer {
  padding-left: calc((100% - 1200px) / 2);
  padding-right: calc((100% - 1200px) / 2);
}

#CCartLayout {
  width: 100%;

  header {
    background: var(--main-theme-color);
    text-align: center;
    padding: 30px 0;

    img { max-width: 80%; }
  }

  h1 {
    font-size: 40px;
    font-weight: normal;
    margin: 0;

    a { color: var(--main-text-color); }
    a:hover { text-decoration: underline; }
  }

  nav {
    display: block;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 2;

    a {
      font-size: 20px;
      color: #fff;
      display: inline-block;
      text-align: center;
      padding: 8px 12px;
      margin: 8px;
      transition: background-color 0.4s ease;

      &:hover {
        text-decoration: none;
        background: #666;
      }
    }
    
    img { height: 20px; }
  }

  main#CartContainer { padding: 10px calc((100% - 1200px) / 2); }
}

#CartContainer {
  margin: 0;
  padding: 0;

  td, th { padding: 10px; }
  label { display: inline; }
}

body {
  font-family: Roboto, Helvetica, sans-serif;
  font-size: 16px;
  color: #000;
  margin: 0;
  background: var(--body-background-color);
}

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

a:hover,
a:active {
  text-decoration: underline;
  color: var(--link-color);
}

.CCatalog_shoppath {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 10px;
  line-height: 35px;

  a {
    padding: 4px 8px;
    background: #999;
    color: #fff;
    white-space: nowrap;
  }
}

a.CCatalog_next,
a.CCatalog_prev {
  display: inline-block;
  color: #000;
  background: #ccc;
  padding: 4px 8px;
  margin-top: 5px;
  margin-bottom: 5px;
}

a.CCatalog_prev {
  margin-right: 5px;
}

a.CCatalog_prev::before,
a.CCatalog_next::after {
  color: #000;
  font-weight: bold;
}

a.CCatalog_prev::before {
  content: '< ';
}

a.CCatalog_next::after {
  content: ' >'
}

.CMain_error {
  font-size: 16px;
  color: #00f;
}

.error {
  color: #00f;
  margin: 10px;
  font-weight: bold;
}

.CProduct {
  position: relative;
  background: #eee;
  width: 100%;
  margin-top: 10px;
  border: 1px solid #999;
  padding: 10px;

  &::after {
    content: ' ';
    display: block;
    clear: both;
  }

  & > h2 {
    padding: 10px;
    color: var(--secondary-text-color);
    background: var(--secondary-theme-color);
    margin-top: -10px;
    margin-left: -10px;
    margin-right: -10px;
    margin-bottom: 10px;
    font-size: 21px;
    font-weight: normal;

    * { color: var(--secondary-text-color); }
  }
}

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

.thumb_selected, .thumb_unsel {
  margin-right: 8px;

  img {
    max-width: 100px;
    max-height: 100px;
  }
}

.thumb_selected img {
  border: 2px solid #009;
}

.thumb_unsel img {
  border: none;
}

.CProductDetails_price {
  font-size: 18px;
  margin-top: 10px;
}

.CProductDetails_sprice {
  color: #f00;
}

.CProductDetails_oo {
  font-size: 14px;
}

.CProductDetails_img {
  float: left;
  max-width: 61.8%;
  margin-right: 10px;
}

table.CTFull {
  width: 100%;
}

table.CCart_table {
  border-collapse: collapse;
  border: 1px solid #aaa;
  background: #fff;

  th, td { border: 1px solid #aaa; }

  th {
    color: var(--main-text-color);
    background: var(--main-theme-color);
    width: 190px;
    font-size: 16px;
    font-weight: normal;
    text-align: left;
    border: none;
  }

  th + td {
    color: #000;
    background: #fff;
    border: none;
  }

  & > tbody:first-child > tr:first-child th {
    color: var(--secondary-text-color);
    background: var(--secondary-theme-color);
    font-weight: bold;
    width: auto;
    border: 1px solid #aaa;
  }
}

tr.CCart_tfoot td {
  border-top: 3px solid #aaa;
}

tr.CCart_product td {
  background: #ddd;
}

.CCenter,
table.CCart_table td.CCenter,
table.CCart_table th.CCenter {
  text-align: center;
}

.CRight {
  text-align: right;
}

.CCart_smallnote {
  font-size: 13px;
  color: #666;

  &::after {
    display: block;
    content: ' ';
    clear: left;
  }
}

.CCart_oo {
  font-size: 11px;
  background: #eee;
}

.CCart_totals {
  background: #eee;
  font-weight: bold;
}

.CCart_Total {
  background: #eee;
  font-weight: bold;
}

.CCart_disclaimer {
  font-weight: bold;
}

.CSearch_value {
  background: #eee;
}

.CReview_reply {
  display: inline-block;
  background: #ccc;
  padding: 30px;

  strong {
    display: block;
    font-size: 20px;
    font-weight: normal;
  }
}

table.CCart_table td.CReceipt_personal {
  background: #eee;

  table {
    width: 100%;
    border-collapse: collapse;
  }
}

.CReceipt_thankyou {
  font-weight: bold;
}

p.heading {
  font-size: 19px;
}

.category_list {
  font-size: 19px;
  font-weight: bold;
}

.CCatalog_cathead {
  font-size: 25px;
  line-height: 1.3em;
  margin-top: 20px;
  border-bottom: 1px solid #aaa;
}

.CCatalog_tilecontainer {
  margin-top: 10px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 10px;
}

.CCatalog_product_tile,
.CCatalog_category_tile {
  background: #fff;
  padding: 10px;
  text-align: center;
  border: 1px solid #ddd;
  line-height: 1.5em;

  img {
    max-width: 100%;
    margin-bottom: 5px;
  }
}

.CCatalog_category_tile {
  background: #eee;
  grid-column: span 2;

  a { font-size: 22px; }
}

.CCatalog_product_tile {
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: min-content auto auto min-content;
  grid-gap: 20px;
}

.CPrice {
  font-size: 26px;
  align-self: end;
}

input[type="text"], input[type="number"], input[type="tel"], input[type="url"], input[type="email"], input[type="password"],
input[type="search"], select, textarea {
  border: 1px solid #999;
  font-family: Roboto, Helvetica, sans-serif;
  font-size: 14px;
  padding: 5px;
  border-radius: 4px;
  height: 40px;
  background: #f8f8f8;
  width: 100%;
  max-width: 200px;
}

textarea {
  height: 64px;
}

input, select {
  &.CInput_tiny { max-width: 50px; }
  &.CInput_short { max-width: 120px; }
}

input, select, textarea {
  &.CInput_bigger { max-width: 300px; }
  &.CInput_long { max-width: 100%; }
}

#CartContainer input[type="tel"] {
  &.cc-valid { background: #cfc; }
  &.cc-invalid { background: #f99; }
}

button, input[type="button"], input[type="submit"] {
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: var(--button-color);
  color: var(--button-text-color);
  padding: 5px 8px;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s ease;

  &:hover { box-shadow: 0 4px 2px rgba(0, 0, 0, 0.5); }

  &:focus {
    outline: 0;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  }
}

a.keyword {
  display: inline-block;
  background: #eee;
  padding: 6px 12px;
  margin: 6px;
}

.twocol {
  width: 100%;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
}

a.logo-link {
  width: 200px;
  display: block;
  margin: 40px auto 0;

  img { max-width: 100%; }
}

.CBig_message {
  width: 100%;
  text-align: center;
  font-size: 50px;
  font-weight: normal;
  padding: 40px 0;
}

table#view-cart {
  margin: 0 auto;
}

tr.CCart_product td:first-child img {
  display: block;
  float: left;
  max-width: 150px;
  max-height: 150px;
  margin-right: 10px;
}

.CStars {
  align-self: end;
}

.CStars img { 
  width: 26px;

  &[onclick] {
    cursor: pointer;
    
    &:hover { filter: drop-shadow(0px 0px 10px #ff0); }
  }
}

#cookie-warning {
  z-index: 100000;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #000c;
  color: #eee;
  padding: 15px;
  text-align: center;

  p {
    display: inline;
    padding-right: 15px;
  }
}

p {
  line-height: 1.5em;
}

.yesmobi {
  display: none !important;
}

@media (max-width: 1200px) {
  #CCartLayout,
  #CCartLayout header,
  #CCartLayout nav {
    padding-left: 0;
    padding-right: 0;
  }

  #CCartLayout main#CartContainer {
    padding: 10px;
  }
  
  .CCatalog_category_tile {
    grid-column: span 3;
  }
  
  .CCatalog_tilecontainer {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .CCatalog_category_tile {
    grid-column: span 2;
  }

  .CCatalog_tilecontainer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .twocol {
    width: 100%;
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
  }

  .CBig_message {
    font-size: 35px;
  }
}

@media (max-width: 600px) {
  .nomobi {
    display: none !important;
  } 

  .yesmobi {
    display: initial !important;
  }

  #CCartLayout nav {
    a {
      font-size: 18px;
      padding: 8px;
      margin: 8px 4px; 
    }

    img { height: 18px; }
  }
  
  .CCatalog_category_tile {
    grid-column: 1;
  }

  .CCatalog_tilecontainer {
    grid-template-columns: 1fr;
  }

  table#view-cart,
  table.CForm_table {
    width: 100%;
  }

  table#view-cart tr {
    &:first-child { display: none; }
    &.CCart_product { border-bottom: 1px solid #aaa; }
    td {
      display: block;
      border: none;

      &::before {
        display: block;
        font-weight: bold;
      }

      &.CCart_Total { text-align: center; }
      &.CCart_oo { border-bottom: 1px solid #aaa; }
    }
    
    &.CCart_tfoot td.CCart_Total:nth-child(2) { border-top: 1px solid #aaa; }
  }

  table.CForm_table {
    th, td {
      width: 100%;
      display: block;
    }

    th {
      color: #000;
      background: #fff;
      font-weight: bold;
      padding-bottom: 0;
    }
  } 
  
  table.CCart_table td.CReceipt_personal table td {
    display: block;
    margin-top: 10px;
  }

  .CProductDetails_oo,
  .CProductDetails_oo strong {
    clear: left;
    display: block;
  }
}
