/* Fonts Logo */
@font-face {
  font-family: "Made Saonara";
  src: url("fonts/MADE SAONARA 2 PERSONAL USE.otf") format("opentype");
}

@font-face {
  font-family: "Move Only";
  src: url("fonts/MoveOnlyRegular.ttf") format("truetype");
}

:root {
  --primary: #c4a484;
  --bg: #7a6652;
  --third: #f7e7ce;
  --dark: #5a4a3a;
  --light: #ffffff;
  --gold: #d4af37;
  --cream: #faf8f5;
  --shadow: rgba(122, 102, 82, 0.15);
  --gradient: linear-gradient(135deg, #f7e7ce 0%, #e8d5b7 100%);

  --font-display: "Carattere", sans-serif;
  --font-primary: "Libre Baskerville", sans-serif;
  --font-secondary: "Cormorant Garamond", sans-serif;
  --font-body: "Lora", sans-serif;
}

@font-face {
  font-family: "Made Saonara";
  src: url("fonts/MADE SAONARA 2 PERSONAL USE.otf") format("opentype");
}

@font-face {
  font-family: "Move Only";
  src: url("fonts/MoveOnlyRegular.ttf") format("truetype");
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  border: none;
  text-decoration: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--dark);
  padding-top: 120px;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background-color: #ffffff;
  padding: 1rem;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Navbar saat scrolling */
.navbar.scrolled {
  padding: 0.5rem 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(152, 106, 59, 0.24);
}

.navbar.scrolled .navbar-top {
  position: static;
  margin-bottom: 0;
}

.navbar.scrolled .logo-main {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  line-height: 1;
}

.navbar.scrolled .logo-c {
  font-size: 40px;
  top: 0;
}

.navbar.scrolled .logo-w {
  font-size: 24px;
  margin-left: 1px;
  position: relative;
  top: 10px;
}

/* subtitle scroll */
.navbar.scrolled .logo-subtitle {
  display: none;
}

.navbar.scrolled .navbar-bottom {
  justify-content: center;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

/* navbar sosmed saat scroll */
.navbar.scrolled .navbar-sosmed {
  display: none;
}

.navbar.scrolled .navbar-nav {
  margin-top: 0;
  gap: 2rem;
}

.navbar.scrolled .navbar-nav a {
  font-size: 1.2rem;
}

.navbar.scrolled .navbar-right {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.navbar.scrolled .navbar-right a {
  font-size: 1.2rem;
}

/* Logo */
.logo-main {
  display: inline-block;
  position: relative;
  text-align: center;
  line-height: 0.8;
}

.logo-c {
  font-family: "Made Saonara 2", serif;
  font-size: 85px;
  color: #7a6652;
  display: inline-block;
  vertical-align: top;
  position: relative;
  top: -5px;
}

.logo-w {
  font-family: "Move Only", serif;
  color: #7a6652;
  font-size: 45px;
  display: inline-block;
  position: relative;
  top: 30px;
  left: 2px;
  transform: translateY(-20%);
}

.logo-subtitle {
  font-family: var(--font-secondary);
  font-size: 1.1rem;
  color: #7a6652;
  margin-top: 0;
  letter-spacing: 0.08rem;
  display: block;
}
/* end logo */

.navbar-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: 0 2rem;
  margin-top: 1rem;
}

/* Sosmed kiri */
.navbar-sosmed {
  display: flex;
  gap: 1rem;
}

.navbar-sosmed a {
  color: var(--primary);
  font-size: 1.1rem;
  text-decoration: none;
}

.navbar .navbar-sosmed a:hover {
  color: var(--bg);
}

/* Nav tengah */
.navbar-nav {
  display: flex;
  gap: 3rem;
  margin-top: 1rem;
  position: relative;
}

.navbar-nav .dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  border-radius: 4px;
  padding: 0.5rem 0;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.dropdown-content a:hover {
  background-color: var(--third);
  color: var(--bg);
}

.dropdown-content a::after {
  display: none !important;
}

.navbar .navbar-nav a {
  color: var(--primary);
  font-size: 1.1rem;
  text-decoration: none;
  position: relative;
}

.navbar .navbar-nav a:hover {
  color: var(--bg);
}

.navbar .navbar-nav a::after {
  content: "";
  display: block;
  width: 100%;
  border-bottom: 2px solid var(--bg);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  margin-top: 0.2rem;
  transform-origin: center;
}

.navbar .navbar-nav a:hover::after {
  transform: scaleX(0.5);
}

/* Ikon kanan */
.navbar-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.navbar .navbar-right a {
  color: var(--primary);
  font-size: 1.1rem;
  text-decoration: none;
}

.navbar .navbar-right a:hover {
  color: var(--bg);
}

/* Tablet */
/* saat default sidebar & menu tidak aktif */
#menu {
  display: none;
}

/* Responsive Dropdown */
@media (max-width: 768px) {
  .dropdown-content {
    position: static;
    background-color: transparent;
    box-shadow: none;
    min-width: 100%;
    transform: none;
    padding-left: 1rem;
  }

  .dropdown-content a {
    padding: 0.5rem 1rem;
  }
}

.mobile-sidebar {
  display: none;
}

/* Tampil di tablet/mobile */
@media (max-width: 768px) {
  #menu {
    display: inline-block;
  }

  .mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: right 0.3s ease-in-out;
    z-index: 1001;
  }

  .mobile-sidebar.active {
    right: 0;
  }

  .mobile-sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .mobile-sidebar .sidebar-nav a {
    color: var(--primary);
    font-size: 1.4rem;
    text-decoration: none;
  }

  .mobile-sidebar .sidebar-nav a:hover {
    color: var(--bg);
  }

  .mobile-sidebar .sidebar-nav a::after {
    content: "";
    display: block;
    width: 100%;
    border-bottom: 2px solid var(--bg);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    margin-top: 0.2rem;
    transform-origin: left;
  }

  .mobile-sidebar .sidebar-nav a:hover::after {
    transform: scaleX(0.5);
  }

  .mobile-sidebar .sidebar-sosmed a {
    color: var(--primary);
    font-size: 1.2rem;
    text-decoration: none;
  }

  .mobile-sidebar .sidebar-sosmed {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
  }

  .mobile-sidebar .sidebar-sosmed a:hover {
    color: var(--bg);
  }

  .navbar-nav,
  .navbar-sosmed {
    display: none;
  }
}

/*tetap kanan */
@media (min-width: 768px) {
  .navbar-icons-center {
    justify-content: flex-end;
    flex: 1;
  }
}

/* Tablet/Mobile: pindah ke tengah */
@media (max-width: 768px) {
  .navbar-bottom {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

/* ProductDet */
.product-detail {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.product-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.product-gallery {
  position: relative;
}

.main-image {
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-family: var(--font-primary);
  font-size: 2rem;
  color: var(--bg);
  margin-bottom: 1rem;
}

.product-price {
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.product-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.product-details {
  margin-bottom: 2rem;
}

.product-details h3 {
  color: var(--bg);
  margin-bottom: 1rem;
}

.product-details ul {
  list-style: none;
  padding: 0;
}

.product-details li {
  color: #666;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.product-details li:before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.quantity-selector {
  margin-bottom: 1.5rem;
}

.quantity-selector label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--bg);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-controls button {
  background: var(--third);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--bg);
  transition: all 0.3s ease;
}

.quantity-controls button:hover {
  background: var(--primary);
  color: white;
}

.quantity-controls input {
  width: 60px;
  text-align: center;
  border: 1px solid var(--third);
  border-radius: 4px;
  padding: 0.5rem;
}

.stock-info {
  margin-bottom: 1.5rem;
  color: var(--bg);
}

.action-buttons {
  display: flex;
  gap: 1rem;
}

.action-buttons button {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
}

.btn-cart {
  background: var(--third);
  color: var(--bg);
}

.btn-order {
  background: var(--bg);
  color: white;
}

.btn-cart:hover {
  background: var(--primary);
  color: white;
}

.btn-order:hover {
  background: var(--primary);
}

/* Error & Loading Message Styling */
.error-message,
.loading-message {
  text-align: center;
  color: var(--bg);
  background: #f7e7ce33;
  border-radius: 12px;
  padding: 2.5rem 1rem;
  margin: 2rem auto;
  max-width: 500px;
  font-family: var(--font-primary);
  box-shadow: 0 2px 16px rgba(196, 164, 132, 0.08);
}

.error-message h2,
.loading-message h2 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-secondary);
  letter-spacing: 0.02em;
}

.error-message a,
.loading-message a {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(196, 164, 132, 0.1);
}

.error-message a:hover,
.loading-message a:hover {
  background: var(--bg);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 768px) {
  .product-container {
    grid-template-columns: 1fr;
  }

  .product-detail {
    padding: 1rem;
  }

  .product-title {
    font-size: 1.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }
}

#deliveryModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

@keyframes drive {
  0% {
    left: -150px;
    transform: translateY(0px) rotateZ(0deg);
  }
  25% {
    transform: translateY(-1px) rotateZ(-0.5deg);
  }
  50% {
    transform: translateY(1px) rotateZ(0.5deg);
  }
  75% {
    transform: translateY(-1px) rotateZ(-0.5deg);
  }
  100% {
    left: 100%;
    transform: translateY(0px) rotateZ(0deg);
  }
}

#truck {
  position: absolute;
  top: 20px;
  left: -150px;
  animation: drive 4s ease-in-out forwards;
}

.processing-text::after {
  content: "";
  display: inline-block;
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}

/* ModalConf */
#confirmModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 9998;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

#confirmModalContent {
  background: var(--light, white);
  padding: 2rem 2.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  font-family: var(--font-body, "Lora", serif);
  color: var(--dark, #333);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);

  max-height: 85vh;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s ease-out;
}

#confirmModalContent input[type="text"],
#confirmModalContent textarea {
  color: var(--dark);
  background-color: var(--light);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#confirmModalContent h3 {
  margin-bottom: 1.5rem;
  color: var(--bg, #7a6652);
  text-align: center;
  font-family: var(--font-display, "Carattere", sans-serif);
  font-size: 2.2rem;
  font-weight: 500;
}

.order-summary {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}
.order-summary p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--dark, #555);
}
.order-summary p strong {
  color: var(--bg, #7a6652);
}
.order-summary span {
  font-weight: 500;
}

#confirmModalContent label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--bg, #7a6652);
}

#confirmModalContent input[type="text"],
#confirmModalContent textarea {
  width: 100%;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: var(--font-body, "Lora", serif);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#confirmModalContent input[type="text"]:focus,
#confirmModalContent textarea:focus {
  border-color: var(--primary, #c4a484);
  box-shadow: 0 0 0 3px rgba(196, 164, 132, 0.2);
}

.promo-code-section {
  margin-bottom: 1.5rem;
}
.promo-code-section > div {
  display: flex;
  gap: 0.5rem;
}
#promoCodeInput {
  flex-grow: 1;
  text-transform: uppercase;
}
#applyPromoBtn {
  background: var(--primary, #c4a484);
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}
#applyPromoBtn:hover {
  background: var(--bg, #7a6652);
}
#applyPromoBtn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}
#promoMessage {
  font-size: 0.9rem;
  margin-top: 0.7rem;
  min-height: 1.2em;
  font-weight: 500;
}

.final-price-summary {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  text-align: right;
}
.final-price-summary p {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
#modalDiscountAmount {
  color: #28a745;
  font-weight: 500;
}
#modalFinalPrice {
  color: var(--bg, #7a6652);
  font-weight: bold;
  font-size: 1.4rem;
}
.final-price-summary p strong {
  color: var(--dark);
}

#confirmModalContent .action-buttons-container {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1rem;
}
#cancelOrderBtn,
#submitConfirmOrderBtn {
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 1rem;
}
#cancelOrderBtn {
  background: #e0e0e0;
  color: #555;
  border: 1px solid #c0c0c0;
}
#cancelOrderBtn:hover {
  background: #d0d0d0;
}
#submitConfirmOrderBtn {
  background: var(--bg, #7a6652);
  color: white;
}
#submitConfirmOrderBtn:hover {
  background: var(--primary, #c4a484);
  transform: translateY(-2px);
}
