/* assets/css/catalog.css */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f0f9ff;
    color: #1e293b;
    overflow-x: hidden;
}

.catalog-header {
    background: linear-gradient(135deg, #020617 0%, #0f4c81 100%);
    padding: 60px 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.catalog-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(56,189,248,0.1) 0%, rgba(255,255,255,0) 60%);
    animation: rotate 20s linear infinite;
}

.catalog-title {
    font-size: 3rem;
    font-weight: 900;
    margin: 0;
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, #bae6fd, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(186, 230, 253, 0.4);
    animation: slide-down 0.8s ease-out forwards;
}

.catalog-subtitle {
    color: #93c5fd;
    font-size: 1.2rem;
    margin-top: 15px;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fade-in 1s ease forwards;
    animation-delay: 0.5s;
}

.login-link {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    text-decoration: none;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    transition: color 0.3s;
    font-weight: 500;
}

.login-link:hover {
    color: #bae6fd;
}

/* Floating Cart Button */
.cart-floating-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #0f4c81;
    border-radius: 50px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border: none;
    transition: all 0.3s;
    border: 2px solid rgba(56, 189, 248, 0.2);
}

.cart-floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(14, 165, 233, 0.3);
    border-color: #38bdf8;
}

.cart-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
    border: 2px solid white;
}

/* Layout Container */
.container {
    max-width: 1300px;
    margin: -30px auto 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* Product Grid: 4 Items per row */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.1), 0 4px 6px -2px rgba(14, 165, 233, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(56, 189, 248, 0.1);
    opacity: 0;
    transform: translateY(30px);
    animation: fade-up 0.6s forwards;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.2), 0 10px 10px -5px rgba(14, 165, 233, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.product-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #f1f5f9;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.img-container {
    overflow: hidden;
    position: relative;
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    z-index: 2;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #0f172a;
    line-height: 1.4;
}

.price-container {
    margin-top: auto;
    background: #f0f9ff;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed #bae6fd;
}

.harga-coret {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

.harga-jual {
    font-weight: 800;
    font-size: 1.3rem;
    color: #0284c7;
}

.badge-grosir {
    display: inline-block;
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 8px;
}

/* Modals General */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(241, 245, 249, 0.8);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    z-index: 10;
}

.modal-close-btn:hover { background: #e2e8f0; color: #0f172a; }

/* Product Detail Modal */
.detail-modal {
    background: white;
    width: 90%;
    max-width: 900px;
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-overlay.active .detail-modal { transform: scale(1); }

.detail-img-section {
    flex: 1;
    background: #f8fafc;
}

.detail-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-info-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.detail-category {
    color: #0ea5e9;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.detail-desc {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-add-cart {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    margin-top: auto;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

@media (max-width: 768px) {
    .detail-modal { flex-direction: column; overflow-y: auto; }
    .detail-img-section { height: 300px; flex: none; }
    .detail-info-section { padding: 25px; overflow-y: visible; }
}

/* Cart Modal */
.cart-modal {
    background: white;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    position: absolute;
    right: -100%;
    top: 0;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.modal-overlay.active .cart-modal { right: 0; }

.cart-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0; font-size: 1.4rem; color: #0f4c81; display: flex; align-items: center; gap: 10px;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px 30px;
}

.cart-items { margin-bottom: 25px; }

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item-info h4 { margin: 0 0 5px 0; font-size: 0.95rem; color: #1e293b; }
.cart-item-price { color: #0284c7; font-weight: 700; font-size: 0.95rem; }

.qty-control {
    display: flex; align-items: center; gap: 10px; background: #f1f5f9; border-radius: 8px; padding: 4px;
}

.qty-btn {
    width: 28px; height: 28px; border-radius: 6px; border: none; background: white; cursor: pointer; font-weight: bold;
}

.cart-total {
    display: flex; justify-content: space-between; font-weight: 800; font-size: 1.3rem; margin-bottom: 25px; padding-top: 15px; border-top: 2px dashed #bae6fd;
}

.checkout-form .form-group { margin-bottom: 18px; }
.checkout-form label { display: block; font-size: 0.85rem; color: #475569; margin-bottom: 6px; font-weight: 600; }
.checkout-form input, .checkout-form textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-family: inherit; box-sizing: border-box; background: #f8fafc; }
.checkout-form input:focus, .checkout-form textarea:focus { border-color: #38bdf8; background: white; outline: none; }

.btn-checkout {
    width: 100%; padding: 16px; background: linear-gradient(90deg, #10b981, #059669); color: white; border: none; border-radius: 12px; font-weight: 800; font-size: 1.05rem; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: all 0.3s;
}
.btn-checkout:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }

@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slide-down { 0% { transform: translateY(-50px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }
