/* ==================================================  RESET ================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fafafa;
  color: #222;
}
/* ================================================== LAYOUT ================================================== */

    .container {
      display: grid;
      grid-template-columns: 1fr;
      gap: 20px;
      max-width: 100%;
      margin: auto;
      width: 100%;
      padding: 20px 20px;
      min-height: 100vh;
    }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 250px));
  justify-content: center;
  gap: 20px;
  width: 100%;
}

    .content-center {
    max-width: 900px; 
    margin: 0 auto;  
    }

/* ================================================== COMPONENT ================================================== */
    .card {
      background: #fff;
      border-radius: 14px;
      overflow: hidden;
      transition: all 0.25s ease;
      border: 1px solid #eee;
    }
    .card:hover {
      transform: translateY(-6px);
      box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    }
    .card img {
      width: 100%;
      aspect-ratio: 1/1;
      object-fit: cover;
      transition: transform 0.4s ease;
    }
    .card-content {
       padding: 10px 12px;
    }
    .btn {
      display: inline-block;
      padding: 10px 14px;
      background: black;
      color: white;
      border-radius: 8px;
      font-size: 13px;
      transition: all 0.2s ease;
    }
    .card-link {
        display: block;
        color: inherit;
        text-decoration: none;
    }
    .card:hover img {
        transform: scale(1.08);
    }
    .card img.loaded {
        opacity: 1;
        }
    .card img {
        display: block;
        }

    .card-content h4 {
        margin: 6px 0 0 0;
        font-size: 12px;
        line-height: 1.3;
        }
    .btn:hover {
        background: #333;
        }
/* ================================================== HEADER ================================================== */
    .main-header {
        justify-content: space-between;
        align-items: center;
        padding: 15px 30px;
        background: white;
    }
    .top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 10px;
        background: white;
        border-bottom: 1px solid #eee;
        }
 
    .breadcrumb {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        font-size: 14px;
        color: #777;
        margin-bottom: 0px;
        font-size: 13px;
        flex: 0 0 auto;
}
        .search-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 30px;
        background: #fafafa;
        max-width: 100%;
        overflow: visible;
        }
    .logo img {
        display: block;
        height: 28px;
        width: auto;
    }
    
    .top-bar {
        max-width: 100%;
        overflow: visible;
        }

    .breadcrumb a {
      color: #777;
      text-decoration: none;
    }
    .breadcrumb a:hover {
        text-decoration: underline;
        }
    .breadcrumb span {
        color: #000;
        }
/* ================================================== DROPDOWN ================================================== */
    .category-wrapper {
        position: relative;
        flex-shrink: 0;
        margin-left: 50px;
    }
    .category-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: 8px;
        border: 1px solid #ccc;
        background: white;
        cursor: pointer;
        height: 40px;
        white-space: nowrap;
        flex-shrink: 0;  
    }
    .category-wrapper{
      position: relative;
    }
.category-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 260px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.25s ease;
}
        
    .menu-wrapper {
        position: relative;
        }
    .menu-toggle {
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        padding: 5px 10px;
        }
    .menu-dropdown {
        position: absolute;
        right: 0;
        top: 120%;
        background: white;
        border-radius: 8px;
        padding: 8px;
        min-width: 140px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        transform-origin: top right;

        transition: 
            opacity 0.25s ease,
            transform 0.25s ease;
        z-index: 9999;
        }
    .menu-dropdown.active {
        opacity: 1;
        transform: translateY(0) scale(1);

        }
    .category-dropdown a {
        display: block;
        padding: 8px;
        color: #333;
        text-decoration: none;
        }
    .category-dropdown a:hover {
        background: #f5f5f5;
        }

    .category-dropdown.active{
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    .menu-dropdown a {
        display: block;
        padding: 8px;
        text-decoration: none;
        color: #333;
        }
    .menu-dropdown a:hover {
        background: #f5f5f5;
        }

/* ================================================== CONTENT ================================================== */
    .desc {
        margin: 5px 0;
        color: #555;
        line-height: 1.5;
    }
    .desc-text {
        text-align: center;
        max-width: 600px;
        margin: 0 auto 20px auto;
        color: #555;
        line-height: 1.6;
        }
    .popular-wrapper {
        text-align: center;
        margin-bottom: 25px;
        }
    .popular {
        margin: 5px 0;
        font-size: 14px;
        }
    .popular a {
        padding: 8px 16px;
        border-radius: 20px;
        border: 1px solid #ddd;
        background: white;
        font-size: 13px;
        text-decoration: none;
        color: #333;
        transition: all 0.2s ease;
        }
    .translate-info {
        text-align: center;
        font-size: 13px;
        color: #888;
        margin-bottom: 8px;
        }
    .container h1 {
        margin: 5px 0 ;
        text-align: center;
    }
    .container h1 + div {
        margin-bottom: 10px;
    }
    .container p {
        margin: 5px 0 10px 0;
    }
    .popular-title {
        font-size: 14px;
        color: #777;
        margin-bottom: 10px;
    }

    .popular {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .popular a:hover {
        background: black;
        color: white;
        border-color: black;
    }
/* ================================================== UTILITIES ================================================== */
    h1, p, a, h4 {
        overflow-wrap: break-word;
    }
    .divider {
        height: 1px;
        background: #e5e5e5;
    }
    #toast {
        pointer-events: none;
    }
    .search-form button:active {
        transform: scale(0.9);
    }

    .hamburger {
        width: 15px;
        height: 2px;
        background: #ff6600;
        position: relative;
        display: inline-block;
        }
    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 15px;
        height: 2px;
        background: #ff6600;
        left: 0;
    }
    .hamburger::before {
        top: -6px;
    }
    .hamburger::after {
        top: 6px;
    }
    .logo-desktop {
        display: block !important;
        height: 28px;
    }
    .logo-mobile {
        display: none !important;
    }
    .category-group{
  border-bottom:1px solid #f1f5f9;
}

.category-parent{
  width:100%;
  border:none;
  background:none;
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  color:#111827;
  transition:0.35s;
}

.category-parent:hover{
  background:#f9fafb;
}

.category-submenu{
  display:none;
  padding-bottom:10px;
  max-height:0;
  overflow:hidden;
  transition:max-height 0.35s ease;
}

.category-group.active .category-submenu{
  display:block;
}

.category-submenu a{
  display:block;
  padding:10px 24px;
  text-decoration:none;
  color:#4b5563;
  font-size:14px;
}

.category-submenu a:hover{
  background:#f9fafb;
}

.category-all{
  font-weight:600;
  color:#111827 !important;
}

.category-icon{
  font-size:18px;
  line-height:1;
  transition:0.25s;
  font-size:18px;
}


/* ==================================================  MEDIA QUERY ================================================== */
@media (max-width: 1024px) {
                header {
                    padding: 15px 20px;
                }
}
@media (max-width: 768px) {
            .container {
                padding: 15px;
                gap: 10px;
            }
            h1 {
              font-size: 22px;
            }
            .container h1 {
                margin: 5px 0;
            }
            .container p {
                margin: 5px 0;
            }                        
        
            .main-header {
              flex-direction: column;
              align-items: flex-start;
              gap: 10px;
            }
            .top-bar {
              display: flex;
              align-items: center;
              justify-content: space-between;
            }

            .logo-desktop {
              display: none !important;
            }
            .logo-mobile {
              display: block !important;
              height: 28px;
            }
            .breadcrumb {
              flex: 1;
              min-width: 0;
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
            }
            .category-btn {
              height: 40px;
              flex-shrink: 0;
            }
            .category-btn .text {
              display: none;
            }
            .search-header {
              display: flex;
              align-items: center;
              gap: 8px;
              padding: 12px 15px; 
            }
            .search-form-header {
              flex: 1;
              display: flex;
              align-items: center;
              height: 40px;
              min-width: 0;
            }
            .search-form-header input {
              flex: 1;
              height: 40px;
              padding: 0 10px;
              border-radius: 8px 0 0 8px;
            }
            .search-form-header button {
              position: static; /* override desktop */
              width: 40px;
              height: 40px;
              border-radius: 0 8px 8px 0;
              background: #e9e9e9;
              display: flex;
              align-items: center;
              justify-content: center;
            }
            .products {
              grid-template-columns: repeat(2, 1fr);
              gap: 10px;
            }
              .category-wrapper{
              margin-left: 5px;
            }

            }
@media (max-width: 480px) {

              .card-content h4 {
                margin: 6px 0 0 0; 
                font-size: 15px; 
                line-height: 1.3;
              }
              .btn {
                width: 100%;
                text-align: center;
                padding: 8px;
              }

              input[type="text"] {
                width: 100%;
                margin-bottom: 10px;
              }

              form:not(.search-form-header) {
                display: flex;
                flex-direction: column;
              }
                }

/* ==================================================  SEARCH ================================================== */
.search-form-header {
  flex: 1;
  display: flex;
  align-items: stretch; 
  min-width: 200px;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}

.search-form-header input {
  flex: 1;
  height: 40px;
  padding: 0 12px; 
  border: none;
  outline: none;
  background: #e9e9e9;
  border-radius: 8px 0 0 8px;
  box-sizing: border-box;
}
.cart-icon {
  font-size: 20px;
  text-decoration: none;
  color: #222;
  padding: 6px 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
   
}
.cart-svg {
  width: 22px;
  height: 22px;
  display: block;
}
.cart-icon:hover {
  transform: scale(1.1);
}

/* BADGE ANGKA */
#cart-count {
  position: absolute;
  top: -5px;
  right: -5px;

  background: red;
  color: white;

  font-size: 11px;
  font-weight: 600;

  padding: 3px 3px;
  border-radius: 999px;

  min-width: 18px;
  text-align: center;
  line-height: 1;

  display: inline-block;

  pointer-events: none;
}
.search-form-header button {
  height: 40px;
  width: 45px;
  border: none;
  background: #e9e9e9;
  border-radius: 0 8px 8px 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}
