/**
 * Lapak Desa - Shopee Style
 * Desain ulang dengan gaya Shopee yang clean dan konsisten
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */

/* Container utama - mengikuti lebar col-lg-8 */
.lapak-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   P-MART BRANDING HERO
   ============================================ */

.pmart-hero {
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6b35 100%);
    border-radius: 8px;
    padding: 30px 20px;
    margin-bottom: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.2);
}

.pmart-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.pmart-hero .pmart-moto {
    font-size: 1.1rem;
    margin-bottom: 5px;
    opacity: 0.95;
}

.pmart-hero .pmart-slogan {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

/* ============================================
   FILTER SECTION
   ============================================ */

.lapak-filter-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lapak-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.lapak-filter-form .form-group {
    display: flex;
    flex-direction: column;
}

.lapak-filter-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.lapak-filter-form input,
.lapak-filter-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.lapak-filter-form input:focus,
.lapak-filter-form select:focus {
    outline: none;
    border-color: #ee4d2d;
}

.lapak-filter-form .btn-filter {
    background: #ee4d2d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.lapak-filter-form .btn-filter:hover {
    background: #d73211;
}

/* ============================================
   SECTION HEADER
   ============================================ */

.lapak-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lapak-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.lapak-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lapak-section-title i {
    color: #ee4d2d;
}

.lapak-section-link {
    color: #ee4d2d;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.lapak-section-link:hover {
    gap: 8px;
    color: #d73211;
}

/* ============================================
   PRODUCTS GRID - SHOPEE STYLE
   ============================================ */

.lapak-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .lapak-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .lapak-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ============================================
   PRODUCT CARD - SHOPEE STYLE
   ============================================ */

.lapak-product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lapak-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ee4d2d;
}

.lapak-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
    background: #f5f5f5;
    overflow: hidden;
}

.lapak-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lapak-product-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 2rem;
}

.lapak-product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lapak-product-name {
    font-size: 0.875rem;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
}

.lapak-product-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ee4d2d;
    margin-bottom: 8px;
}

.lapak-product-seller {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lapak-product-seller i {
    font-size: 0.7rem;
}

.lapak-product-stats {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #999;
    margin-top: auto;
}

.lapak-product-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lapak-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lapak-product-rating .stars {
    color: #ffc120;
    font-size: 0.7rem;
}

.lapak-product-rating .rating-value {
    color: #666;
    font-weight: 500;
}

.lapak-product-actions {
    padding: 0 12px 12px;
    display: flex;
    gap: 8px;
}

.lapak-btn-detail {
    flex: 1;
    padding: 8px;
    background: white;
    border: 1px solid #ee4d2d;
    color: #ee4d2d;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.lapak-btn-detail:hover {
    background: #ee4d2d;
    color: white;
}

.lapak-btn-buy {
    flex: 1;
    padding: 8px;
    background: #ee4d2d;
    border: none;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.lapak-btn-buy:hover {
    background: #d73211;
    color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767.98px) {
    .lapak-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .lapak-filter-form {
        grid-template-columns: 1fr;
    }
    
    .lapak-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .lapak-section-link {
        align-self: flex-end;
    }
}

/* ============================================
   OVERRIDE UNTUK LAPAK.PHP
   ============================================ */

/* Pastikan semua elemen mengikuti lebar content-area (col-lg-8) */
.content-area .lapak-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.content-area .lapak-container > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Override untuk button detail - kompatibel dengan JavaScript yang ada */
.lapak-btn-detail.btn-detail-marketplace {
    cursor: pointer;
}
