/* GLOBAL RESET */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* ROOT VARIABLES */
:root {
  --primary-color: #6f4e37;
  --secondary-color: rgb(58, 19, 19);
  --hover-color: #59392e;
  --text-color: #333;
  --light-bg: #FAF7F2;
  --coffee: gold;
  --footer-color: #c49b63;
  --light: #fff;
  --dark: #000;
  --red: red;
  --grey: #ccc;
  --light-grey: #eee;
  --dark-bg: #1f1f1f;
  --card:#f5f5f5;;
}

/* UTILITIES */
.flex {
  display: flex;
}

/* NAVBAR */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 8vh;
  padding: 0 1rem;
  background: var(--secondary-color);
  justify-content: space-between;
  align-items: center;
}

nav a {
  color:var(--light);
  text-decoration: none;
  margin-right: 1rem;
}

nav a:hover {
  text-decoration: underline;
}


#coffee {
  font-size: 1.8rem;
  color: var(--coffee);
  font-family: 'Playfair Display', serif;
}

.left,
.right {
  align-items: center;

}


.nav-link {
  gap: 1rem;
  align-items: center;
}

.hamburger {
  display: none;
  margin: 1rem;
}

.login-btn {
  padding: 0.5rem 0.5rem;
  font-size: 1rem;
  background-color: #007BFF;
  color: var(--light);
  cursor: pointer;
  border-radius: 1rem;
  border: none;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background-color: var(--dark);
  color:var(--light) ;
  transform: translateY(-2px);
}

/* SEARCH */
.nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  border: 1px solid var(--grey);
  border-radius: 20px;
  padding: 4px 8px;
  height: 30px;
  margin-right: 1rem;
}

/* Input */
#navSearchInput {
  border: none;
  outline: none;
  font-size: 14px;
  width: 160px;
}

#searchIcon,
#closeSearch {
  cursor: pointer;
  font-size: 14px;
}

#closeSearch {
  display: none;
}

/* CART */
.cart-icon {
  position: relative;
  padding: 0.5rem 0.8rem;
  font-size: 22px;
  cursor: pointer;
}

#cartCount {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--red);
  color: var(--light);
  font-size: 10px;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;

}

/* Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: var(--light);
  transition: right 0.3s ease;
  z-index: 1000;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 1rem;
  background: var(--primary-color);
  color: var(--light);
  justify-content: space-between;
}

#closeCart {
  cursor: pointer;
  font-size: 22px;
}

.cart-items {
  flex: 1;
  padding: 1rem;
  gap: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cart-items .item {
  padding: 0.5rem;
  gap: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--light-grey);
  transition: all 0.3s ease-in-out;
}

.cart-items .item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.item-info h4 {
  font-size: 1rem;
  font-weight: 600;
}

.item-qty {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}

.item-qty button {
  width: 28px;
  height: 28px;
  background-color: var(--primary-color);
  color: var(--light);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
}

.item-qty span {
  font-weight: 600;
  font-size: 0.9rem;
}

.item-price {
  min-width: 50px;
  text-align: right;
  font-weight: 700;
}

.cart-footer {
  padding: 1rem;
  border-top: 1px solid var(--dark);
}
.order-btn {
  width: 100%;
  padding: 10px;
  margin: 1rem 0;
  background: var(--primary-color);
  color: var(--light);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.order-btn:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);

}

/* ADDRESS MODAL */

#addressModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.address-box {
  width: 90%;
  max-width: 420px;
  padding: 1rem;
  background: var(--light);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-radius: 12px;
  animation: scaleIn 0.3s ease;
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.address-header h3 {
  margin: 0;
  color: var(--primary-color);
}

#closeAddress {
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--dark);
}

#addressText {
  width: 100%;
  min-height: 90px;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--light);
  resize: none;
  font-size: 0.95rem;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.cod-text {
  font-weight: 600;
  color: var(--text-color);
}

#confirmOrder {
  padding: 0.7rem;
  background: var(--primary-color);
  color: var(--light);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#confirmOrder:hover {
  background: var(--hover-color);
  transform: translateY(-2px);
}

/* ORDERS MODAL */

#orders {
  position: fixed;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: auto;
  max-width: 800px;
  max-height: 80vh;
  background: var(--light);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}

.orders-header {

  position: relative;
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: var(--light);
  font-size: 1.2rem;
  font-weight: bold;
  height: 2.5rem;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;

}

#closeOrders {
  position: absolute;
  right: 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 50%;
  color: var(--dark);
  transition: all 0.2s ease;
}

#ordersList {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: auto;
  align-items: flex-start;
}

.order-card {
  min-width: 220px;
  padding: 0.8rem 1rem;
  background: var(--card);
  gap: 0.5rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.order-card ul {
  list-style: none;
}

.order-card ul li {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.order-card p {
  font-weight: bold;
  margin: 0.3rem 0;
}

/* Scrollbar styles */
#ordersList::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

#ordersList::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

#ordersList::-webkit-scrollbar-track {
  background: var(--light-grey);
}




/* SECTION */
section {
  padding: 4rem 1rem;
  min-height: calc(100vh - 8vh);
  background-color: var(--light-bg);
  text-align: center;

}

/* HOME */
#home {
  padding: 0 1.5rem;
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url("images/coffe.png");
  background-size: cover;
  color: #f5f1ec;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#home h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

#home h2 {
  font-size: 1.6rem;
  font-weight: 400;
  color: #e6d5b8;
  margin-bottom: 1rem;
}

#home p {
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.6;
  color: var(--light);
}

/* ABOUT */
.about-section {
  min-height: auto;
}

.about-container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: stretch;
  gap: 2rem;
}

.about-text {
  flex: 1;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.about-text p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.learn-more {
  margin-top: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 16px;
  background: var(--primary-color);
  color: var(--light);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;

}

.learn-more:hover {
  background-color: var(--hover-color);
}

.about-image {
  width: 50%;
  background-image: url("images/about.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}



/* MENU */
.menu-container {
  padding: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.menu-card {
  padding: 1rem;
  width: 100%;  
  max-width: 240px;
  text-align: center;
  background: var(--light);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.menu-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
}

.menu-card h3 {
  margin: 0.5rem 0;
  font-size: 1.5rem;
}

.menu-card p {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin: 0.3rem 0;
  font-weight: 800;
}

.add-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  font-size: 1rem;
  background: var(--primary-color);
  color: var(--light);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-btn:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* SECTION */

.footer {
  padding: 3rem 1rem 1rem;
  background: var(--dark-bg);
  color: var(--light);
}

.footer-container {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-box h3,
.footer-box h4 {
  margin-bottom: 1rem;
  color: var(--footer-color);
}

.footer-box p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--grey);
}

.footer-box ul {
  list-style: none;
}

.footer-box ul li {
  margin-bottom: 0.5rem;
}

.footer-box ul li a {
  color: var(--grey);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-box ul li a:hover {
  color: var(--footer-color);
}

.footer-box i {
  margin-right: 0.5rem;
  color: var(--footer-color);
}

.social-icons a {
  font-size: 16px;
  line-height: 1;
  width: 35px;
  height: 35px;
  background: var(--text-color);
  color: var(--light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  transition: 0.3s;
}

.social-icons a:hover {
  background: var(--footer-color);
  color: var(--dark);
}

.social-icons a i {
  margin-right: 0;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--grey);
  text-align: center;
  border-top: 1px solid var(--text-color);
}


@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}


@media screen and (max-width: 780px) {
  #home h1 {
    font-size: 2.2rem;
  }

  #home h2 {
    font-size: 1.3rem;
  }

  #home p {
    font-size: 0.95rem;
  }

  .nav {
    min-height: 8vh;
    padding: 0 1rem;
  }

  .nav-link,
  .login-btn {
    display: none;
  }
  .right{
    gap:0.5rem;
  }

  .hamburger {
    display: block;
    font-size: 1.4rem;
    cursor: pointer;
  }

  .cart-icon {
    font-size: 1.5rem;
  }

  .nav-link.active {
    position: absolute;
    top: 8vh;
    right: 0;
    padding: 1rem;
    background: var(--light);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    border: 1px solid black;

  }

  .nav-link.active a,
  .nav-link.active .login-btn {
    margin: 0.5rem 0;
    padding: 0.5rem 1rem;
    color: var(--dark);
    font-size: 1.1rem;
    display: block;
    text-align: left;
  }

  #navSearchInput {
    display: none;
    width: 115px;
  }

  #navSearchInput.active {
    display: block;
  }

  .nav-search {
    background: transparent;
    border: none;
    padding: 0;
    height: auto;
    margin-right:0.2rem;
  }

  .nav-search.active {
    background: var(--light);
    border: 1px solid var(--grey);
    padding: 4px 8px;
    border-radius: 20px;
  }

  #closeSearch.active {
    display: block;
  }

  #searchIcon {
    font-size: 20px;
  }

  #searchIcon.active {
    display: none;
  }
  .address-box {
    width: 95%;
  }

  #orders {
    width: 95%;
    max-width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .orders-header {
    font-size: 16px;
    flex-shrink: 0;
  }

  #ordersList {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
  }

  .order-card {
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .about-container {
    flex-direction: column;
  }

  .about-image {
    width: 100%;
    min-height: 250px;
  }

  .about-text h2 {
    font-size: 1.7rem;
  }

  .menu-container {
    padding: 0.8rem;
  }

  .menu-card {
    padding: 0.8rem;
  }

  .menu-img {
    height: 140px;
  }

  .menu-card h3 {
    font-size: 1rem;
  }

  .menu-card p {
    font-size: 0.95rem;
    font-weight: bold;
  }

  .add-btn {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-icons {
    justify-content: center;

  }

}
