/* Custom Styling untuk Srenceng E-Commerce */

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Product card */
.product-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Cart badge pulse */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.cart-pulse { animation: pulse 0.3s ease; }

.qty-input {
    width: 50px; text-align: center;
    border: 1px solid #d1d5db; border-radius: 6px; padding: 4px; font-weight: bold;
}
.qty-input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.toast-show { transform: translateY(0) !important; opacity: 1 !important; }

.product-img { aspect-ratio: 1/1; object-fit: cover; background-color: #f3f4f6; }
@media (max-width: 640px) { .product-card img { height: 200px; } }

.cart-item { transition: all 0.3s ease; }
.cart-item:hover { background-color: #f9fafb; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* =====================================================
   CAROUSEL STYLING
   ===================================================== */
.carousel-container { position: relative; min-height: 420px; overflow: hidden; }
.carousel-track { display: flex; will-change: transform; }
.carousel-slide {
    min-width: 100%; display: flex; align-items: center;
    padding: 2.5rem; color: white; position: relative; overflow: hidden;
}
.carousel-slide::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.1), transparent 60%);
    pointer-events: none;
}
.slide-content { flex: 1; z-index: 2; max-width: 50%; }
.slide-image-wrapper { flex: 1; display: flex; justify-content: center; align-items: center; z-index: 2; }
.slide-image {
    width: 280px; height: 280px; object-fit: cover;
    border-radius: 1rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s ease;
}
.carousel-slide:hover .slide-image { transform: scale(1.05) rotate(-2deg); }
.slide-badge {
    display: inline-block; background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px); padding: 0.25rem 0.75rem;
    border-radius: 999px; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.05em; margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.slide-title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
.slide-description { font-size: 1rem; opacity: 0.95; margin-bottom: 1.25rem; line-height: 1.5; }
.slide-price { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }
.slide-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: white; color: #4f46e5; padding: 0.75rem 1.5rem;
    border-radius: 999px; font-weight: 600; transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.slide-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); }
.carousel-dot {
    width: 10px; height: 10px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.5); cursor: pointer;
    transition: all 0.3s ease; border: none;
}
.carousel-dot.active { background: white; width: 30px; }
.carousel-dot:hover { background: rgba(255, 255, 255, 0.8); }
.carousel-arrow { transition: all 0.3s ease; }
.carousel-arrow:hover { transform: scale(1.1); background: #eef2ff !important; }

@media (max-width: 768px) {
    .carousel-container { min-height: 500px; }
    .carousel-slide { flex-direction: column-reverse; padding: 1.5rem; text-align: center; }
    .slide-content, .slide-image-wrapper { max-width: 100%; }
    .slide-image { width: 180px; height: 180px; margin-bottom: 1rem; }
    .slide-title { font-size: 1.5rem; }
    .slide-price { font-size: 1.25rem; }
    .slide-description { font-size: 0.9rem; }
}

/* =====================================================
   BOTTOM NAVIGATION MOBILE (BARU)
   ===================================================== */

/* Efek transisi saat item aktif */
.bottom-nav-item {
    position: relative;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Indikator aktif - garis atas + warna */
.bottom-nav-item.active {
    color: #4f46e5; /* indigo-600 */
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 0 0 4px 4px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Efek ripple saat diklik */
.bottom-nav-item:active {
    transform: scale(0.92);
}

/* Efek hover icon saat aktif */
.bottom-nav-item.active i {
    transform: translateY(-2px);
    transition: transform 0.25s ease;
}

/* Badge di mobile bottom nav */
#cart-badge-mobile {
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Safe area untuk notch/home indicator di iPhone notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(4rem + env(safe-area-inset-bottom));
    }
    body {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
}