/* VARIABLES */
:root {
    --navy:       #1F2937;
    --accent:     #5179d1;
    --light-blue: #DBEAFE;
    --bg:         #F9FAFB;
    --white:      #FFFFFF;
    --dark:       #111827;
    --mid:        #D1D5DB;
    --danger:     #DC2626;
    --success:    #16A34A;
    --warning:    #f5a623;
    --radius:     10px;
    --radius-sm:  6px;
    --shadow:     0 4px 16px rgba(0,0,0,0.08);
}


/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg); color: var(--dark);
    font-size: 16px; line-height: 1.65;
    display: flex; flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; width: 100%;
    margin: 40px auto;
    padding: 0 80px;
}

a       { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--dark); font-weight: 600; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

img { max-width: 100%; height: auto; display: block; }
hr  { border: none; border-top: 1px solid var(--mid); }


/* HEADER & NAV */
header {
    background: var(--navy);
    padding: 0 32px;
    display: grid; grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 62px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brandLogo      { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brandLogo span { color: var(--white); font-size: 22px; font-weight: 700; }

.navbar    { display: flex; justify-content: center; }
.navbar ul { list-style: none; display: flex; gap: 40px; align-items: center; }

.navbar ul li a,
.navRightLink {
    color: var(--light-blue);
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 15px; text-decoration: none;
}

.navbar ul li a:hover,
.navRightLink:hover { background: var(--accent); color: var(--white); text-decoration: none; }

.navRight { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.profile-link {
    color: var(--light-blue);
    padding: 7px 16px; border-radius: var(--radius);
    font-size: 15px; text-decoration: none;
    border: 1px solid var(--light-blue);
}

.profile-link:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }


/* FORMS */
form div    { margin-bottom: 14px; }
.form-group { margin-bottom: 16px; }

label { display: block; font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 4px; }

input, select, textarea {
    width: 100%;
    padding: 10px 14px; border: 1px solid var(--mid);
    border-radius: var(--radius); background: var(--white);
    color: var(--dark); font-size: 14px; font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(81,121,209,0.1);
}

textarea { resize: vertical; }

.form-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin-bottom: 16px;
}

.form-actions {
    display: flex; gap: 16px;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--mid);
}


/* BUTTONS */
.btnPrimary, .btnContact, .btnDashboard,
button[type="submit"], button[type="button"] {
    display: inline-block;
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    background: var(--navy); color: var(--white);
    text-decoration: none;
}

.btnPrimary:hover, .btnContact:hover, .btnDashboard:hover,
button[type="submit"]:hover, button[type="button"]:hover {
    background: var(--accent); color: var(--white); text-decoration: none;
}

.btnSecondary {
    display: inline-block;
    padding: 10px 24px; border-radius: var(--radius);
    background: var(--white); color: var(--navy);
    border: 2px solid var(--navy);
    font-weight: 600; font-size: 14px; text-decoration: none;
}

.btnSecondary:hover { background: var(--navy); color: var(--white); }

.btnLogout {
    display: inline-block;
    padding: 10px 24px; border-radius: var(--radius);
    background: var(--danger); color: var(--white);
    font-weight: 600; font-size: 14px; text-decoration: none;
}

.btnLogout:hover { background: #b91c1c; }

.btnBack       { display: inline-block; margin-bottom: 16px; color: var(--accent); font-size: 14px; font-weight: 600; }
.btnBack:hover { text-decoration: underline; }

/* Admin approve/deny */
.btnApprove, .btnDeny {
    display: inline-block;
    padding: 8px 18px; border-radius: var(--radius);
    font-weight: 600; text-decoration: none;
    margin-top: 10px; color: var(--white);
}

.btnApprove       { background: var(--success); margin-right: 8px; }
.btnApprove:hover { background: #15803d; }
.btnDeny          { background: var(--danger); }
.btnDeny:hover    { background: #b91c1c; }

/* Inline text actions on listing cards */
.btnEdit { color: var(--accent); font-weight: 600; }
.btnSold { color: var(--success); font-weight: 600; }
.btnDel  { color: var(--danger);  font-weight: 600; }
.btnEdit:hover, .btnSold:hover, .btnDel:hover { text-decoration: underline; }


/* AUTH PAGES — login.php, register.php, resetPwd.php */
.authPage {
    min-height: 100vh; background: var(--navy);
    display: flex; align-items: center;
    justify-content: center; padding: 24px;
}

.authCard {
    background: var(--white); border-radius: 12px;
    padding: 36px 40px; width: 90vw; max-width: 520px;
    border: 1px solid var(--mid);
}

.authCard h2 { text-align: center; font-size: 28px; margin-bottom: 24px; color: var(--navy); }

.authCard .btnFull {
    width: 100%; padding: 10px;
    background: var(--navy); color: var(--white);
    border: none; border-radius: var(--radius);
    font-size: 15px; font-weight: 600;
    cursor: pointer; margin-top: 8px;
}

.authCard .btnFull:hover { background: var(--accent); }

.authCard .authFooter   { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.authCard .authFooter a { color: var(--accent); font-weight: 600; }

/* Form error/success messages */
.authError, .authSuccess { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.authError   { background: #fdecea; border: 1px solid #f5c6cb; color: var(--danger); }
.authSuccess { background: #e8f5e9; border: 1px solid #c3e6cb; color: var(--success); }

/* Page-level alert banners */
.alert-success, .alert-error { padding: 14px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13px; }
.alert-success { background: #e8f5e9; border: 1px solid var(--success); color: var(--success); }
.alert-error   { background: #fdecea; border: 1px solid var(--danger);  color: var(--danger); }


/* BADGES */
.featuredBadge { background: var(--warning); color: white; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; display: inline-block; }
.verifiedBadge { background: var(--success); color: var(--white); font-size: 12px; padding: 2px 8px; border-radius: 12px; margin-left: 6px; }
.categoryBadge { display: inline-block; background: var(--light-blue); color: var(--navy); font-size: 12px; padding: 2px 8px; border-radius: 12px; margin-top: 6px; }


/* HERO — home.php */
.hero {
    text-align: center;
    padding: 80px 60px; background: var(--navy);
    border-radius: var(--radius); margin-bottom: 40px;
}

.hero h2 { font-size: 42px; margin-bottom: 10px; color: var(--white); }
.hero p  { color: var(--light-blue); margin-bottom: 24px; font-size: 17px; }

.heroButtons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Underlined heading above listing grids */
.sectionTitle {
    font-size: 20px; color: var(--navy);
    margin-top: 48px; margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light-blue);
}


/* ITEM CARDS — home.php, buy.php */
.itemsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.itemCard {
    background: var(--white); color: var(--dark);
    border: 1px solid var(--mid); border-radius: var(--radius);
    overflow: hidden; display: block; text-decoration: none;
}

.itemCard:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.itemCard img   { width: 100%; height: 180px; object-fit: cover; }
.itemCardBody   { padding: 10px; }

/* Title truncates with ... if too long */
.itemCardBody h4 {
    margin: 0 0 6px; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.itemPrice { font-weight: bold; color: var(--navy); font-size: 16px; }
.itemMeta  { font-size: 12px; color: #888; margin-top: 4px; }
.viewAll   { text-align: center; margin-top: 24px; }


/* MARKETPLACE CONTROLS — buy.php */
.marketplaceControls { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; align-items: center; }
.marketplaceControls input[type="text"] { flex: 2; min-width: 180px; }
.marketplaceControls select             { flex: 1; min-width: 140px; }

.clearFilter       { color: var(--danger); font-size: 14px; }
.clearFilter:hover { text-decoration: underline; }
.resultsCount      { font-size: 14px; color: #888; margin-bottom: 16px; }
.noResults         { text-align: center; padding: 60px 20px; color: #888; }


/* LISTING DETAIL — listing.php */
.listingWrapper { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 20px; }

.listingImages,
.listingDetails { flex: 1; min-width: 280px; }

.listingDetails h2 { margin-top: 0; }

/* No fixed height — full image shows without cropping */
.mainImage { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--mid); }

.thumbnailRow     { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbnailRow img {
    width: 70px; height: 70px; object-fit: cover;
    border-radius: var(--radius-sm); border: 2px solid var(--mid); cursor: pointer;
}
.thumbnailRow img:hover { border-color: var(--accent); }

.listingPrice { font-size: 28px; font-weight: bold; color: var(--navy); margin: 10px 0; }

/* Location / category / condition rows */
.listing-details-grid {
    display: flex; flex-direction: column;
    margin: 20px 0; background: var(--bg); border-radius: var(--radius);
}

.detail-row {
    display: flex; align-items: center;
    gap: 14px; padding: 10px 16px;
    border-bottom: 1px solid var(--mid);
}

.detail-row:last-child { border-bottom: none; }
.detail-icon    { font-size: 20px; min-width: 32px; text-align: center; }
.detail-content { flex: 1; }
.detail-label   { font-size: 11px; color: #888; text-transform: uppercase; margin-bottom: 2px; }
.detail-value   { font-size: 15px; font-weight: 500; }

/* Description with blue left border */
.description-section {
    background: var(--bg); border-radius: var(--radius);
    padding: 16px; margin: 20px 0;
    border-left: 4px solid var(--accent);
}

.description-label { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.description-text  { font-size: 15px; line-height: 1.6; }

/* Seller info box */
.sellerBox {
    margin-top: 20px; padding: 20px;
    border: 1px solid var(--mid); border-radius: var(--radius);
    background: var(--white);
}

.sellerBox h4  { margin: 0 0 12px; color: var(--navy); font-size: 18px; }
.seller-rating { padding-bottom: 12px; border-bottom: 1px solid var(--mid); margin-bottom: 12px; }
.contact-info  { margin: 12px 0; }
.stars         { color: var(--warning); }

#paypal-button-container { max-width: 250px; margin: 16px 0; }


/* PROFILE — profile.php */
.profileHeader {
    display: flex; align-items: center;
    gap: 24px; padding: 20px 0;
    border-bottom: 1px solid var(--mid); margin-bottom: 24px;
}

/* Circle with user initials */
.profileAvatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--navy); color: var(--white);
    font-size: 32px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.infoGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 30px;
}

.infoCard {
    background: var(--white); padding: 14px;
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.infoCard small { color: #888; font-size: 12px; }
.infoCard p     { margin: 4px 0 0; font-weight: bold; font-size: 15px; }


/* SELLER DASHBOARD — sell.php */
.dashboard-header {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap;
    gap: 20px; margin-bottom: 48px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-blue);
}

.dashboard-header h1 { margin: 0; color: var(--navy); }
.dashboard-subtitle  { color: #666; font-size: 17px; margin-top: 4px; }
.dashboard-stats     { display: flex; gap: 16px; }

/* Stat boxes e.g. "3 Active" */
.stat-badge {
    background: var(--white); text-align: center;
    padding: 10px 20px; border-radius: var(--radius);
    border: 1px solid var(--mid); min-width: 80px;
}

.stat-number { font-size: 36px; font-weight: 700; color: var(--navy); display: block; line-height: 1.2; }
.stat-label  { font-size: 12px; color: #888; }

/* Green verified badge */
.stat-badge.verified {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    background: var(--success); border-color: var(--success); min-width: 100px;
}

.stat-badge.verified .stat-label { color: white; font-size: 13px; font-weight: 600; margin: 0; }
.stat-tick { color: white; font-size: 30px; font-weight: bold; display: block; }

.quick-actions { margin-bottom: 28px; }

/* Create/edit listing form card */
.form-card {
    background: var(--white); padding: 28px;
    border: 1px solid var(--mid); border-radius: var(--radius);
    margin-bottom: 48px;
}

.form-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--mid);
}

.form-card-header h3 { margin: 0; }

/* X to close the form */
.close-btn       { background: none; border: none; font-size: 24px; cursor: pointer; color: #888; }
.close-btn:hover { color: var(--danger); }

.dashboard-section { margin-top: 48px; }

/* Section heading with item count on the right */
.section-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px;
}

.section-header h3 { margin: 0; }
.section-count { background: var(--light-blue); padding: 4px 12px; border-radius: 20px; font-size: 12px; color: var(--navy); }

/* Active listings grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.listing-card       { background: var(--white); border: 1px solid var(--mid); border-radius: var(--radius); overflow: hidden; }
.listing-card:hover { box-shadow: var(--shadow); }
.listing-card-img   { width: 100%; height: 180px; object-fit: cover; }
.listing-card-body  { padding: 16px; }

.listing-card-body h4 { margin: 0 0 8px; font-size: 18px; }
.listing-card-price   { font-size: 20px; font-weight: bold; color: var(--navy); }
.listing-card-meta    { font-size: 12px; color: #888; margin: 8px 0; }

.listing-card-actions {
    display: flex; gap: 16px;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--mid);
}

/* Shown when seller has no listings */
.empty-state {
    text-align: center; padding: 48px; color: #888;
    background: var(--white);
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.empty-state-sub { font-size: 12px; margin-top: 8px; }

/* Sold history */
.sold-list { display: flex; flex-direction: column; gap: 10px; }

.sold-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px; background: var(--white);
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.sold-item-img     { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); }
.sold-item-info    { flex: 1; }
.sold-item-info h4 { margin: 0 0 4px; }
.sold-item-info p  { margin: 0; font-size: 14px; color: #888; }

/* Verification status card */
.verification-card {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; background: var(--white);
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.verification-card.verified { background: #e8f5e9; border-color: var(--success); }
.verification-card.pending  { background: #fff8e1; border-color: var(--warning); }
.verification-icon          { font-size: 32px; }

/* Uploaded image preview thumbnails */
.current-images     { margin-top: 16px; }
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.image-preview-item { position: relative; width: 80px; height: 80px; }
.image-preview-item img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: var(--radius-sm); border: 1px solid var(--mid);
}

/* "Main" label on primary image */
.primary-badge {
    position: absolute; bottom: 4px; left: 4px;
    background: var(--success); color: white;
    font-size: 9px; padding: 2px 6px; border-radius: 10px;
}

/* Red X to remove an uploaded image */
.remove-image {
    position: absolute; top: -8px; right: -8px;
    background: var(--danger); color: white;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; text-decoration: none;
}

.remove-image:hover { background: #b91c1c; }


/* MODALS */
/* Dark backdrop */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white); border-radius: var(--radius);
    padding: 28px; max-width: 500px; width: 90%;
    max-height: 90vh; overflow-y: auto;
}

.modal-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px;
}

.modal-close       { background: none; border: none; font-size: 28px; cursor: pointer; color: #888; }
.modal-close:hover { color: var(--danger); }


/* REVIEWS */
.reviewCard { padding: 14px; border: 1px solid var(--mid); border-radius: var(--radius); margin-bottom: 12px; background: var(--white); }
.reviewForm { background: var(--white); border: 1px solid var(--mid); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }

/* CSS-only star rating using reverse flex + sibling selectors */
.starSelect { display: flex; flex-direction: row-reverse; gap: 4px; width: fit-content; font-size: 22px; }
.starSelect input[type="radio"] { display: none; }
.starSelect label               { color: var(--mid); cursor: pointer; }

.starSelect label:hover,
.starSelect label:hover ~ label,
.starSelect input:checked + label,
.starSelect input:checked + label ~ label { color: var(--warning); }

/* Rating summary at top of seller review page */
.rating-summary-box {
    background: var(--white); text-align: center;
    border: 1px solid var(--mid); border-radius: var(--radius);
    padding: 30px 20px; margin-bottom: 30px;
}

.rating-summary-content { max-width: 300px; margin: 0 auto; }
.rating-number-large    { font-size: 56px; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 10px; }
.rating-stars-large     { font-size: 28px; color: var(--warning); margin-bottom: 10px; }
.rating-total           { font-size: 13px; color: #888; }
.reviews-list-seller    { display: flex; flex-direction: column; gap: 20px; }

.review-item {
    background: var(--white); padding: 18px;
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.review-item:hover { box-shadow: var(--shadow); }

.review-item-header {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap;
    gap: 10px; margin-bottom: 8px;
}

.reviewer-name strong { font-size: 16px; }
.review-rating        { color: var(--warning); font-size: 14px; }
.review-date          { font-size: 12px; color: #999; margin-bottom: 12px; }

.review-comment-text {
    font-size: 15px; line-height: 1.5; font-style: italic;
    background: var(--bg); padding: 12px 16px;
    border-radius: var(--radius-sm); margin-top: 10px;
}

.review-comment-text.no-comment { color: #aaa; font-style: normal; }

.no-reviews-message {
    text-align: center; padding: 50px 20px; color: #888;
    background: var(--white);
    border: 1px solid var(--mid); border-radius: var(--radius);
}

.no-reviews-message .sub-message { font-size: 13px; margin-top: 8px; color: #aaa; }


/* PURCHASE HISTORY */
.purchaseCard {
    display: flex; align-items: center; gap: 16px;
    padding: 12px; margin-bottom: 12px;
    border: 1px solid var(--mid); border-radius: var(--radius);
    background: var(--white);
}

.purchaseCard:hover { box-shadow: var(--shadow); }

.purchaseCard img {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: var(--radius); flex-shrink: 0;
}

.purchaseInfo h4 { margin: 0 0 4px; font-size: 16px; }
.purchaseInfo p  { margin: 2px 0; font-size: 13px; color: #666; }
.purchasePrice   { font-weight: bold; color: var(--navy); }

/* Legacy item rows on the profile dashboard */
.dashboardSection { margin-top: 40px; border-top: 2px solid var(--light-blue); padding-top: 20px; }

.itemRow {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px; margin-bottom: 8px;
    border: 1px solid var(--mid); border-radius: var(--radius);
    background: var(--white);
}

.itemRow:hover { background: #f9fafb; }
.itemInfo      { display: flex; align-items: center; gap: 15px; }


/* SUCCESS PAGE */
.successBox {
    text-align: center; padding: 60px 32px;
    max-width: 500px; margin: 40px auto;
    border: 1px solid var(--mid); border-radius: var(--radius);
    background: var(--white);
}

.successIcon   { font-size: 64px; margin-bottom: 16px; }
.successBox h2 { color: var(--success); margin-bottom: 8px; font-size: 26px; }
.successBox p  { color: #666; margin-bottom: 6px; font-size: 15px; }


/* FOOTER */
footer { background: var(--navy); color: var(--light-blue); margin-top: 60px; }

.footerContent {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px; padding: 40px 80px;
}

.footerSection { display: flex; flex-direction: column; gap: 8px; }
.footerSection strong              { color: var(--white); font-size: 15px; }
.footerSection p, .footerSection a { font-size: 13px; color: var(--light-blue); margin: 0; }
.footerSection a:hover             { color: var(--white); text-decoration: underline; }

.footerBottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 80px; text-align: center;
}

.footerBottom p { font-size: 12px; color: #888; margin: 0; }


/* GOOGLE PLACES — location autocomplete in sell.php */
.pac-container  { border-radius: var(--radius); border: 1px solid var(--mid); font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; margin-top: 4px; }
.pac-item       { padding: 8px 12px; cursor: pointer; }
.pac-item:hover { background: var(--light-blue); }
.pac-item-query { font-size: 14px; color: var(--navy); }


/* TABLET */
@media (max-width: 1024px) {
    main   { padding: 0 40px; }
    header { padding: 0 24px; }
    .navbar ul { gap: 20px; }
    .hero  { padding: 60px 40px; }
    .hero h2 { font-size: 34px; }
    .footerContent, .footerBottom { padding-left: 40px; padding-right: 40px; }
}


/* MOBILE */
@media (max-width: 768px) {
    main { padding: 0 16px; margin: 24px auto; }

    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }

    /* Stack header vertically */
    header {
        display: flex; flex-direction: column;
        padding: 12px 16px; gap: 8px;
        min-height: auto; align-items: stretch;
    }

    .brandLogo      { justify-content: center; }
    .brandLogo span { font-size: 18px; }
    .navbar         { justify-content: center; }
    .navbar ul      { gap: 6px; justify-content: center; flex-wrap: wrap; }
    .navbar ul li a { font-size: 13px; padding: 6px 10px; }
    .navRight       { justify-content: center; margin-left: 0; }
    .profile-link   { font-size: 13px; padding: 6px 12px; }

    .hero    { padding: 40px 20px; }
    .hero h2 { font-size: 26px; }

    .heroButtons { flex-direction: column; align-items: center; }
    .heroButtons .btnPrimary,
    .heroButtons .btnSecondary { width: 100%; max-width: 260px; text-align: center; }

    /* Single column on mobile */
    .form-row      { grid-template-columns: 1fr; }
    .listings-grid { grid-template-columns: 1fr; }
    .marketplaceControls { flex-direction: column; }
    .marketplaceControls input[type="text"] { width: 100%; }

    .dashboard-header { flex-direction: column; text-align: center; }
    .dashboard-stats  { justify-content: center; }
    .sold-item, .listing-card-actions { flex-wrap: wrap; }
    .modal-content  { padding: 20px; width: 95%; }
    .purchaseCard   { flex-direction: column; text-align: center; }
    .itemRow        { flex-direction: column; align-items: flex-start; gap: 10px; }
    .adminNav       { justify-content: center; }
    .profileAvatar  { width: 60px; height: 60px; font-size: 24px; }

    .rating-number-large { font-size: 40px; }
    .rating-stars-large  { font-size: 22px; }
    .review-item-header  { flex-direction: column; align-items: flex-start; }
    .detail-row  { padding: 8px 12px; }
    .detail-icon { font-size: 18px; min-width: 28px; }

    .footerContent { padding: 30px 16px; }
    .footerBottom  { padding: 16px; }
    .authCard      { padding: 24px 20px; }
    .authCard h2   { font-size: 22px; }

    #paypal-button-container { max-width: 100%; }
}


/* PRINT */
@media print {
    header, .heroButtons, .marketplaceControls, .adminNav,
    .btnBack, .btnEdit, .btnSold, .btnDel, .reviewForm { display: none; }
    body { background: white; color: black; }
    .itemCard, .authCard, .successBox { box-shadow: none; border: 1px solid #ccc; }
}