/* Styling For Web Store
   ===================== */


/* Class for displaying List of Products */

div.product-view-block {
  margin: 0;
  padding: var(--content-verticalpad) var(--navi-bar-sidepad);
  background: var(--product-view-block-background);
}

ol.products.list-view {
  display: flex;
  flex-direction: column;
  list-style-type: none;
  padding: 0;
}

ol.products.grid-view {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  list-style-type: none;
  padding: 0;
}

ol.products > li {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  align-items: flex-start;
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--navi-bar-border-color);
  border-radius: var(--navi-bar-border-radius);
  margin: var(--product-view-li-margin);
}

ol.products {
  margin: calc(0px - var(--product-view-li-margin));
}

ol.products.grid-view > li {
  flex-direction: column;
  align-items: stretch;
  min-width: var(--product-view-li-grid-min-width);
}

ol.products.list-view > li {
  flex-direction: row;
  align-items: stretch;
}

ol.products > li .product-image {
  flex: 1;
  display: block;
}

ol.products > li .product-image img {
  background: var(--product-view-img-background);
  object-fit: contain;
  width: 100%;
  display: block;
}

ol.products.grid-view > li .product-image {
  position: relative;
  padding-top: 100%;
  height: 0px;
}

ol.products.grid-view > li .product-image img {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
}

ol.products > li .product-content {
  flex: 3;
  padding: 1em;
  box-sizing: border-box;
}

ol.products > li .product-content .product-name {
  font-size: 1.25em;
  font-weight: 600; 
}

ol.products > li .product-content .product-price {
  font-size: 1.125em;
  font-weight: 500;
}

ol.products > li .product-content .product-summary {
  margin: 1em 0;
}

ol.products > li .product-content .availability,
ol.products > li .product-content button,
ol.products > li .product-content .button {
  display: block;
  margin-top: 1em;
}

ol.products > li .product-content .availability {
  font-weight: 500;
}


/* Overview Layout For Web Store */

.overview {
  display: flex;
  flex-direction: column;
  padding: 2.5% var(--navi-bar-sidepad);
}


.overview-slideshow {
  display: inline-block;
  min-width: 0;
  flex: 40;
  margin: 0;
}


.overview-information {
  display: inline-block;
  flex: 60;
}




/* Layout for remaining sections in webstore page */

.webstore-section {
  width: 100%;
  padding: 2.5% var(--navi-bar-sidepad);
  box-sizing: border-box;
  border-top: 1px solid #ddd;
}

.webstore-section.limit-width {
  padding-right: max(2.5%, calc(100% - 800px));
}



/* Overview Image Slideshow */

.overview-image {
  position: relative;
  height: 50vh;
  min-height: 320px;
}

.overview-image > img {
  position: absolute;
  object-fit: contain;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.overview-image > .spin-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}


.overview-scroll-container {
  overflow-x: auto;
}

.overview-scroll-container > ul {
  padding: 0;
  list-style-type: none;
  display: table;
  border-spacing: 0.5em;
  margin: 1em -0.3125em; /* border-spacing - box-shadow = 0.5em - 0.125em - 0.0625em = 0.3125em */
}

.overview-scroll-container > ul li {
  display: table-cell;
  vertical-align: middle;
  margin: 1em;
  box-sizing: border-box;
}

.overview-scroll-container > ul li.selected img {
  width: var(--overview-slideshow-thumbnail-width-selected);
  height: var(--overview-slideshow-thumbnail-height-selected);
  border: var(--overview-slideshow-thumbnail-border-thickness-selected) solid var(--overview-slideshow-thumbnail-border-color-selected);
  box-shadow: 0 0 var(--input-shadow-size-focus) 0 var(--overview-slideshow-thumbnail-border-color-selected);
}

.overview-scroll-container > ul li img {
  object-fit: contain;
  width: var(--overview-slideshow-thumbnail-width);
  height: var(--overview-slideshow-thumbnail-height);
  box-shadow: 0.125em 0.125em 0.125em #fafafa; /* box-shadow = 0.125em */
  border: var(--overview-slideshow-thumbnail-border-thickness) solid #ddd;
  border-radius: var(--overview-slideshow-thumbnail-border-radius);
  cursor: pointer;
  transition: box-shadow var(--input-transition-time) var(--input-transition-effect),
              width var(--input-transition-time) var(--input-transition-effect),
              border var(--input-transition-time) var(--input-transition-effect);
  box-sizing: border-box;
}





/* Overview Header Styles */


.overview-header { margin: 1em 0; }

.overview-header h1 {
  margin: 0.25em 0;
}

.overview-header h2 {
  font-weight: 500;
  color: #333;
}


.edition {
  color: #888;
  font-style: italic;
}




/* Styling for displaying a list of authors */


ul.authors {
  list-style-type: none;
  margin: 1em 0;
  padding: 0;
}


ul.authors li { display: inline; }
ul.authors li::after { content: ','; }
ul.authors li:first-child::before { content: 'by '; }
ul.authors li:nth-last-child(2)::after { content: ', & '; }
ul.authors li:last-child::after { content: none; }





/* Styling for 5-star rating */


.rating {
  unicode-bidi: bidi-override;
  direction: rtl;
  display: inline-block;
}


.rating > span {
  display: inline-block;
  position: relative;
  width: 1em;
  color: rgb(254,187,48);
}


.one-star.rating > .star1::before,
.two-star.rating > .star2::before,
.two-star.rating > .star2 ~ span::before,
.three-star.rating > .star3::before,
.three-star.rating > .star3 ~ span::before,
.four-star.rating > .star4::before,
.four-star.rating > .star4 ~ span::before,
.five-star.rating > .star5::before,
.five-star.rating > .star5 ~ span::before {
  position: absolute;
  content: "\2605";
}


.customer-star-label {
  font-size: 0.75em;
}





/* Category Bar */


ol.category-bar {
  list-style-type: none;
  border: 1px solid #eee;
  padding: 0.5em calc(1em + 1%);
  margin: 0;
}


ol.category-bar li {
  display: inline-block;
  font-size: 0.75em;
}


ol.category-bar li a {
  display: inline-block;
  background: #eee;
  padding: 0.35em 0.5em; 
  margin: 0.25em;
}





/* Product Details */

.product-info {
  list-style-type: none;
  padding: 0;
}


.product-property {
  font-weight: bold;
}





/* Editorial & Customer Reviews */

.editorial-reviews, .customer-reviews {
  margin: 0;
  padding: 0;
  list-style-type: none;
}


.editorial-reviews li, .customer-reviews li {
  margin: 2em 0;
}


.customer-reviews li {
  background-color: #eee;
  border: 1px solid #bbb;
  padding: 0.75em;
}


.customer-reviews li .reviewer,
.editorial-reviews li .reviewer,
.customer-reviews li .review-description,
.editorial-reviews li .review-description {
  padding: 0;
  margin: 0.5em 0;
}


.customer-reviews li h3 { margin: 0.25em 0; }
.customer-reviews li .reviewer::before { content:'by '; }


.editorial-reviews .review-description::before,
.editorial-reviews .review-description::after {
  content: '"';
}


.editorial-reviews .reviewer::before {
  content: '-';
  font-weight: bold;
}




/* Add Review Form */

form#add-review textarea {
 box-sizing: border-box;
 max-width: 100%;
 min-height: 5em;
 width: 100%;
 margin: 0.5em 0;
 font-family: 'IBM Plex Sans', Helvetica, sans-serif;
}


form#add-review {
 margin: 1em 0;
 line-height: 2em;
}


#add-review > [name="title"] {
 font-weight: bold;
}




/* Shopping Cart Styling
   ===================== */

.cart, .minicart {
  list-style-type: none;
  padding: 0;
  margin: 1rem 0;
}

.minicart {
  overflow-y: auto;
  max-height: 300px;
}

.cart > li, .minicart > li {
  min-width: 0;
  flex: 1;
  display: flex;
  box-sizing: border-box;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: start;
}

.cart > li {
  padding: 1em;
  border-top: 1px solid var(--navi-bar-border-color);
}

.cart > li:last-child {
  border-bottom: 1px solid var(--navi-bar-border-color);
}

.minicart > li { 
  margin: 1em 0;
}

.minicart > li:first-child {
  margin-top: 0;
}

.minicart > li:last-child {
  margin-bottom: 0;
}


.cart-item-image {
  flex: 25;
  min-width: max-content;
  max-width: max-content;
}

.cart-item-image a {
  display: inline-block;
}

.cart-item-image img {
  object-fit: contain;
  width: 50px;
  height: 50px;
  border: 1px solid var(--navi-bar-border-color);
  border-radius: var(--box-border-radius);
  box-shadow: 0.125em 0.125em 0.125em #fafafa; /* box-shadow = 0.125em */
}

.minicart .cart-item-image img {
  width: 50px;
  height: 50px;
}

.cart-item-image a:hover img { opacity: 0.5; }


.cart-item-description {
  flex: 75;
  padding: 0;
  margin: 0 1.25em;
}

.cart-item-description *:first-child {
  margin-top: 0;
}

.cart-item-description > a:first-child {
  text-decoration: underline;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.25em;
  display: block;
}

.minicart .cart-item-description > a:first-child {
  font-size: 1em;
}

.minicart-item-properties {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.minicart-item-properties li {
  display: block;
}


.cart > .number-container {
  flex: 0;
  margin: 0px 1.5em;
}

.cart-item-price {
  flex: 0;
  min-width: max-content;
}


.cart-op {
  display: block;
  list-style-type: none;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: right;
}

.cart-op > li {
  display: inline-block;
  margin-left: 1em;
}

.cart-op a, a.cart-qty-update {
  cursor: pointer;
  text-decoration: none;
}

a.cart-qty-update {
  display: inline-block;
  visibility: hidden;
  opacity: 0;
  margin: 0 0.25em;
  color: var(--input-border-color);
  flex: 0;
}

div.number-container.show-update + a.cart-qty-update {
  visibility: visible;
  opacity: 1;
}

a.cart-qty-update:hover {
  color: var(--link-hover-color);
}




/* Shopping Cart Dash Styling
   ========================== */

.dashboard {
  display: block;
  width: 100%;
  padding: 1px 1em;
  background: var(--link-menu-bg-color);
  border-radius: var(--navi-bar-border-radius);
  border: 1px solid var(--navi-bar-border-color);
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: auto;
  box-sizing: border-box;
  transition: all var(--navi-bar-transition-time) var(--navi-bar-transition-effect);
}

.dashboard-body {
  width: 100%;
  box-sizing: border-box;
}

.cart-dash-table {
  margin: 1em 0;
  margin-left: auto;
  text-align: right;
  width: 100%;
  line-height: 1;
}

.cart-dash-table th, td {
  text-align: right;
  padding: 0.25em 0;
}

.cart-dash-table tr:first-child th, .cart-dash-table tr:first-child td {
  padding-top: 0;
}

.cart-dash-table th {
  text-align: left;
}

.cart-dash-table th.flat {
  color: rgb(0,0,0,0.5);
  font-weight: 500;
}

#checkout {
  width: 100%;
  box-sizing: border-box;
  display: block;
  margin: 1em 0;
}

.view-cart {
  display: block;
  margin: 1em 0;
  width: 100%;
  text-align: center;
}

/* The following removes extra vertical spacing from navigation bar minicart */

#minicart-dropdown > *:first-child { margin-top: 0; }
#minicart-menu > *:last-child { margin-bottom: 0; }




/* Notifications
   ============= */

.no-notifications {
  text-align: center;
  margin: 0;
}

.notification-button {
  position: relative;
  display: inline-block;
}

.notification-button .notification-count {
  position: absolute;
  top: 0px;
  right: 0px;
  transform: translate(50%,-50%);
  display: block;
  color: white;
  background: var(--accent-color);
  border-radius: 50%;
  width: 1.5em;
  line-height: 1;
  padding-top: 0.25em;
  padding-bottom: 0.25em;
  text-align: center;
  font-size: var(--notification-count-font-size);
  font-weight: var(--notification-count-font-weight);
  overflow: hidden;
  opacity: 1;
  transition: all var(--input-transition-time) var(--input-transition-effect);
}

.notification-button .notification-count.zero {
  opacity: 0;
}

.dropdown-content .notifications-scroller {
  max-height: calc(100vh - var(--navi-bar-height) - 2 * var(--navi-bar-outer-menu-verticalpad));
}

.notifications-scroller {
  overflow-y: auto;
}

ol.notifications {
  padding: 0;
  margin: 0 1em 0 0;
  list-style-type: none;
  border-right: var(--notification-line-thickness) solid var(--notification-line-color);
  line-height: var(--notification-line-height);
}

ol.notifications > li {
  position: relative;
  padding-right: 1em;
  margin-bottom: 1em;
}

ol.notifications > li:last-child {
  margin-bottom: 0;
}

ol.notifications > li:after {
  position: absolute;
  content: '';
  display: block;
  right: calc(0px - var(--notification-line-thickness) / 2);
  top: calc(var(--notification-line-height) / 2 + var(--notification-timestamp-ypadding) + var(--navi-bar-border-thickness));
  transform: translate(50%, -50%);
  width: var(--notification-point-size);
  height: var(--notification-point-size);
  border-radius: 50%;
  border: var(--notification-point-border-thickness) solid var(--notification-line-color);
  background: var(--notification-line-color);
  transition: all var(--input-transition-time) var(--input-transition-effect);
  box-sizing: border-box;
}

ol.notifications > li[data-read_p]:after {
  background: white;
}

ol.notifications > li .message {
  background: white;
  border: var(--navi-bar-border-color) solid var(--navi-bar-border-thickness);
  padding: var(--notification-message-padding);
  color: inherit;
  display: block;
  text-decoration: none;
}

ol.notifications > li .timestamp {
  background: var(--notification-timestamp-background);
  color: var(--notification-timestamp-color);
  font-size: var(--notification-timestamp-font-size);
  padding: var(--notification-timestamp-ypadding) var(--notification-message-padding);
  border: var(--navi-bar-border-color) solid var(--navi-bar-border-thickness);
}

ol.notifications > li .message + .timestamp,
ol.notifications > li .timestamp + .message {
  border-top: none;
}




/* Add To Cart Forms
   ================= */

.add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5em;
  border-radius: var(--navi-bar-border-radius);
}

.cart-qty {
  display: flex;
  align-items: center;
}

.add-to-cart > *, .cart-qty > * {
  flex-shrink: 0;
}

#add-cart-qty, .cart-qty > div.number-container {
  margin-left: 0.25em;
  margin-right: 0.25em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

#add-cart-button {
  width: auto;
  margin-left: auto;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}




/* Shipping Option Selector */

ul.shipping-options {
  padding: 0;
  margin: 0;
  list-style-type: none;
  background: var(--link-menu-bg-color);
  border-radius: var(--navi-bar-border-radius);
  border: 1px solid var(--navi-bar-border-color);
}

ul.shipping-options > li {
  display: block;
  margin: 1em;
}

.shipping-option-title {
  font-weight: 400;
}




/* Media Queries */

@media only screen and (min-width: 480px) {
  #add-cart-button { /* Add to Cart Button is Larger in Width */
    padding-left: 2em;
    padding-right: 2em;
  }
}

@media only screen and (min-width: 780px) {
  .overview { flex-direction: row; }
  .overview-slideshow {   margin-right: calc(5% + 1em); }
  .overview-information {  max-width: 480px; }
  .cart-item-image img {
    width: 100px;
    height: 100px;
  }
  .dashboard {
    position: fixed;
    right: 0;
    top: var(--navi-bar-height);
    width: 320px;
    height: calc(100vh - var(--navi-bar-height));
    padding: calc(var(--content-verticalpad) - 1em) var(--navi-bar-sidepad);
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    transition: none;
  }
  .dashboard.left {
     left: 0;
  }
  .dashboard::-webkit-scrollbar {
    display: none;
  }
  .cart-dash-table {
    margin-left: 0;
    text-align: left;
  }
  .dashboard-body {
    width: calc(100% - 320px);
  }
  .dashboard-body.right {
     margin-left: 320px;
   }
}
