/* Reset & Base */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    padding-top: 80px; /* untuk fixed header */
}

html {
    scroll-behavior: smooth;font-size: clamp(14px, 2.5vw + 0.5rem, 16px);
}

/* Header */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    height: 70px;
    z-index: 1030;
}

.logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: #166b19 !important;
    text-decoration: none;
}

.logo-text span {
    color: #212529;
}

/* Icon Buttons */
.icon-btn {
    position: relative;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f1f1;
    transition: all 0.3s ease;
    color: #495057;
}

.icon-btn:hover {
    background: #166b19;
    color: white;
    transform: translateY(-3px) scale(1.05);
}

/* Badge Counter */
.badge-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Filter */
.sidebar-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background: white;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
    z-index: 1050;
}

.sidebar-filter.active {
    transform: translateX(0);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h6 {
    font-weight: 600;
    color: #166b19;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.form-check-label {
    cursor: pointer;
    transition: color 0.3s ease;
}

.form-check-input:checked + .form-check-label {
    color: #166b19;
    font-weight: 500;
}

.price-range-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range-input input {
    width: 100px;
    text-align: center;
}

.sort-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.sort-btn:hover {
    background: #e9f7ef;
    color: #166b19;
}

.sort-btn.active {
    background: #166b19;
    color: white;
    font-weight: 500;
}

.reset-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    width: 100%;
    font-weight: 500;
    transition: background 0.3s ease;
}

.reset-btn:hover {
    background: #c82333;
}

/* Search Mobile */
.mobile-search {
    margin: 1rem 0;
    display: none;
}

@media (max-width: 767.98px) {
    .main-header {
        height: 60px;
    }
    body {
        padding-top: 70px;
    }
    .logo-text {
        font-size: 1.3rem;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
    }
    .mobile-search {
        display: block;
    }
    .desktop-search {
        display: none !important;
    }
    .sidebar-filter {
        width: 280px;
    }
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    justify-content: flex-end;
}

.view-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: #f1f1f1;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #e9f7ef;
    color: #166b19;
}

.view-btn.active {
    background: #166b19;
    color: white;
}

/* Product Grid & List */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    cursor: pointer;
}

.product-card.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effect untuk Card */
.hover-shadow {
    transition: all 0.4s ease;
}

.hover-shadow:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
    z-index: 10;
}

.product-grid .card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

.product-grid .card-img-top {
    transition: transform 0.5s ease;
}

.hover-shadow:hover .card-img-top {
    transform: scale(1.1);
}

/* Quick Action Buttons */
.quick-actions {
    position: absolute;
    top: auto;bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.hover-shadow:hover .quick-actions {
    opacity: 1;
    visibility: visible;
}

.quick-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #166b19;
    color: white;
    transform: scale(1.15);
}

/* Badge Harga Mulai Dari */
.price-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #166b19;
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* List View */
.card-list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.card-list:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.card-list img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.card-list .info {
    flex: 1;
}

.card-list .info h5 {
    margin-bottom: 0.8rem;
    color: #212529;
}

.card-list .price-large {
    font-size: 1.8rem;
    font-weight: 700;
    color: #166b19;
}

.rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skeleton Loading */
.skeleton, .initial-skeleton {
    background: #e9ecef;
    border-radius: 8px;
    animation: pulse-skeleton 1.5s ease-in-out infinite;
}

.initial-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse-skeleton {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.skeleton-img, .initial-skeleton > div[style*="height:200px"] {
    height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Quick View Modal */
.quickview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.quickview-modal.active {
    opacity: 1;
    visibility: visible;
}

.quickview-content {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: row;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.quickview-modal.active .quickview-content {
    transform: scale(1);
}

.quickview-image {
    flex: 1;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.quickview-details {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.quickview-details h3 {
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
}

.variant-option {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: left;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-option:hover {
    border-color: #166b19;
    background: #f8fff9;
}

.variant-option.active {
    border-color: #166b19;
    background: #e9f7ef;
    font-weight: 600;
}

.variant-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #166b19;
    float: right;
}

.variant-stock {
    color: #6c757d;
    font-size: 0.9rem;
}

.quickview-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.btn-add-cart {
    flex: 1;
    padding: 1rem;
    background: #166b19;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background: #218838;
    transform: translateY(-3px);
}

.btn-wishlist-modal {
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #166b19;
    color: #166b19;
    border-radius: 12px;
    font-weight: 600;
}

.btn-wishlist-modal:hover {
    background: #166b19;
    color: white;
}

.btn-whatsapp {
    flex: 1;
    padding: 1rem;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-whatsapp:hover {
    background: #128C7E;
}

/* Wishlist Modal */
.wishlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.wishlist-modal.active {
    opacity: 1;
    visibility: visible;
}

.wishlist-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.wishlist-modal.active .wishlist-content {
    transform: scale(1);
}

.wishlist-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.wishlist-header h4 {
    margin: 0;
    font-weight: 700;
    color: #212529;
}

.wishlist-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 0;
}

.wishlist-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.3s ease;
}

.wishlist-item:hover {
    background: #f8fff9;
}

.wishlist-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 1.5rem;
}

.wishlist-info {
    flex: 1;
}

.wishlist-info h6 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.wishlist-variant {
    font-size: 0.9rem;
    color: #6c757d;
}

.wishlist-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #166b19;
}

    .wishlist-actions {
        display: flex;
        gap: 0.75rem;
        flex-direction: row;
        margin-top: 1rem;
        width: 100%;
    }
    .wishlist-actions button {
        flex: 1;
    }


.btn-move-cart {
    background: #166b19;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-move-cart:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-remove-wishlist {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-remove-wishlist:hover {
    background: #c82333;
}

.wishlist-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.wishlist-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.cart-modal.active {
    opacity: 1;
    visibility: visible;
}

.cart-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cart-modal.active .cart-content {
    transform: scale(1);
}

.cart-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-header h4 {
    margin: 0;
    font-weight: 700;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #f1f1f1;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 1.5rem;
}

.cart-info {
    flex: 1;
}

.cart-info h6 {
    margin: 0 0 0.5rem 0;
}

.cart-variant {
    font-size: 0.9rem;
    color: #6c757d;
}

.cart-price {
    font-weight: 600;
    color: #212529;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0px;margin-top: 10px;
}

.quantity-btn {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #166b19;
    color: white;
}

.quantity-input {
    width: 45px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 0.5rem;
}

.cart-subtotal {
    font-weight: 700;
    color: #166b19;
}

.cart-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #166b19;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: #166b19;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: #218838;
    transform: translateY(-3px);
}

.checkout-form {
    display: none;
    padding: 2rem;
    background: #f8fff9;
}

.checkout-form.active {
    display: block;
}

.form-control-lg {
    padding: 1rem;
    font-size: 1.1rem;
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.cart-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Responsive Grid */
@media (max-width: 1399.98px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1199.98px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767.98px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .product-grid .card-body {
        padding: 1rem;
    }
    .card-list {
        flex-direction: column;
        text-align: center;
    }
    .card-list img {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    .quickview-content {
        flex-direction: column;
        width: 95%;
    }
    .quickview-image {
        min-height: 150px;
    }
    .wishlist-item img, .cart-item img {
        margin-bottom: 1rem;
        margin-right: 0;
    }
}

/* Final Polish */
.btn:focus, .icon-btn:focus, .view-btn:focus, .quick-btn:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3) !important;
}

@media (hover: none) {
    .hover-shadow:active {
        transform: translateY(-4px) scale(1.03);
    }
    .icon-btn:active, .view-btn:active {
        transform: scale(0.95);
    }
    .quick-btn:active {
        transform: scale(0.9);
    }
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.swal2-toast {
    font-family: 'Poppins', sans-serif !important;
}
h1 { font-size: clamp(17px, 5vw,18px); }
h2 { font-size: clamp(16px, 4.5vw, 17px); }
h3 { font-size: clamp(15px, 4vw, 16px); }
h4 { font-size: clamp(14px, 3.5vw, 15px); }
h5 { font-size: clamp(12px, 3vw, 14px); }
h6 { font-size: clamp(12px, 2.5vw, 14px); }

/* Small text (caption, small, text-muted) tetap nyaman */
small, .small, .text-muted {
    font-size: clamp(12px, 1.8vw, 14px);
}
@media (max-width: 991.98px) {
    html {
        font-size: 12px; /* atau 18px untuk efek zoom lebih kuat */
    }
}

@media (max-width: 576px) {
    html {
        font-size: 10px; /* HP kecil tetap nyaman */
    }
}