/* Reset and base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #fff;
  color: #222;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 1200px;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header */
header {
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  width: 100%;
  overscroll-behavior-x: contain;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  gap: 1rem;
  overflow: visible;
}

/* Logo */
.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: #0099ff; 
  letter-spacing: 2px;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Navigation */
nav {
  flex-grow: 1;
  margin-left: 2rem;
  min-width: 0; /* Prevent flex-item overflow */
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  user-select: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav ul::-webkit-scrollbar {
  height: 6px;
}

nav ul::-webkit-scrollbar-thumb {
  display: none;
}

nav ul::-webkit-scrollbar-track {
  background: transparent;
}

nav ul li a {
  color: #222;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.25s ease, color 0.25s ease;
  white-space: nowrap;
  font-size: 0.9rem;
  display: inline-block;
}

nav ul li a:hover,
nav ul li a.active {
  background-color: #bfa15a;
  color: #fff;
}

/* Cart Icon */
.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #222;
  user-select: none;
  flex-shrink: 0;
  margin-left: auto;
}

.cart-icon .cart-svg {
  width: 24px;
  height: 24px;
  stroke: #222;
  fill: none;
  display: block;
  transition: stroke 0.3s ease;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -10px;
  background-color: #bfa15a;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 1px 5px;
  border-radius: 50%;
  min-width: 16px;
  text-align: center;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  box-sizing: border-box;
}

/* Main Sections */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Container inside sections */
.section > .container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
  max-width: 1200px;
  overflow: visible;
  flex-wrap: nowrap;
}


h1,
h2 {
  font-weight: 700;
  color: #222;
  margin-bottom: 0;
  user-select: none;
  white-space: wrap;
  text-align: center;
}

h1 {
  font-size: 2rem;
  color: #bfa15a;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.7rem;
  margin-bottom: 1rem;
}

.section .container {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.container h1 span {
  color: #0099ff;
  font-weight: 700;
  font-size: 2rem;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.container p span {
  color: #0099ff;
  font-weight: 700;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.section-header h2 span {
  color: #0099ff;
  font-weight: 700;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background-color: #bfa15a;
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 0.55rem 1.8rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  transition: background-color 0.3s ease;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #a68b42;
  outline: none;
}

/* Beranda Section */
.beranda-section p {
  font-size: 1.1rem;
  color: #555;
  max-width: 550px;
  user-select: text;
  white-space: normal;
}

/* Catalog: Search and Filters Container */
.filters-search {
  flex-wrap: nowrap;
  gap: 1rem;
  justify-content: flex-start;
  margin-bottom: 2rem;
  user-select: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; /* space for scrollbar */
}

.filters-search::-webkit-scrollbar {
  height: 6px;
}

.filters-search::-webkit-scrollbar-thumb {
  background-color: rgba(191, 161, 90, 0.5);
  border-radius: 3px;
}

.filters-search::-webkit-scrollbar-track {
  background: transparent;
}

.filters-search input[type='text'] {
  flex: 1 0 280px;
  min-width: 220px;
  padding: 0.5rem 1rem;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  outline-offset: 2px;
  white-space: nowrap;
}

.filters-search input[type='text']:focus {
  border-color: #bfa15a;
  outline: none;
}

/* Filters container */
.filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  justify-content: flex-start;
  flex: 2 1 400px;
  min-width: 280px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filters::-webkit-scrollbar {
  height: 6px;
}

.filters::-webkit-scrollbar-thumb {
  background-color: rgba(191, 161, 90, 0.5);
  border-radius: 3px;
}

.filters::-webkit-scrollbar-track {
  background: transparent;
}

.filters select {
  padding: 0.5rem 1rem;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  background-color: #fff;
  cursor: pointer;
  user-select: auto;
  transition: border-color 0.3s ease;
  min-width: 120px;
  white-space: nowrap;
}

.filters select:hover,
.filters select:focus {
  border-color: #bfa15a;
  outline: none;
}

select option {
  background-color: #f0f0f0;
  color: #333333;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
  width: 100%;
}

.no-products {
  font-style: italic;
  color: #666;
  text-align: center;
}

/* Product Card */
.product-card {
  background-color: #fefefe;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 3px 8px rgb(191 161 90 / 0.15);
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: 0 3px 16px rgb(191 161 90 / 0.4);
}

.product-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: cover;
  user-select: none;
}

.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #222;
  user-select: text;
  white-space: normal;
}

.price {
  font-weight: 700;
  font-size: 1rem;
  color: #bfa15a;
  margin-bottom: 0.7rem;
  user-select: text;
}

.product-info {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  user-select: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-add-cart {
  background-color: #bfa15a;
  color: white;
  border: none;
  padding: 0.45rem 1.2rem;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn-add-cart:hover,
.btn-add-cart:focus {
  background-color: #a68b42;
  outline: none;
}

/* Testimonial Section */
.testimonial-section {
    padding: 60px 0;
    background-color: var(--light-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.overall-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.overall-rating .stars {
    color: var(--star-color);
    font-size: 1.2rem;
}

.overall-rating p {
    color: var(--dark-gray);
    font-size: 1rem;
}

/* Testimonial Grid */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.testimonial-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Updated CSS with yellow stars */
:root {
    --primary-color: #2c3e50;
    --star-full: #FFD700; /* Kuning untuk bintang penuh */
    --star-half: linear-gradient(90deg, #FFD700 50%, #e0e0e0 50%); /* Gradien untuk setengah bintang */
    --star-empty: #e0e0e0; /* Abu-abu untuk bintang kosong */
    --text-color: #333;
    --light-gray: #f5f5f5;
    --white: #ffffff;
}

/* Sistem Rating yang Diperbaiki */
.stars {
    display: inline-flex;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.star {
    position: relative;
    display: inline-block;
    color: var(--star-empty);
}

.star.full {
    color: var(--star-full);
}

.star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: var(--star-full);
}

.star.empty {
    color: var(--star-empty);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stars {
        font-size: 1rem;
    }
    
    .testimonial-card {
        padding: 15px;
    }
}

.date {
    color: var(--dark-gray);
    font-size: 0.85rem;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.6;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 600;
}

.user-age, .user-location {
    color: var(--dark-gray);
}

.user-location::before {
    content: "•";
    margin: 0 5px;
}

/* View All Button */
.view-all {
    text-align: center;
}

.view-all-btn {
    background-color: #a68b42;
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background-color: #a68b42;
    transform: translateY(-3px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .testimonial-section {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .testimonial-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .testimonial-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .user-info {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .user-location::before {
        display: none;
    }
}

/* Kontak */
.kontak-section form {
  max-width: 480px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  user-select: none;
}

.kontak-section label {
  font-weight: 600;
  color: #222;
  user-select: text;
}

.kontak-section input,
.kontak-section textarea {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 2px solid #ddd;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s ease;
  user-select: text;
}

.kontak-section input:focus,
.kontak-section textarea:focus {
  border-color: #bfa15a;
  outline: none;
}

.contact-message {
  margin-top: 1rem;
  font-weight: 600;
  text-align: center;
  white-space: normal;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background-color: #fff;
  box-shadow: -2px 0 20px rgb(0 0 0 / 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  user-select: none;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  overflow-x: hidden;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cart-header h3 {
  margin: 0;
  color: #bfa15a;
  user-select: text;
  font-size: 1.1rem;
  white-space: nowrap;
}

#closeCartBtn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #222;
  user-select: none;
  transition: color 0.2s ease;
  line-height: 1;
}

#closeCartBtn:hover {
  color: #a68b42;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  padding: 0.5rem 0;
  overflow-x: hidden;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  user-select: text;
  font-size: 0.9rem;
}

.cart-item-info p:last-child {
  color: #bfa15a;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-cart {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #bb4444;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  user-select: none;
  transition: color 0.3s ease;
}

.btn-remove-cart:hover {
  color: #8b2222;
}

.cart-footer {
  margin-top: 1rem;
  user-select: none;
}

.cart-total {
  font-weight: 700;
  font-size: 1.2rem;
  color: #bfa15a;
  margin-bottom: 1rem;
  user-select: text;
  white-space: nowrap;
}

#checkoutBtn {
  width: 100%;
  background-color: #bfa15a;
  color: #fff;
  padding: 0.7rem;
  font-weight: 700;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  user-select: none;
  white-space: nowrap;
}

#checkoutBtn:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

#checkoutBtn:not(:disabled):hover,
#checkoutBtn:not(:disabled):focus {
  background-color: #a68b42;
  outline: none;
}

/* Responsive */
/* Medium devices (tablets, 900px and below) */
@media (max-width: 900px) {
  .container {
    width: 95%;
  }

  nav ul {
    gap: 1rem;
    justify-content: flex-start;
  }

  .filters-search {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .filters {
    flex-wrap: wrap;
    justify-content: flex-start;/
  }

  .filters select,
  .filters-search input[type='text'] {
    width: auto;
    min-width: 140px;
  }

  .testimoni-list {
    flex-direction: column;
    max-width: 100%;
  }

  .cart-sidebar {
    width: 280px;
  }

  .section {
    flex-direction: column;
  }

  .section > .container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

/* Small devices (mobile phones, 600px and below) */
@media (max-width: 600px) {
  header {
    padding: 0.5rem 0.75rem;
  }

  .header-container {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .logo {
    font-size: 1.3rem;
    white-space: nowrap;
  }

  nav {
    margin-left: 1rem;
    flex-grow: 1;
    min-width: 0;
  }

  nav ul {
    gap: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  nav ul::-webkit-scrollbar {
    height: 6px;
  }

  nav ul::-webkit-scrollbar-thumb {
    background-color: rgba(191, 161, 90, 0.5);
    border-radius: 3px;
  }

  nav ul::-webkit-scrollbar-track {
    background: transparent;
  }

  nav ul li a {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
  }

  .filters-search {
    flex-wrap: nowrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .filters-search::-webkit-scrollbar {
    height: 6px;
  }

  .filters-search::-webkit-scrollbar-thumb {
    background-color: rgba(191, 161, 90, 0.5);
    border-radius: 3px;
  }

  .filters-search::-webkit-scrollbar-track {
    background: transparent;
  }

  .filters-search input[type='text'] {
    flex: 0 0 auto;
    width: 220px;
    min-width: 220px;
    white-space: nowrap;
  }

  .filters {
    flex-wrap: nowrap;
    gap: 1rem;
    flex: 0 0 auto;
    min-width: 320px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .filters::-webkit-scrollbar {
    height: 6px;
  }

  .filters::-webkit-scrollbar-thumb {
    background-color: rgba(191, 161, 90, 0.5);
    border-radius: 3px;
  }

  .filters::-webkit-scrollbar-track {
    background: transparent;
  }

  .filters select {
    flex: 0 0 auto;
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .beranda-section {
    flex-direction: column;
  }

  .beranda-section > .container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .beranda-section h1 {
    font-size: 1.7rem;
  }

  .beranda-section p {
    font-size: 1rem;
    max-width: 320px;
  }

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

  .cart-icon .cart-svg {
    width: 20px;
    height: 20px;
  }

  .cart-count {
    font-size: 0.65rem;
    padding: 1px 4px;
    min-width: 14px;
    top: -4px;
    right: -8px;
  }

  .cart-sidebar {
    width: 100vw;
    max-width: 100vw;
    padding: 1rem 1.5rem 1rem 1.5rem;
  }
}
/* Responsive Filter Search Styles */

/* Improved responsive layout for filters-search and filters */
.filters-search {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  padding-bottom: 4px;
}

.filters-search input[type='text'] {
  flex: 1 1 100%;
  min-width: 220px;
  max-width: 100%;
  width: 100%;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

.filters select {
  flex: 1 1 120px;
  min-width: 120px;
  max-width: 180px;
}

/* Popup Add to Cart */
.popup-add-cart {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #bfa15a;
  color: #ffffff;
  padding: 0.9rem 1.4rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 9999;
  text-align: center;
  max-width: 90%;
  width: fit-content;
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
}

.popup-add-cart.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Responsive font for smaller screens */
@media (max-width: 480px) {
  .popup-add-cart {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
    bottom: 1rem;
  }
}

/* Social Media Icons */
.social-media {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f5f5f5;
  color: #222;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Instagram specific */
.social-icon.instagram {
  background: radial-gradient(circle at 30% 107%, 
    #fdf497 0%, 
    #fdf497 5%, 
    #fd5949 45%, 
    #d6249f 60%, 
    #285AEB 90%);
  color: white;
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .social-media {
    gap: 1rem;
  }
  
  .social-icon {
    width: 36px;
    height: 36px;
  }
  
  .social-icon svg {
    width: 18px;
    height: 18px;
  }
}