/* ==========================================
   Produk Desa - Modern Product Card Styles
   Inspired by modern e-commerce design
   ========================================== */

:root {
    --pd-primary: #2d5f3f;
    --pd-primary-light: #3a7a52;
    --pd-primary-dark: #1e4029;
    --pd-secondary: #8b6f47;
    --pd-accent: #c9a961;
    --pd-text-dark: #2c2c2c;
    --pd-text-light: #666;
    --pd-bg-light: #f8f9fa;
    --pd-white: #ffffff;
    --pd-border: #e5e5e5;
    --pd-shadow: rgba(0, 0, 0, 0.1);
    --pd-shadow-hover: rgba(0, 0, 0, 0.15);
    --pd-success: #28a745;
    --pd-warning: #ffc107;
    --pd-danger: #dc3545;
    --pd-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   Container & Grid Layout
   ========================================== */

.produk-desa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.produk-desa-header {
    text-align: center;
    margin-bottom: 50px;
}

.produk-desa-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pd-primary);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.produk-desa-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--pd-primary), var(--pd-accent));
    border-radius: 2px;
}

.produk-desa-subtitle {
    font-size: 1.1rem;
    color: var(--pd-text-light);
    margin-top: 20px;
    line-height: 1.6;
}

/* ==========================================
   Category Filter
   ========================================== */

.produk-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid var(--pd-border);
    background: var(--pd-white);
    color: var(--pd-text-dark);
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--pd-transition);
    outline: none;
}

.filter-btn:hover {
    border-color: var(--pd-primary);
    color: var(--pd-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--pd-shadow);
}

.filter-btn.active {
    background: var(--pd-primary);
    color: var(--pd-white);
    border-color: var(--pd-primary);
}

/* ==========================================
   Products Grid
   ========================================== */

.produk-desa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Responsive columns */
@media (min-width: 1200px) {
    .produk-desa-grid.kolom-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .produk-desa-grid.kolom-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .produk-desa-grid.kolom-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .produk-desa-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .produk-desa-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Product Card - Main Design
   ========================================== */

.produk-card {
    background: var(--pd-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--pd-shadow);
    transition: var(--pd-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.produk-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--pd-shadow-hover);
}

/* ==========================================
   Product Image Section
   ========================================== */

.produk-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f8f9fa; /* Background netral untuk space kosong */
}

.produk-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Seluruh foto terlihat, tidak terpotong */
    object-position: center center;
    transition: var(--pd-transition);
}

.produk-card:hover .produk-image {
    transform: scale(1.05); /* Zoom lebih kecil karena contain */
}

/* Category Badge */
.produk-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--pd-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* ==========================================
   Product Content Section
   ========================================== */

.produk-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.produk-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pd-text-dark);
    margin-bottom: 20px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 70px;
}

/* ==========================================
   Product Footer Section
   ========================================== */

.produk-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.produk-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 150px;
}

.produk-price-label {
    font-size: 0.75rem;
    color: var(--pd-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.produk-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pd-primary);
    line-height: 1;
    white-space: nowrap;
}

.produk-satuan {
    font-size: 0.9rem;
    color: var(--pd-text-light);
    font-weight: 400;
}

/* ==========================================
   CTA Button
   ========================================== */

.produk-cta {
    padding: 12px 24px;
    background: var(--pd-primary);
    color: var(--pd-white);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--pd-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.produk-cta:hover {
    background: var(--pd-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--pd-shadow);
}

.produk-cta svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================
   Loading & Empty States
   ========================================== */

.produk-loading {
    text-align: center;
    padding: 60px 20px;
}

.produk-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--pd-border);
    border-top-color: var(--pd-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.produk-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pd-text-light);
}

.produk-empty svg {
    width: 80px;
    height: 80px;
    fill: var(--pd-border);
    margin-bottom: 20px;
}

.produk-empty h3 {
    font-size: 1.5rem;
    color: var(--pd-text-dark);
    margin-bottom: 10px;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .produk-desa-container {
        padding: 30px 15px;
    }
    
    .produk-desa-title {
        font-size: 2rem;
    }
    
    .produk-desa-subtitle {
        font-size: 1rem;
    }
    
    .produk-filter {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .produk-desa-grid {
        gap: 20px;
    }
    
    .produk-content {
        padding: 20px;
    }
    
    .produk-title {
        font-size: 1.1rem;
    }
    
    .produk-price {
        font-size: 1.5rem;
    }
    
    .produk-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .produk-price-wrapper {
        align-items: flex-start;
    }
    
    .produk-cta {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .produk-desa-title {
        font-size: 1.75rem;
    }
    
    .produk-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.produk-card {
    animation: fadeInUp 0.5s ease-out;
}

.produk-card:nth-child(1) { animation-delay: 0.1s; }
.produk-card:nth-child(2) { animation-delay: 0.2s; }
.produk-card:nth-child(3) { animation-delay: 0.3s; }
.produk-card:nth-child(4) { animation-delay: 0.4s; }
.produk-card:nth-child(5) { animation-delay: 0.5s; }
.produk-card:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .produk-filter,
    .produk-cta {
        display: none;
    }
    
    .produk-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
