/* ===== PRODUCT CSS ===== */
body { font-family: 'Be Vietnam Pro', Arial, sans-serif; }

/* Hero */
.product-hero {
    background: linear-gradient(135deg, #8e0000 0%, #c62828 50%, #e53935 100%);
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.product-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('../img/bn4.jpg') center/cover no-repeat;
    opacity: 0.12;
}
.product-hero-content { position: relative; z-index: 1; }
.product-hero-content h1 { font-size: 38px; font-weight: 800; color: #fff; margin: 0 0 10px; }
.product-hero-content h1 i { margin-right: 10px; }
.product-hero-content p { font-size: 16px; color: rgba(255,255,255,0.85); margin: 0; }

/* Section */
.product-section { background: #f4f6f9; padding: 60px 40px; }
.product-container { max-width: 1200px; margin: 0 auto; }

/* Toolbar */
.product-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.product-search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 14px;
}
.search-wrap input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.25s;
}
.search-wrap input:focus { outline: none; border-color: #c62828; }

.product-search-form select {
    padding: 11px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.25s;
}
.product-search-form select:focus { outline: none; border-color: #c62828; }

.product-search-form button {
    padding: 11px 22px;
    background: linear-gradient(135deg, #c62828, #e53935);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s;
}
.product-search-form button:hover { background: linear-gradient(135deg, #8e0000, #c62828); }

.btn-sell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: #1a1a2e;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.25s;
}
.btn-sell:hover { background: #c62828; transform: translateY(-2px); }

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Card */
.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(198,40,40,0.12);
    border-color: rgba(198,40,40,0.15);
}

.product-img {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-img img { transform: scale(1.06); }
.product-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffeaea, #ffe0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #c62828;
}

.product-cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #c62828, #e53935);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.product-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    margin: 0 0 12px;
    flex: 1;
}
.product-price {
    font-size: 20px;
    font-weight: 800;
    color: #c62828;
    margin-bottom: 10px;
}
.product-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 14px;
}
.product-meta i { color: #c62828; margin-right: 3px; }

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px;
    background: linear-gradient(135deg, #c62828, #e53935);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(198,40,40,0.25);
}
.btn-buy:hover { background: linear-gradient(135deg, #8e0000, #c62828); transform: translateY(-1px); }

/* Empty state */
.product-empty {
    text-align: center;
    padding: 80px 20px;
    color: #aaa;
}
.product-empty i { font-size: 4rem; margin-bottom: 16px; display: block; color: #ddd; }
.product-empty p { font-size: 16px; margin: 0 0 20px; }

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #43a047; }
.alert-error   { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }

/* Form */
.product-form-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.product-form .form-group { margin-bottom: 22px; }
.product-form label { display: block; font-size: 13.5px; font-weight: 700; color: #333; margin-bottom: 8px; }
.product-form label span { color: #c62828; }
.product-form .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 14px; }
.input-icon-wrap input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.25s;
}
.input-icon-wrap input:focus { outline: none; border-color: #c62828; background: #fff; }
.product-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    cursor: pointer;
}
.product-form select:focus { outline: none; border-color: #c62828; }
.product-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    resize: vertical;
    box-sizing: border-box;
}
.product-form textarea:focus { outline: none; border-color: #c62828; }

/* File upload */
.file-upload-wrap input[type=file] { display: none; }
.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    transition: border-color 0.25s;
    background: #fafafa;
}
.file-upload-label:hover { border-color: #c62828; color: #c62828; }
.file-upload-label i { font-size: 20px; }

/* Form actions */
.form-actions { display: flex; gap: 14px; justify-content: flex-end; margin-top: 10px; }
.btn-cancel {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; background: #f0f0f0; color: #555;
    text-decoration: none; border-radius: 10px; font-size: 14px; font-weight: 600;
    transition: all 0.25s;
}
.btn-cancel:hover { background: #e0e0e0; }
.btn-submit-product {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; background: linear-gradient(135deg, #c62828, #e53935);
    color: #fff; border: none; border-radius: 10px; font-size: 14px;
    font-weight: 700; font-family: inherit; cursor: pointer;
    box-shadow: 0 4px 14px rgba(198,40,40,0.3); transition: all 0.25s;
}
.btn-submit-product:hover { background: linear-gradient(135deg, #8e0000, #c62828); transform: translateY(-1px); }

/* Admin tabs */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; background: #fff; border-radius: 10px;
    text-decoration: none; color: #555; font-size: 14px; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: all 0.25s;
    border: 1.5px solid transparent;
}
.admin-tab:hover { border-color: #c62828; color: #c62828; }
.admin-tab.active { background: linear-gradient(135deg, #c62828, #e53935); color: #fff; }
.tab-count {
    display: inline-block; background: rgba(0,0,0,0.1);
    color: inherit; font-size: 12px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
}
.admin-tab.active .tab-count { background: rgba(255,255,255,0.25); }
.tab-count.approved { background: #e8f5e9; color: #2e7d32; }
.tab-count.rejected { background: #ffebee; color: #c62828; }

/* Admin table */
.admin-product-table-wrap { overflow-x: auto; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); }
.admin-product-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
.admin-product-table thead { background: #1a1a2e; }
.admin-product-table th {
    padding: 14px 16px; color: #fff; font-weight: 700;
    text-align: left; font-size: 13px; white-space: nowrap;
}
.admin-product-table td {
    padding: 14px 16px; border-bottom: 1px solid #f0f0f0;
    vertical-align: middle; color: #444;
}
.admin-product-table tr:last-child td { border-bottom: none; }
.admin-product-table tr:hover td { background: #fafafa; }

.admin-prod-thumb {
    width: 60px; height: 50px; object-fit: cover; border-radius: 8px; display: block;
}
.admin-prod-thumb-placeholder {
    width: 60px; height: 50px; background: #f0f0f0;
    border-radius: 8px; display: flex; align-items: center;
    justify-content: center; color: #ccc; font-size: 18px;
}

.btn-action {
    width: 32px; height: 32px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 13px; display: inline-flex;
    align-items: center; justify-content: center; transition: all 0.2s;
    color: #fff;
}
.btn-action.approve { background: #43a047; }
.btn-action.approve:hover { background: #2e7d32; }
.btn-action.reject  { background: #f57c00; }
.btn-action.reject:hover { background: #e65100; }
.btn-action.delete  { background: #e53935; }
.btn-action.delete:hover { background: #8e0000; }

/* Responsive */
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-section { padding: 50px 18px; }
    .product-hero { padding: 60px 20px; }
    .product-hero-content h1 { font-size: 26px; }
    .product-form .form-row-2 { grid-template-columns: 1fr; }
    .product-form-box { padding: 28px 20px; }
}
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }
