@import url('https://fonts.googleapis.com/css2?family=Andika:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --black: black;
    --purple: purple;
    --light-color: #666;
    --box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1);
}

*{
    font-family: 'andika';
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    outline: none;
    text-decoration: none;
    text-transform: none;
    transition: all .2s linear;
}

html{
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-padding-top: 7rem;
    scroll-behavior: smooth;
}

body{
    background: #fff;
}

/* header */

.header{
    height: 100px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    border: 1px solid;
    justify-content: space-between;
    padding: 2rem 9%;
    background: #fff;
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

.header .headbar {
  display: flex;
  align-items: center;
  gap: 2rem;  /* atur jarak antar menu */
}

.header .logo img{
    margin-top: 15px;
    height: 100px;
    width: auto;
    display: inline-block;
}

.header .headbar a{
    font-size: 1.7rem;
    border-radius: .5rem;
    padding: .5rem 1.5rem;
    color: var(--light-color);
}

.header .headbar a:hover{
    color:#fff;
    background: linear-gradient(120deg, #FAB2ff 40%, #663399);
}

.login-btn {
  padding: 10px 45px;
  text-align: center;
  font-size: 14px;
  color: #fff;
  border: none;
  background-image: linear-gradient(to right, #649bff, #0070fa, #640bff);
  border-radius: 10px;
  box-shadow: var(--box-shadow);
}

.login-btn:hover {
    background: linear-gradient(120deg, #2e0067 20%, #649bff, #663399);
    transform: translateY(-2px);
}

/* kanan navbar */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-right a i, .icon-btn i {
  font-size: 18px;
  color: #25078f;
  transition: 0.2s;
}

.nav-right a:hover i, .icon-btn:hover i {
  color: #72b8f6;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #25078f;
  font-weight: 600;
  font-size: 1.7rem;
  transition: 0.2s;
}

.user-info:hover {
  color: #72b8f6;
}

.user-info i {
  font-size: 20px;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 8px;
  overflow: hidden;
  min-width: 150px;
  z-index: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-5px);
}

.dropdown.show {
  display: block;
  opacity: 1;
  margin-top: 35px;
  transform: translateY(0);
}

.dropdown a {
  display: flex; /* biar icon & text bisa sejajar */
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown a:hover {
  background: #f5f5f5;
  color: #0a1979;
}

.dropdown i {
  font-size: 16px;
}

.dropdown hr {
  margin: 0;
  border: none;
  border-top: 1px solid #eee;
} 

/* Search bar */
.search-container {
  position: relative;
  display: inline-block;
  align-items: center;
}

.search-bar {
  position: fixed;
  top: 110px;
  right: 15px;
  left: auto;
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 8px;
  display: none;
  gap: 8px;
  z-index: 1000;
  align-items: center;
  white-space: nowrap;
}

.search-bar input {
  width: 250px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.search-bar button {
  background-color: #2a7a7b;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.search-bar button:hover {
  background-color: #1e595a;
}

/* saat aktif, tampil */
.search-bar.active {
  display: flex;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.main .right img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 768px) {
    .main {
        flex-direction: column;
        text-align: center;
    }
    .main .right img {
        width: 90%;
        height: auto;
    }
}
