/*
 * style.css - ĐÃ DỌN DẸP
 * Ưu tiên dùng max-height: 60vh để khắc phục video quá to trên mobile.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

header {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

h1 {
    font-size: 20px;
    font-weight: 600;
}

.product-detail {
    padding: 16px;
}

/* Single Product Media - Quy tắc chung */
.product-media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex; /* Giữ lại flex để căn giữa */
    justify-content: center;
    align-items: center;
}

.product-media video,
.product-media img {
    max-width: 100%;
    height: auto;
    /* Giới hạn trên desktop/tablet */
    max-height: 450px; 
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Mobile specific - CHỈNH SỬA TẬP TRUNG TẠI ĐÂY */
@media (max-width: 600px) {
    .container {
        box-shadow: none;
    }
    
    .product-media video,
    .product-media img {
        max-width: 100%;
        height: auto;
        /* ÁP DỤNG GIỚI HẠN CHIỀU CAO TUYỆT ĐỐI THEO MÀN HÌNH */
        max-height: 60vh; 
        
        object-fit: contain;
    }
}

.product-info h2 {
    font-size: 24px;
    color: #FF0000;
    margin-bottom: 16px;
    line-height: 1.3;
}

.price {
    margin: 16px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.price-retail {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    display: block;
}

.price-wholesale {
    display: block;
    font-size: 16px;
    color: #4CAF50;
    margin-top: 8px;
}

.price-classifications {
    font-size: 14px;
}

.classification-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.classification-item:last-child {
    border-bottom: none;
}

.price-value {
    font-weight: bold;
    color: #2196F3;
}

.delivery-radius {
    background: #2196F3;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0;
    display: inline-block;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.badge-new { 
    background: #4CAF50; 
}

.badge-freeship { 
    background: #673AB7; 
}

.description {
    margin: 24px 0;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
}

.description h3 {
    margin-bottom: 12px;
    color: #FF9800;
    font-size: 18px;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: 12px;
    margin: 20px 0;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.seller-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.seller-phone {
    color: #4CAF50;
    text-decoration: none;
    margin-top: 4px;
    display: inline-block;
    font-weight: 500;
}

.seller-phone:hover {
    text-decoration: underline;
}

.meta-info {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    margin-top: 16px;
}

.cta-section {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    z-index: 10; 
}

.btn {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}


/* =============================== */
/* 🔸 Header cam cho trang rao vặt */
/* =============================== */

.header-bar {
    background: #ff9800;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;

    /* 👇 Thêm dòng này để logo và text nằm ngang */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
}

.terms-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.terms-link:hover {
    text-decoration: underline;
}
