/* ###############################################

  CSS specific to shop.php
  
 ############################################ */


/* These classes may show up in js files. Need to check.  */


.cart-popup-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1rem 0;
  }
    
  .product {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: -13rem;
    padding: 22rem 2rem 5rem 2rem;
    width: 100%;
    background-color: var(--white);
    color: var(--primary-colour);
}

.product-container {
    width: 30%; 
    padding: 0 2%; 
    text-align: left; 
}

.product-description-container {
    width: 30%; 
    margin-left: 3%; 
    padding: 0 2%; 
    text-align: left; 
}

#main-image {
    width: 100%;
    height: auto;
}

.product h3, .product p {
    margin: 0 0 1rem 0;
}

.thumbnail-container {
  display: flex;
  justify-content: center;
  gap: auto;
}
  
/* applies to first thumbnail*/
.thumbnail {
  width: 6rem;
  height: 6rem;
  overflow: hidden;
  cursor: pointer;
}

.thumbnail img {
  width: 6rem;
  height: auto;
}

.total-row{
  font-weight: bold;
}
  
  .product-info,
  .quantity-row,
  .total-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
  }
  
  .remove-button {
    border: none;
    cursor: pointer;
    align-self: flex-start;
  }

  #add-to-cart {
     margin-left: 2rem;
  }
  
  .expandable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem; 
  }
  
  .expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    padding-top: 0.5rem; 
    text-align: left;
  }
  
  .expandable-item {
    margin-bottom: 1rem;
  }
  
  
  .expandable-header h4 {
    margin: 0;
  }
  
  .expandable-content.show {
    max-height: 50rem 
  }
  
  .expand-icon {
    font-weight: bold;
    transform: rotate(90deg);
    transition: transform 0.3s ease-in-out;
    cursor: pointer;
  }
  
  .expandable-header.active .expand-icon {
    transform: rotate(0deg);
  }


/* BUILD YOUR VACUUM SPECIFIC */
    .build-step {
    padding-top: 1rem;
  }

#build-vacuum {
    text-align: center;
    position: relative;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
}

#build-vacuum::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: -1rem;
    right: -1rem;
    bottom: -0.5rem;
    background-color: var(--primary-colour-transparent);
    border-radius: 12px;
    z-index: -1;
}

#build-vacuum a {
    text-decoration: none;
    color: var(--secondary-colour);
    font-weight: bold; 
}

#build-vacuum a:hover {
    text-decoration: underline; 
}

#build-vacuum input[type="number"] {
    width: 60px;        
    padding: 4px 6px;    
    text-align: center;  
    font-size: 1rem;
    border: 1px solid var(--border-colour, #ccc);
    border-radius: 6px;
}

  #build-vacuum h4 {
    font-size: var(--text-font-size);
    display: inline-block; /* ensures gradient clipping works */
    background: linear-gradient(to right, var(--primary-colour), var(--secondary-colour));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* fallback */
    padding-bottom: 1rem;
  }

.info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    background-color: var(--secondary-colour);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.info-icon:hover {
    background-color: var(--primary-colour);
}

.info-popup {
    display: none;
    position: absolute;
    top: 130%;
    left: 0;
    transform: translateX(-85%);
    padding: 0.75rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 20;
    width: 240px;
}

.info-icon:hover .info-popup {
    display: block;
}

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

.info-popup canvas {
  width: 200px;
  height: 120px;
}
/* END BUILD YOUR VACUUM*/


/* Add to cart Popup Styles */
#add-to-cart-popup {
  /*Could only get this to work now with visibility hidden as well as display none otherwise pop up shows by default*/
  visibility: hidden; 
  display: none;
  position: fixed; 
  z-index: 1000; 
  left: 0;
  top: 10%;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.2); 
  backdrop-filter: blur(5px); 
  justify-content: center; 
  align-items: center; 
  display: flex; 
  pointer-events: none;
}

/* Popup Content */
.popup-content {
  background-color: var(--white);
  margin-top: 5rem;
  padding: 2rem;
  width: 20rem; 
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
  z-index: 1000;
  pointer-events: auto;
}

.popup-image {
  max-width: 100%;
  height: auto;
}

#popup-product-name {
  padding-top: 1rem;
}

/* Close Button */
.close {
  color: black;
  float: right;
  font-size: 1.5rem; 
  font-weight: bold;
}

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

.button-container {
  display: flex;
  flex-direction: column;
  gap: 1rem; 
  margin-top: 2rem;
}

.popup-content button,
.popup-content a {
  background-color: var(--primary-colour);
  color: var(--secondary-colour);
  padding: var(--button-padding);
  font-size: var(--text-font-size);
  font-weight: var(--button-font-weight);
  letter-spacing: var(--four-letter-spacing);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  text-decoration: none;
}

.popup-content button:hover,
.popup-content a:hover {
  background-color: var(--secondary-colour);
  color: var(--primary-colour);
}


  @media only screen and (max-width: 1024px) {

  .product {
    flex-direction: column;
    align-items: center;   /* center children horizontally */
    text-align: center;    
  }
  
    .product-container {
      width: 80%; 
  }
  
    .product-description-container {
        width: 100%; 
        margin-left: 0;

    }

    #main-image {
      width: 100%;
      height: auto;
  }

  .thumbnail {
    width: 5rem;
    height: 5rem;
    overflow: hidden;
    cursor: pointer;
  }
  
  .thumbnail img {
    width: 5rem;
    height: 5rem;
  }


}
  
  
  /* Adjustments for Small devices (landscape phones, 768px and down) */
  @media only screen and (max-width: 768px) {

      h1, h2 {
        padding-bottom: 0.5rem;
        font-size: var(--text-font-size);
      }
    
      .popup-content {
        margin-top: 25%;
        width: 65%;
        height: auto;
      }

      .close {
        padding-left: 1rem;
      }

      .popup-image {
        max-width: 50%;
      }

      .button-container {
        font-size: var(--text-font-size);
      }

      .product-container, .product-description-container {
        width: 100%;
        margin: 2rem 0.5rem;
       } 

      .product img {
        width: 80%;
        height: auto;
      }
      
      .product h2, .product p {
        margin: 0 0 1rem 0;
      }

      .product-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* right align */
        gap: 0.5rem; /* space between */
      }

      #price-display {
        margin-top: 1rem;
      }

      #quantity-input {
        width: 3.5rem; 
      }

      #add-to-cart {
        margin-left: 55%;
      }

  }
  
  
  
  
  
  
  
