@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --Red: hsl(14, 86%, 42%);
    --Green: hsl(159, 69%, 38%);
    --Rose-50: hsl(20, 50%, 98%);
    --Rose-100: hsl(13, 31%, 94%);
    --Rose-300: hsl(14, 25%, 72%);
    --Rose-400: hsl(7, 20%, 60%);
    --Rose-500: hsl(12, 20%, 44%);
    --Rose-900: hsl(14, 65%, 9%);
}

body {
    font-family: 'Red Hat Text', sans-serif;
    background-color: var(--Rose-50);
    color: var(--Rose-900);
    padding: 100px;
}

.main {
display: flex;
width: 100%;
}

p {
    font-size: 12px;
    color: var(--Rose-400);
}
h1 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 20px;
}
h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--Red);
}
h3 {
    font-size: 16px;
    font-weight: 600;
}
h4 {
    font-size: 14px;
    font-weight: 600;
    padding-top: 10px;
}
.price {
    font-size: 16px;
    font-weight: 500;
    color: var(--Red);
}


/* deserts */
.desert-container {
    width: 60%;
}
.grid-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.grid-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}
figure {
    width: 90%;
    height: auto;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}
figure img {
width: 100%;
height: 100%;
border-radius: 10px;
}

/* button */
.add-to-cart, .quantity-controls {
display: flex;
width: 140px;
height: 40px;
border-radius: 20px;
align-items: center;
align-self: center;
justify-content: center;
position: relative;
bottom: 20px;
right: 12px;
background-color: white;
border: 1px solid var(--Rose-500);
cursor: pointer;
}
.add-to-cart:hover {
    border: 1px solid var(--Red);
}
.cart-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Quantity Controls */
.quantity-controls {
  background-color: var(--Red);
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
  border: none;
}

.quantity-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    height: 16px;
    width:  16px;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid white;
}

.quantity {
    color: white;
   
}


/* Hide Elements*/
.hidden {
    display: none;
}


/* cart */
.cart {
    display: flex;
    flex-direction: column;
    width: 40%;
    height: 50%;
    background-color: white;
    padding: 20px 30px;
    border-radius: 10px;
}

.empty-cart-image {
    display: block;
    width: 50%;
}
.cart-items {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
}

.flex-row {
    display: flex;
    border-bottom: 1px solid #eee;
    align-items: center;
    padding-bottom: 10px;
    font-size: 12px;
}

.cart-item-price {
    display: flex;
}
.cart-item-price span:nth-child(1) {
    color: var(--Red);
    font-weight: 600;
}
.cart-item-price span:nth-child(2) {
    color: var(--Rose-500);
}
.cart-item-price span:nth-child(3) {
    color: var(--Rose-500);
    font-weight: 600;
}
.cart-item-price span {
padding-right: 20px;
}


#cart-items p {
    font-size: 14px;
    padding: 5px 0;
}

.remove-item-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--Rose-500);
    width: 16px; 
    height: 16px;
}
.remove-item {
    width: 10px; 
    height: 10px;
    cursor: pointer;
    transition: opacity 0.3s ease-in-out;
}

.remove-item:hover {
    opacity: 0.7; 
}


#cart-total {
    font-weight: bold;
}


.add-item-msg, .cart-items img {
    align-self: center;
}
.add-item-msg {
    font-size: 13px;
    color: var(--Rose-500);
    margin-top: 20px;
    font-weight: 500;
    padding-bottom: 20px;
}

/* cart footer */
.cart-footer {
    display: none;
    flex-direction: column;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    align-items: center;
}
.order-total, .carbon-neutral {
    color: var(--Rose-900);
}
.total-price {
    font-size: 18px;
    font-weight: 700;
}
/* cart carbon-neutral delivery */
.delivery-msg {
    display: flex;
    align-items: center;
    background-color: var(--Rose-50);
    padding: 10px 0;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 10px;
}
.carbon-neutral {
    margin-left: 5px;
}
/* confirm order btn*/
.confirm-order {
    height: 45px;
    border-radius: 30px;
    color: white;
    background-color: var(--Red);
    border: none;
    cursor: pointer;
}
.confirm-order:hover,  #start-new-order:hover {
    background-color: hsl(14, 89%, 31%);
}

/* Order Confirmation Popup*/
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup.hidden {
    display: none;
}

.order-confirmed-icon {
    width: 25px;
}
.enjoy {
    padding-bottom: 15px;
}
.background {
    padding: 10px 20px;
    background-color: var(--Rose-50);
}
.cart-item-total {
    margin-left: auto;
}
.cart-item-total span {
    font-weight: 600;
}
.popup-content {
    background: white;
    padding: 25px;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-in-out;
}

.popup-content h2 {
    font-size: 22px;
    color: var(--Rose-900);
}
  
  #start-new-order {
    background-color: var(--Red);
      color: white;
      border: none;
      padding: 10px;
      margin-top: 20px;
      cursor: pointer;
      width: 100%;
      border-radius: 30px;
      transition: 0.3s;
  }
  

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


.attribution { 
    font-size: 13px; 
    text-align: center; 
    margin-top: 50px;
    color: var(--Rose-900);
    font-weight: 600;
}
.attribution a { 
    color: hsl(228, 45%, 44%); 
}

/* Media Queries */
@media screen and (max-width: 1000px) {
    .grid-wrap {
        grid-template-columns: repeat(2, 1fr);
    }
    .cart {
        width: 60%;
    }
    .add-to-cart {
        width: 120px;

    }
}
@media screen and (max-width: 800px) {
    .main {
        flex-direction: column;
    }
    .desert-container {
        width: 100%;
    }
    .cart {
        width: 100%;
    }
    .add-to-cart, .quantity-controls {
        width: 100px;
        height: 35px;
        font-size: 11px;
    }
    .cart-icon {
        width: 15px;
    }
}
@media screen and (max-width: 400px) {
    body {
        padding: 30px;
    }
    .grid-wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .add-to-cart, .quantity-controls {
        width: 140px;
        height: 40px;
        font-size: 13px;
    }
    figure img {
        height: 200px;
        object-fit: cover;
    }
    .cart-icon {
        width: 20px;
    }
}