/* Add to existing marketplace.css */
.search-submit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0 10px;
}

.product-tags {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.product-tag {
    display: none;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.search-form {
    width: 100%;
}

.cart-highlight {
    animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
}

:root {
    --primary-color: #19241d;
    --secondary-color: #ff6b35;
    --accent-color: #20b7dd;
    --dark-color: #1a1a1a;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Public Sans', sans-serif;
    background: #f5f5f5;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Marketplace */
.marketplace-header {
    background: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.container.header-content {padding:0 10px 0 0;}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(
    to top,
    #0f2027,
    #203a43,
    #2c5364
);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search Bar Enhanced */
.marketplace-search {
    flex: 1;
    max-width: 600px;
}

.search-container {
    position: relative; /* Penting untuk dropdown absolute */
}

.search-box {
    background: #f8f9fa;
    border-radius: 25px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    z-index: 1002;
    position: relative;
    background-clip: padding-box;
}

.search-box:focus-within {
    border-color: none;
    background: white;
}

.search-icon {
    color: var(--gray-color);
    font-size: 18px;
}

.search-input {
    font-family: inherit;
    border: none;
    background: none;
    font-size: 16px;
    width: 100%;
    outline: none;
    color: var(--dark-color);
}

.search-input::placeholder {
    font-size: 14px;
    font-weight:300;
    color: #999;
}

/* Remove default x button on search input in some browsers */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration { 
    display: none; 
}

/* SMART SEARCH DROPDOWN STYLING */
/* SMART SEARCH DROPDOWN STYLING */
.search-dropdown {
    position: absolute;
    top: 60px;              /* sesuaikan tinggi header/search bar */
    left: 0;
    width: 100%;           /* FULL LAYAR */
    max-width: 100vw;
    background: #fff;
    z-index: 9999;
    box-shadow: 0 8px 5px rgba(0,0,0,0.05);
    padding: 16px;
    display: none;
}

.search-dropdown-header {
    padding: 10px 20px;
    font-size: 13px;
    color: #999;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-dropdown-header i {
    color: #ff6b35; /* Api icon color */
}

.search-item {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
    font-size: 14px;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.search-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-icon {
    font-size: 12px;
    color: #ccc;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-wrapper {
    position: relative;
}

.cart-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--dark-color);
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    background:linear-gradient(
    to top,
    #0f2027,
    #203a43,
    #2c5364
);
    color: white;
    padding: 20px 10px;
    margin-bottom: 30px;
    border-radius: 0 0 20px 20px;
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff, #e0f7fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
}

.hero-search .search-box {
    background: rgba(255,255,255,0.2);
}

.hero-search .search-icon {
    color: white;
}

.hero-search .search-input {
    color: white;
}

.hero-search .search-input::placeholder {
    color: white;
}

/* Categories */
.categories-section {
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.section-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--dark-color);
}

.see-all {
    font-size: 12px;
    color: #3492eb;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    background:;
    border-radius: 12px;
    padding: 10px 7px;
    border: 1px solid transparent;
}

.category-image {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
    color: var(--dark-color);
}

/* Products Grid */
.products-section {
    padding: 30px 0;
}

/* New CSS for Country Filter */
.country-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-label {
    font-size: 13px;
    color: #666;
    margin-right: 5px;
}

.country-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    height: 32px;
}

.country-pill img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.country-pill.active {
    background: transparent;
    border-color: #616663;
    color:#616663;
    font-weight: 600;
}

.country-pill:hover {
    background: #e9ecef;
}

/* New CSS for Country Flag in Product Card */
.country-flag-badge {
    position: absolute;
    bottom: -7px;
    left: 0;
    width: 24px;
    height: auto;
    overflow: hidden;
    z-index: 3;
}

.country-flag-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-flag-mini {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid white;
}

.store-flag-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card-avatar {
    position: relative; /* needed for mini flag */
}

/* End New CSS */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 15px;
}

.product-card-link {
    height: fit-content;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card-link:hover {
    transform: translateY(-1px);
}

.product-card {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    height: fit-content;
}

.product-card:hover {
    transform: none;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgb(0, 0, 0);
    color: white;
    padding: 1px 4px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 300;
    z-index: 2;
    font-family: inherit;
}

.product-image {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card-link:hover .product-image img {
    transform: scale(1.05);
}

.product-content {
    padding: 12px;
}

.product-store {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.store-avatar {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.store-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-name {
    font-size: 11px;
    color: var(--gray-color);
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-title {
    line-height: normal;
    font-size: clamp(0.8rem, 1vw + 0.5rem, 0.9rem);
    font-weight: 300;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    line-height:normal;
    color: #f73062;
    font-size: 18px;
    font-weight: 700;
}

.product-rating {
    display: flex;
    align-items: center;
}

.stars-single {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.stars-single .fa-star {
    color: #ffc107;
    font-size: 10px;
}

.rating-value {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    margin-left: 3px;
}

.rating-separator {
    margin: 0 5px;
    color: #999;
}

.review-count {
    color: #666;
    font-size: 10px;
}

/* Cart overlay di gambar produk */
.cart-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    border: none;
    font-size: 16px;
}

.cart-overlay:hover {
    background: linear-gradient(
    to top,
    #0f2027,
    #203a43,
    #2c5364
);
    color: white;
    transform: scale(1.1);
}

/* Popular Stores */
.stores-section {
    padding: 30px 0;
}

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.store-card {
    background: white;
    border-radius: none;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--dark-color);
}

.store-card:hover {
    transform: translateY(-1px);
}

.store-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.store-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card-info {
    justify-content: flex-start;
    text-align: left;
}

.store-card-name {
    font-size: 18px;
    font-weight: 400;
    color: var(--dark-color);
}

.store-card-rating {
    justify-content: ;
    font-size: 10px;
    display: flex;
    align-items: center;
}

.store-card-description {
    font-size: 14px;
    color: var(--gray-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.marketplace-footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bbb;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #bbb;
    font-size: 14px;
}

/* Flash Message */
.flash-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease;
    cursor: pointer;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal variant styles */
.variant-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.variant-modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.4s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(
  to top,
  rgba(15, 32, 39, 0.7),
  rgba(32, 58, 67, 0.75),
  rgba(32, 132, 199, 0.8)
);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #ffd700;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.variant-select, .quantity-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.variant-select:focus, .quantity-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 84, 0.1);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 150px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quantity-input {
    text-align: center;
    max-width: 80px;
}

.total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.total-label {
    font-weight: 600;
    color: var(--dark-color);
}

.total-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #008744;
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Cart highlight effect */
.cart-highlight {
    animation: cartPulse 0.6s ease;
}

@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .logo-text {display:none;}
    .header-content {
        gap: 15px;
    }
    
    .marketplace-search {
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
    
    .cart-overlay {
        width: 32px;
        height: 32px;
        bottom: 8px;
        right: 8px;
        font-size: 14px;
    }
    
    .stars-single {
        font-size: 12px;
    }
    
    .variant-modal-content {
        margin: 10px;
        max-height: 80vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .store-card {
        text-align: center;
        padding: 7px;
    }
    
    .store-card-avatar {
        width: 35px;
        height: 35px;
    }
    
    .store-card-name {
        line-height: normal;
        font-size: 12px;
    }

    .country-filter {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .search-dropdown {
    position: fixed;
    top: 60px;              /* sesuaikan tinggi header/search bar */
    left: 0;
    width: 100vw;           /* FULL LAYAR */
    max-width: 100vw;
    background: #fff;
    z-index: 9999;
    box-shadow: 0 8px 5px rgba(0,0,0,0.05);
    padding: 16px;
    display: none;
}
    .logo img {display:none;}
    .store-card-description {
    font-size: 10px;
    color: var(--gray-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: normal;
}
    .stores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
    .search-input {
    font-family: inherit;
    border: none;
    background: none;
    font-size: 12px;
    width: 100%;
    outline: none;
    color: grey;
}
.search-box {
    background: #f8f9fa;
    border-radius: 25px;
    padding: 5px 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}
    .marketplace-header {
        position: static;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-content {
        padding: 8px;
    }
    .categories-section {margin-bottom: 15px;}
    .container {
        padding: 0 10px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
   .product-image {height:165px;}
    
    .product-title {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .cart-overlay {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .variant-modal-content {
        max-width: 95%;
    }
}