/* Box sizing & margin/padding reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  outline: 0;
}

/* Set default font & background */
html, body {
  height: 100%;
  font-size: 16px;
  line-height: 1.5;
  color: #000;
}

/* Remove list styles */
ul, ol {
  list-style: none;
}

/* Remove quotes from blockquote and q */
blockquote, q {
  quotes: none;
}

blockquote::before, blockquote::after,
q::before, q::after {
  content: '';
  content: none;
}

/* Remove table borders and spacing */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Make images responsive */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove form element styling */
button, input, select, textarea {
  background: none;
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  appearance: none;
}

/* Anchor reset */
a {
  text-decoration: none;
  color: inherit;
}
@font-face {
    font-family: 'Red Hat Text';
    src: url('./assets/fonts/static/RedHatText-Regular.ttf');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Red Hat Text';
    src: url('./assets/fonts/static/RedHatText-SemiBold.ttf');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Red Hat Text';
    src: url('./assets/fonts/static/RedHatText-Bold.ttf');
    font-weight: 700;
    font-style: normal;
}
/* Set root defaults */
:root {
  scroll-behavior: smooth;
  --Red: hsl(14, 86%, 42%);
  --Green: hsl(159, 69%, 38%);
  --Rose50: hsl(20, 50%, 98%);
  --Rose100: hsl(13, 31%, 94%);
  --Rose300: hsl(14, 25%, 72%);
  --Rose400: hsl(7, 20%, 60%);
  --Rose500: hsl(12, 20%, 44%);
  --Rose900: hsl(14, 65%, 9%);
  --font-red:"Red Hat Text" ,system-ui,sans-serif;
}


body{
    width: 100vw;
    padding: 25px;
    font-family: var(--font-red);
    font-weight: 400;
    background-color: var(--Rose50);
}
main{
    display:flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}
@media (min-width:930px) {
    main{
        flex-direction: row;
        align-items: flex-start;
        gap: 25px;
    }
}


@media (min-width:930px){
    .product-list{
    width: 60%;
   }
}

.product-grid{
    display: grid;
}
.product-grid{
    display: grid;
    width: 100%;
    gap:30px;
    margin-bottom: 30px;
}
@media (min-width :768px) {
    .product-grid{
        grid-template-columns: repeat(3,1fr);
        gap: 20px;
    }
}
.product-img-wrapper img{
    border-radius: 10px;

}
.product-card:has(.active) .product-img-wrapper img {
    border: solid 2px var(--Red);
}


.product-description{
    position: relative;
    display: flex;
    flex-direction: column;
}
.product-category{
    color: var(--Rose500);
    font-weight: 400;
}
.product-name{
    font-weight: 600;
    font-size: 12px;
    color: var(--Rose900); 
}
.product-price{
    color: var(--Red);
    font-weight: 600;
}
.add-to-cart {
  position: relative;
  margin: auto;
  top: -22px;
  background-color: #fff;
  padding: 2% 3%;
  border-radius: 300px;
  border: solid .04px var(--Rose500);
  
}
@media (min-width:768px) {
  .add-to-cart{
     padding: 4% 6%;
     top: -30px;
  }
  
}
.add-btn{
    display: flex;
    gap: 5px;
}
.add-to-cart:hover{
    border: solid 1px var(--Red);
}
.quantity-control {
  display: none;
  align-items: center;
  gap: 36.3px;
  color: var(--Rose50);
  padding: 0;
}
.quantity-control button{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    aspect-ratio: 1;
    border-radius: 18px;
    border: solid 1px #fff;
}
.quantity-control button:hover{
    background-color: #fff;
}
.quantity-control button:hover img{
    filter:  invert(34%) sepia(91%) saturate(1200%) hue-rotate(10deg);
}

.add-to-cart.active .add-btn {
  display: none;
}

.add-to-cart.active .quantity-control {
  display: flex;
}


.cart {
  width: 100%;
  padding: 30px;
  background: #fff;
  font-family: Arial, sans-serif;

}
@media (min-width:930px) {
    .cart{
       width: 30%;
    } 
}

.cart-title {
  font-size: 25px;
  margin-bottom: 12px;
  color: var(--Red);
}

.cart-empty {
  text-align: center;
  margin: 20px 0;
  
}

.cart-empty-img {
  max-width: 150px;
  margin: auto;
  display: block;
}

.cart-empty-text {
  font-size: 14px;
  color: #555;
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  font-size: 14px;
  margin-top: 10px;
}
.cart-items li {
    border-bottom: solid .5px var(--Rose100);
    padding-bottom: 10px;
    display: flex;
    position: relative;
    flex-wrap: wrap;
    
}
.cart-total-container{
  display: flex;
  align-items: center;

}
.cart-total-container span{
  font-size: 12px;
  font-weight: 400;
  color: var(--Rose500);
  font-family:var(--font-red) ;
}
.cart-total-container .cart-total , .cart-total-container .cart-total-span{
  font-size: 25px;
  color:#000;
  font-weight: 700;
}
.item-name {
  flex-basis: 100%;
  font-weight: bold;
}

.item-quantity{
  text-align: right;
  margin-right: 10px;
  font-size: 12px;
  color: var(--Rose500);
}
.item-unit-price, .item-total-price {
  text-align: right;
  margin-right: 8px;
  font-size: 12px;
  color: var(--Rose500);
}

.delete-item {
  background: none;
  border: solid 1px var(--Red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  aspect-ratio: 1;
  width: 15px;
  height: 15px;
  position: absolute;
  right: 10px;
  top: 15px;
}

.cart-total-container {
  font-size: 16px;
  font-weight: bold;
  margin: 10px auto;
  display: none;
  width: 100%;
  justify-content: space-between;

}

.cart-carbon {
  font-size: 14px;
  color: green;
  margin-bottom: 10px;
  display: none;
  gap: 20px;
  justify-content: center;
  margin: 25px auto;
  background-color: var(--Rose50);
  padding: 10px;
  border-radius: 10px;
}

.cart-confirm {
  width: 100%;
  padding: 10px;
  background:var(--Red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  border-radius: 40px;
  display: none;
  
}

.cart-confirm:hover {
  background: var(--Rose500);
}
/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
}
@media (min-width:768px) {
    .modal-overlay{
        align-items: center;
    }
    
}
/* Modal Box */
.modal {
  background: #fff;
  width: 500px;
  max-width: 100%;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Modal Header */
.modal-header {
  margin-bottom: 20px;
}

.modal-icon {
  font-size: 32px;
  color: green;
  display: block;
  margin-bottom:10px ;
}

.modal h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.modal p {
  font-size: 14px;
  color: #555;
}

/* Modal Order Items */
.modal-order-items {
  list-style: none;

  margin: 16px 0;
}
.rose-box{
  background-color: var(--Rose50);
  padding: 10px;
}

.modal-order-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  gap: 10px;
}

.modal-order-items img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.modal-order-items .item-info {

  gap: 2px;
  flex: 1;
}
.item-name{
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 12px;
}
.item-quantity{
    display: inline;
    color: var(--Red);
}
.item-unit-price{
    display: inline;
}
/* Modal Total */
.modal-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-top: 12px;
  font-size: 16px;
  background-color: var(--Rose50);
}

/* Modal Close Button */
.modal-close-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  background: #d9480f;
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: #f1653c;
}
.attribution { 
    font-size: 11px; 
    text-align: center;
    margin-top: 40px;
 }
.attribution a { 
    color: hsl(228, 45%, 44%);
 }