
/* =====================================
   P2PMARKETPH - MARKETPLACE DESIGN
===================================== */

:root {
    --primary: #ee4d2d;
    --primary-dark: #d93d20;
    --primary-light: #fff0eb;
    --text: #222222;
    --muted: #777777;
    --border: #e8e8e8;
    --background: #f6f7f9;
    --white: #ffffff;
    --success: #168344;
    --danger: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
}

body,
button,
input,
select,
textarea {
    font-family: Arial, Helvetica, sans-serif;
}

button {
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

/* =====================================
   HEADER
===================================== */

header {
    background: var(--primary);
    color: white;
    padding: 18px 5%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-content {
    max-width: 1400px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 3px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.account-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-navigation button {
    padding: 10px 18px;
    border: 1px solid white;
    border-radius: 6px;
    background: white;
    color: var(--primary);
    font-size: 13px;
    font-weight: bold;
}

.account-navigation button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* =====================================
   MAIN CONTENT
===================================== */

main {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 24px;
}

.marketplace-intro {
    margin-bottom: 24px;
}

.marketplace-intro h2 {
    font-size: 26px;
    margin-bottom: 6px;
}

.marketplace-intro p {
    color: var(--muted);
}

/* =====================================
   SEARCH BAR
===================================== */

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: white;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 35px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
}

.search-bar input,
.search-bar select {
    flex: 1;
    min-width: 150px;
    padding: 13px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--primary);
}

.search-bar button {
    padding: 13px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* =====================================
   CATEGORIES
===================================== */

.categories {
    margin-bottom: 38px;
}

.categories h2,
.listings h2 {
    font-size: 21px;
    margin-bottom: 18px;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 13px;
}

.category-list div {
    background: white;
    padding: 23px 12px;
    text-align: center;
    border-radius: 9px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.category-list div:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

/* =====================================
   LISTINGS
===================================== */

.listings {
    background: white;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 200px;
}

.listings > p {
    color: var(--muted);
    font-size: 14px;
}

.results-message {
    margin: 12px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.create-listing-button {
    display: inline-block;
    margin: 10px 0;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.create-listing-button:hover,
.publish-button:hover {
    background: var(--primary-dark);
}

/* =====================================
   PRODUCT GRID
===================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.product-image {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #eeeeee;
    font-size: 38px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 14px;
}

.product-info h3 {
    font-size: 15px;
    margin: 5px 0 8px;
    line-height: 1.4;
}

.product-price {
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    margin: 7px 0;
}

.product-category {
    display: inline-block;
    color: var(--muted);
    font-size: 12px;
}

.product-location,
.product-info p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.product-status {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 9px;
    border-radius: 20px;
    background: #e9f7ef;
    color: var(--success) !important;
    font-size: 11px !important;
    font-weight: bold;
}

/* =====================================
   MODAL BACKGROUNDS
===================================== */

.product-modal,
.listing-modal,
.auth-modal,
.chat-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.62);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.product-modal.active,
.listing-modal.active,
.auth-modal.active,
.chat-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 750px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f1f1;
    color: #333;
    font-size: 25px;
    line-height: 1;
    z-index: 5;
}

.close-modal:hover {
    background: #e5e5e5;
}

/* =====================================
   PRODUCT DETAILS
===================================== */

.product-modal-image {
    width: 100%;
    height: 340px;
    background: #f3f3f3;
    border-radius: 9px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 45px;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-modal-category {
    display: inline-block;
    color: var(--primary);
    background: var(--primary-light);
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 9px;
}

.product-modal-name {
    font-size: 25px;
    line-height: 1.3;
    margin: 5px 0;
    padding-right: 35px;
}

.product-modal-price {
    color: var(--primary);
    font-size: 27px;
    font-weight: 800;
    margin: 8px 0 15px;
}

.product-modal-description {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    overflow-wrap: anywhere;
}

.product-modal-info {
    padding: 17px;
    background: #f8f8f8;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 22px;
}

.product-modal-info p {
    font-size: 13px;
    color: #555;
    margin: 7px 0;
    overflow-wrap: anywhere;
}

.product-modal-info p:last-child {
    font-weight: bold;
}

/* =====================================
   CONTACT SELLER
===================================== */

.seller-contact-section {
    display: block;
    padding: 20px;
    background: #fffaf8;
    border: 1px solid #f4d9d0;
    border-radius: 9px;
    margin: 20px 0;
}

.seller-contact-section h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.seller-contact-help {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
}

.seller-contact-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.seller-contact-buttons button {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #e6c9c0;
    border-radius: 7px;
    background: white;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}

.seller-contact-buttons button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* =====================================
   MANAGE LISTING BUTTONS
===================================== */

.manage-listing-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.manage-listing-controls button {
    flex: 1;
    min-width: 130px;
    padding: 12px 15px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
}

.edit-listing-button {
    background: #edf3ff;
    color: #2563eb;
}

.edit-listing-button:hover {
    background: #dce8ff;
}

.toggle-status-button {
    background: #e9f7ef;
    color: var(--success);
}

.toggle-status-button:hover {
    background: #d7f0e1;
}

.delete-listing-button {
    background: #fff0f0;
    color: var(--danger);
}

.delete-listing-button:hover {
    background: #ffdddd;
}

/* =====================================
   AUTHENTICATION FORM
===================================== */

.auth-modal .modal-content {
    max-width: 430px;
}

.auth-title {
    font-size: 23px;
    margin-bottom: 18px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.auth-form label,
.listing-form > label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #444;
    font-size: 13px;
    font-weight: 600;
}

.auth-form input,
.listing-form > label > input,
.listing-form > label > select,
.listing-form > label > textarea {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.auth-form input:focus,
.listing-form input:focus,
.listing-form select:focus,
.listing-form textarea:focus {
    border-color: var(--primary);
}

.auth-submit-button {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.auth-message {
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.auth-switch {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--muted);
}

.auth-switch button {
    border: none;
    background: none;
    color: var(--primary);
    font-weight: bold;
}

/* =====================================
   LISTING FORM
===================================== */

.listing-modal .modal-content {
    max-width: 620px;
}

.listing-form-title {
    font-size: 23px;
    margin-bottom: 18px;
    padding-right: 35px;
}

.listing-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}

.listing-form textarea {
    min-height: 110px;
    resize: vertical;
}

.listing-image-preview {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 7px;
    margin-top: 8px;
    background: #f3f3f3;
}

.photo-help-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: -10px;
}

/* =====================================
   SELLER CONTACT SETTINGS
===================================== */

.seller-contact-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: #f8f8f8;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.seller-contact-settings h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

/* Important: align checkboxes and their labels */
.seller-contact-settings label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    width: 100%;
    min-height: 35px;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.seller-contact-settings label input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.seller-contact-settings > input:not([type="checkbox"]) {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.publish-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: bold;
}

.publish-button:hover {
    background: var(--primary-dark);
}

/* =====================================
   CHAT
===================================== */

.chat-modal .modal-content {
    max-width: 600px;
}

.chat-title {
    font-size: 21px;
    padding-right: 35px;
}

.chat-listing-name {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 15px;
}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    align-self: flex-start;
    max-width: 80%;
    padding: 10px 13px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px 10px 10px 2px;
    overflow-wrap: anywhere;
}

.chat-message p {
    font-size: 14px;
}

.chat-message small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.chat-message.own-message {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    border-radius: 10px 10px 2px 10px;
}

.chat-message.own-message small {
    color: rgba(255, 255, 255, 0.8);
}

.chat-form {
    display: flex;
    gap: 9px;
    margin-top: 13px;
}

.chat-form input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    outline: none;
}

.chat-form input:focus {
    border-color: var(--primary);
}

.chat-form button {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
}

.chat-form button:hover {
    background: var(--primary-dark);
}

.chat-status {
    margin-top: 9px;
    font-size: 11px;
    color: var(--muted);
}

/* =====================================
   FOOTER
===================================== */

footer {
    margin-top: 55px;
    padding: 25px;
    text-align: center;
    background: #222;
    color: white;
    font-size: 13px;
}

/* =====================================
   RESPONSIVE DESIGN
===================================== */

@media (max-width: 700px) {
    header {
        padding: 16px 20px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-navigation {
        width: 100%;
    }

    .account-navigation button {
        flex: 1;
    }

    main {
        margin: 22px auto;
        padding: 0 14px;
    }

    .marketplace-intro h2 {
        font-size: 22px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar input,
    .search-bar select,
    .search-bar button {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 145px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 13px;
    }

    .product-price {
        font-size: 17px;
    }

    .listings {
        padding: 16px;
    }

    .modal-content {
        padding: 22px 17px;
    }

    .product-modal-image {
        height: 230px;
    }

    .product-modal-name {
        font-size: 21px;
    }

    .product-modal-price {
        font-size: 24px;
    }

    .seller-contact-buttons {
        grid-template-columns: 1fr;
    }

    .manage-listing-controls {
        flex-direction: column;
    }

    .manage-listing-controls button {
        width: 100%;
    }

    .chat-messages {
        height: 300px;
    }
}

@media (max-width: 380px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 190px;
    }
}

/* =====================================
   INBOX & NOTIFICATIONS
===================================== */

.account-navigation {
    position: relative;
}

.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 20px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.notification-panel {
    position: fixed;
    top: 85px;
    right: 5%;
    z-index: 2000;
    width: min(360px, calc(100vw - 24px));
    max-height: 430px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
}

.notification-panel[hidden] {
    display: none !important;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.notification-panel-header button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f2f2f2;
    font-size: 21px;
}

.notification-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: white;
    text-align: left;
    gap: 5px;
}

.notification-item:hover,
.inbox-item:hover {
    background: var(--primary-light);
}

.notification-item strong {
    font-size: 14px;
}

.notification-item span {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #555;
    font-size: 12px;
}

.notification-item small {
    color: var(--primary);
    font-size: 11px;
    font-weight: bold;
}

.notification-empty {
    padding: 22px 16px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* INBOX MODAL */

.inbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
}

.inbox-modal.active {
    display: flex;
}

.inbox-content {
    position: relative;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 27px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.inbox-content h2 {
    padding-right: 35px;
    font-size: 23px;
}

.inbox-description {
    margin: 5px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.inbox-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    text-align: left;
    gap: 7px;
}

.inbox-item-top,
.inbox-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inbox-item-top strong {
    font-size: 14px;
}

.inbox-item-top > span {
    color: var(--muted);
    font-size: 10px;
}

.inbox-listing-name {
    color: var(--primary);
    font-size: 12px;
    font-weight: bold;
}

.inbox-item-bottom > span:first-child {
    min-width: 0;
    overflow: hidden;
    color: #555;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-unread-count {
    flex-shrink: 0;
    min-width: 21px;
    padding: 3px 7px;
    border-radius: 20px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
}

.inbox-status {
    margin-top: 15px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 700px) {
    .notification-panel {
        top: 145px;
        right: 12px;
    }

    .inbox-content {
        padding: 23px 16px;
    }

    .account-navigation {
        gap: 7px;
    }

    .account-navigation button {
        padding: 9px 10px;
        font-size: 12px;
    }
}

/* =====================================
   MY PROFILE
===================================== */

.profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.profile-modal.active {
    display: flex;
}

.profile-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    background: white;
    border-radius: 12px;
}

.profile-content h2 {
    font-size: 23px;
    padding-right: 35px;
}

.profile-description {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 20px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-form > label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
}

.profile-form input:not([type="file"]),
.profile-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.profile-form textarea {
    min-height: 100px;
    resize: vertical;
}

.profile-avatar-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 5px 0 12px;
}

.profile-avatar-area img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    border: 3px solid var(--primary-light);
}

.profile-photo-button {
    padding: 9px 16px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

#profile-save-button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 7px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

#profile-save-button:hover {
    background: var(--primary-dark);
}

#profile-message {
    min-height: 20px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

@media (max-width: 500px) {
    .profile-content {
        padding: 23px 17px;
    }
}

/* =====================================
   P2PMARKETPH - ACCOUNT FEATURES
   ===================================== */

   .clickable-seller {
    cursor: pointer;
    color: #ee4d2d;
    text-decoration: underline;
}

.clickable-seller:hover {
    color: #c83b20;
}

.profile-viewer-modal,
.history-modal,
.transactions-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.profile-viewer-modal.active,
.history-modal.active,
.transactions-modal.active {
    display: flex;
}

.profile-viewer-modal .modal-content,
.history-modal .modal-content,
.transactions-modal .modal-content {
    background: #fff;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 25px;
    position: relative;
}

.public-profile-avatar {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.public-profile-avatar img,
.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    background: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
}

.public-seller-profile {
    text-align: center;
}

.public-seller-profile h2 {
    margin-bottom: 5px;
}

.public-seller-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    text-align: left;
}

.public-seller-listings .product-card {
    cursor: pointer;
}

.history-item,
.transaction-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin: 12px 0;
    background: #fff;
}

.history-item h3,
.transaction-card h3 {
    margin-top: 0;
}

.history-item small,
.transaction-card small {
    color: #777;
}

.transaction-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.transaction-tabs button,
.transaction-actions button {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    padding: 9px 13px;
    cursor: pointer;
}

.transaction-tabs button.active {
    background: #ee4d2d;
    color: #fff;
    border-color: #ee4d2d;
}

.transaction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.transaction-actions button:first-child {
    background: #168344;
    color: #fff;
    border-color: #168344;
}

.transaction-actions button:last-child {
    background: #fff0eb;
    color: #c83b20;
    border-color: #f5c6ba;
}

.transaction-status {
    font-weight: bold;
}

.purchase-request-button {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: none;
    border-radius: 7px;
    background: #ee4d2d;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.purchase-request-button:hover {
    background: #d94325;
}

.purchase-request-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 600px) {
    .profile-viewer-modal .modal-content,
    .history-modal .modal-content,
    .transactions-modal .modal-content {
        padding: 18px;
        max-height: 90vh;
    }

    .public-seller-listings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.account-navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

#logout-button {
    margin-left: auto;
}
.contact-buyer-button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 14px;
    background: #ee4d2d;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.contact-buyer-button:hover {
    background: #d93d20;
}