/* Global Styles */
:root {
    --primary-yellow: #ffce00;
    --primary-white: #ffffff;
    --primary-black: #000000;
    --accent-red: #ff4d4d;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666666;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

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

body {
    background-color: var(--light-gray);
    color: var(--primary-black);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-y: none; /* Prevents bouncing on mobile */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 700;
}

.buy {
    color: var(--primary-black);
}

.hut {
    color: var(--primary-yellow);
}

.store {
    display: block;
    font-size: 12px;
    text-align: center;
    margin-top: -5px;
    color: var(--dark-gray);
}

.page-title {
    font-size: 18px;
    font-weight: 500;
}

.menu-icon {
    font-size: 20px;
    cursor: pointer;
}

.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-icon {
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

.header-icon:hover {
    color: var(--primary-yellow);
}

.wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Main Navigation */
.main-nav {
    display: flex;
    justify-content: flex-start;
    background-color: var(--primary-white);
    border-top: 1px solid var(--light-gray);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    flex: 0 0 auto;
    padding: 15px 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    color: var(--primary-yellow);
    background-color: rgba(255, 206, 0, 0.05);
}

.nav-item.active {
    color: var(--primary-black);
    border-bottom: 3px solid var(--primary-yellow);
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-nav {
        justify-content: flex-start;
        padding: 0 10px;
    }
    
    .nav-item {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .nav-item:first-child {
        margin-left: 5px;
    }
    
    .nav-item:last-child {
        margin-right: 5px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .store {
        font-size: 10px;
    }
}

/* Search Bar Styles */
.search-container {
    padding: 15px 20px;
    background-color: var(--primary-white);
    border-bottom: 1px solid var(--medium-gray);
    position: sticky;
    top: 60px;
    z-index: 90;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--light-gray);
    border-radius: 25px;
    padding: 0 15px;
    position: relative;
}

.search-bar i {
    color: var(--medium-gray);
    margin-right: 10px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    outline: none;
    font-size: 16px;
}

.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 5px;
}

.search-suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background-color: var(--light-gray);
}

.suggestion-code {
    font-weight: bold;
    margin-right: 10px;
    color: var(--primary-yellow);
}

.suggestion-name {
    flex: 1;
}

.disclaimer-container {
    overflow: hidden;
    padding: 5px 0;
    width: 100%; /* Make sure container takes full available width */
    box-sizing: border-box; /* Prevent padding from increasing width */
}

.disclaimer-ticker {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%; /* Start completely outside right */
    font-size: 12px;
    color: var(--accent-red);
    animation: ticker 48s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Custom Dropdown Styles */
.custom-dropdown-container {
    padding: 0 15px 15px;
    background-color: var(--primary-white);
}

.custom-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-dropdown-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--light-gray);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-dropdown-selected:hover {
    background-color: #eaeaea;
}

.custom-dropdown-selected i {
    transition: transform 0.3s ease;
}

.custom-dropdown.open .custom-dropdown-selected i {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background-color: var(--primary-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.custom-dropdown.open .custom-dropdown-menu {
    max-height: 300px;
    opacity: 1;
}

.custom-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-dropdown-item:hover {
    background-color: var(--light-gray);
}

.custom-dropdown-item.active {
    background-color: rgba(255, 206, 0, 0.2);
    font-weight: 500;
}

/* Category Navigation Styles */
.category-nav {
    display: flex;
    overflow-x: auto;
    padding: 15px 10px;
    background-color: var(--primary-white);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.category-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-chip {
    flex: 0 0 auto;
    padding: 8px 20px;
    margin: 0 5px;
    background-color: var(--light-gray);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-chip.active {
    background-color: var(--primary-yellow);
    color: var(--primary-black);
}

/* Loading Spinner Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Grid Styles */
.products-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.product-card {
    background-color: var(--primary-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.3s ease;
    margin-bottom: 5px;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image-container {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.share-icon:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.9);
}

.new-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-red);
    color: var(--primary-white);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.product-info {
    padding: 12px;
}

.product-code {
    font-size: 12px;
    color: var(--dark-gray);
    margin-bottom: 5px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}

.product-views {
    font-size: 12px;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.product-views i {
    margin-right: 5px;
}

.buy-button {
    display: block;
    width: 100%;
    padding: 8px 0;
    background-color: var(--primary-yellow);
    color: var(--primary-black);
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buy-button:hover {
    background-color: #e6b800;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--primary-white);
    margin: 60px auto 20px;
    width: 90%;
    max-width: 600px;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    color: var(--primary-white);
    background-color: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-image {
    width: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.modal-product-code {
    font-size: 14px;
    color: var(--dark-gray);
    margin-bottom: 5px;
}

.modal-product-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-product-price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-product-views {
    font-size: 14px;
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.modal-product-views i {
    margin-right: 5px;
}

.modal-product-description {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.modal-buy-button {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: var(--primary-yellow);
    color: var(--primary-black);
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
}

.related-products {
    padding: 20px;
    background-color: var(--light-gray);
}

.related-products h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.related-products-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.related-products-container::-webkit-scrollbar {
    display: none;
}

.related-product-card {
    flex: 0 0 150px;
    background-color: var(--primary-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.related-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-product-info {
    padding: 10px;
}

.related-product-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
}

.related-product-price {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.related-product-views {
    font-size: 11px;
    color: var(--dark-gray);
}

.related-product-views i {
    margin-right: 3px;
}

/* Bottom Sheet Menu Styles */
.bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.5);
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet.active {
    display: block;
    opacity: 1;
}

.bottom-sheet-content {
    background-color: var(--primary-white);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bottom-sheet.active .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bottom-sheet-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-sheet {
    font-size: 24px;
    cursor: pointer;
}

.menu-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--medium-gray);
    font-size: 16px;
    cursor: pointer;
}

.menu-item:last-child {
    border-bottom: none;
}

/* WhatsApp Icon Styles */
.whatsapp-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #25D366;
    color: var(--primary-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
}
.social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 15px;
  margin-top: -5px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  background: #000;
  color: #fff;
  font-size: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: 0.3s ease;
}

.social-icons a:hover {
  background-color: #fdd835;
}

/* Toast Message Styles */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--primary-white);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 1000;
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-content i {
    margin-right: 10px;
}

/* Media Queries */
@media (min-width: 768px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .modal-content {
        max-width: 800px;
    }
}
