/**
 * HivePress Integration Styles
 * Alaska Gun Trader Theme
 * 
 * @package Alaska_Gun_Trader
 */

/* ==========================================
   INSTANT SEARCH DROPDOWN (HivePress Pages)
   ========================================== */
.hp-form__field--text,
.hp-form__field--keyword {
    position: relative;
}

.hp-form .agt-instant-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
}

/* ==========================================
   PAGE HEADER WITH SEARCH FORM
   ========================================== */

.hp-page__header {
    background: #ffffff;
    padding: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: sticky;
    top: var(--header-height, 103px);
    z-index: 900;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hp-page__header:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Minimized state container */
.hp-page__header .search-minimized {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    min-height: 48px;
    background: linear-gradient(to right, #fafbfc 0%, #ffffff 100%);
    transition: opacity 0.2s ease-in-out;
    gap: 12px;
}

.hp-page__header:not(.is-pinned):hover .search-minimized {
    opacity: 0;
    pointer-events: none;
}

/* Expand trigger */
.search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: color 0.15s ease-in-out;
    user-select: none;
    flex: 1;
}

.search-trigger:hover {
    color: #2E4A3F;
}

.search-trigger svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Expanded form container */
.hp-page__header .hp-form--listing-search {
    max-width: 100%;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-page__header:not(.is-pinned):hover .hp-form--listing-search,
.hp-page__header .hp-form--listing-search:focus-within {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    padding: 20px 24px 24px;
}

/* When pinned, always show expanded */
.hp-page__header.is-pinned .hp-form--listing-search {
    max-height: 400px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    padding: 20px 24px 24px !important;
    overflow: visible;
}

.hp-page__header.is-pinned .search-minimized {
    opacity: 1 !important;
    pointer-events: auto !important;
    border-bottom: 1px solid #e5e7eb;
}

/* Active filters display in minimized state */
.hp-page__header .active-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.hp-page__header .active-filters-label {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

/* Filter chips/tags styling - production level */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #2E4A3F 0%, #1e3430 100%);
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D94F04;
    box-shadow: 0 0 4px rgba(217, 79, 4, 0.5);
}

.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==========================================
   SIDEBAR FILTERS - SLEEK HORIZONTAL LAYOUT
   ========================================== */

/* Hide default bulky sidebar */
.hp-page__sidebar,
.hp-listing__sidebar,
.widget-area {
    display: none;
}

/* Create new horizontal filter bar */
.hp-page__content {
    max-width: 100%;
    width: 100%;
}

/* Horizontal filter container right below search */
.hp-listing-filter-bar {
    background: linear-gradient(90deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 12px 20px;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #2d2d2d;
}

.hp-listing-filter-bar::-webkit-scrollbar {
    height: 4px;
}

.hp-listing-filter-bar::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.hp-listing-filter-bar::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 2px;
}

.hp-listing-filter-bar::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Filter group in horizontal bar */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-group label {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.filter-group select,
.filter-group input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 120px;
    transition: all 0.2s ease;
}

.filter-group select:hover,
.filter-group input:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    border-color: #D94F04;
    box-shadow: 0 0 0 2px rgba(217, 79, 4, 0.2);
}

/* Filter separator */
.filter-separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.1);
}

/* ==========================================
   HIVEPRESS FORM STYLING
   ========================================== */
.hp-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hp-form__field {
    margin-bottom: 25px;
}

.hp-form__label {
    display: block;
    font-weight: 600;
    color: #1C2526;
    margin-bottom: 8px;
    font-size: 14px;
}

.hp-form__label abbr {
    color: #D94F04;
    text-decoration: none;
}

.hp-form input[type="text"],
.hp-form input[type="email"],
.hp-form input[type="number"],
.hp-form input[type="url"],
.hp-form textarea,
.hp-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    font-size: 15px;
    color: #1C2526;
    background: #ffffff;
    transition: all 0.3s ease;
}

.hp-form input:focus,
.hp-form textarea:focus,
.hp-form select:focus {
    outline: none;
    border-color: #2E4A3F;
    box-shadow: 0 0 0 3px rgba(46, 74, 63, 0.1);
}

.hp-form textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.hp-form select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%232E4A3F" d="M1.41 0L6 4.58 10.59 0 12 1.42l-6 6-6-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.hp-form button[type="submit"],
.hp-form .button--primary {
    background: #2E4A3F;
    color: #ffffff;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hp-form button[type="submit"]:hover,
.hp-form .button--primary:hover {
    background: #1C2526;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 37, 38, 0.2);
}

/* Form messages */
.hp-form__message--error {
    background: #FFE5E5;
    border-left: 4px solid #D32F2F;
    padding: 12px 15px;
    border-radius: 4px;
    color: #D32F2F;
    margin-bottom: 20px;
}

.hp-form__message--success {
    background: #E8F5E9;
    border-left: 4px solid #2E4A3F;
    padding: 12px 15px;
    border-radius: 4px;
    color: #2E4A3F;
    margin-bottom: 20px;
}

/* ==========================================
   HIVEPRESS LISTINGS
   ========================================== */

/* Listing cards */
.hp-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hp-listing,
.hp-listing--view-block {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    height: 100%;
}

.hp-listing:hover,
.hp-listing--view-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #D94F04;
}

/* Listing Header - Contains Image */
.hp-listing__header {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    width: 100%;
    flex-shrink: 0;
    height: 220px;
}

/* Listing Image */
.hp-listing__image {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    width: 100%;
    height: 220px;
}

.hp-listing__image img,
.hp-listing__header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hp-listing:hover .hp-listing__image img,
.hp-listing:hover .hp-listing__header img {
    transform: scale(1.08);
}

/* Featured badge */
.hp-listing--featured .hp-listing__image::before,
.hp-listing--featured .hp-listing__header::before {
    content: '⭐ FEATURED';
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #D94F04 0%, #c44503 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(217, 79, 4, 0.3);
}

/* Listing Content Container */
.hp-listing__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 180px;
}

/* Title */
.hp-listing__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.4;
    height: auto;
    min-height: 44px;
}

.hp-listing__title a {
    color: #1C2526;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hp-listing__title a:hover {
    color: #D94F04;
}

/* Categories */
.hp-listing__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.hp-listing__category,
.hp-listing__categories a {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
}

.hp-listing__category:hover,
.hp-listing__categories a:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Description/Excerpt */
.hp-listing__description,
.hp-listing__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Listing Details (Location, Date, etc.) */
.hp-listing__details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin-top: auto;
    margin-bottom: 12px;
}

.hp-listing__details--primary {
    border-top: none;
    padding-top: 0;
}

.hp-listing__location,
.hp-listing__date,
.hp-listing__seller,
.hp-listing__created-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    justify-content: flex-start;
}

.hp-listing__location i,
.hp-listing__date i,
.hp-listing__seller i,
.hp-listing__created-date i {
    color: #9ca3af;
    font-size: 11px;
    width: 14px;
}

/* Linked seller in listing cards */
.hp-listing__seller--linked {
    position: relative;
    gap: 6px;
}

/* Seller row - sits between content and footer */
.hp-listing__seller-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid #e5e7eb;
}

.hp-listing__location-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.hp-listing__location-badge i {
    font-size: 10px;
    color: #D94F04;
}

.hp-listing__seller-link {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.hp-listing__seller-link:hover {
    text-decoration: underline;
}

/* Status-based name colors */
.agt-seller-status-online {
    color: #22c55e !important;
}

.agt-seller-status-away {
    color: #f59e0b !important;
}

.agt-seller-status-offline {
    color: #9ca3af !important;
}

.hp-listing__seller-message {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: all 0.2s;
    margin-left: 2px;
}

.hp-listing__seller-message:hover {
    color: #D94F04;
    transform: scale(1.1);
}

.hp-listing__seller-message i {
    font-size: 12px;
    width: auto;
    color: inherit;
}

/* Price Section - FOOTER */
.hp-listing__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
    border-top: 2px solid #e5e7eb;
    margin-top: auto;
    flex-shrink: 0;
}

/* Hide duplicate prices in listing CARDS only (not single listing pages) */
body .hp-listing--view-block .hp-listing__attributes--ternary .hp-listing__attribute--price,
body .hp-listing--view-block .hp-listing__attributes--secondary .hp-listing__attribute--price,
body .hp-listing--view-block .hp-listing__content .hp-listing__attribute--price {
    display: none;
}

/* Only show price in footer primary area for listing cards */
body .hp-listing--view-block .hp-listing__footer .hp-listing__attribute--price {
    display: block;
}

/* Format price on single listing pages (sidebar) */
body .hp-page__sidebar .hp-listing__attribute--price {
    font-size: 28px;
    font-weight: 700;
    color: #2E4A3F;
    font-family: 'Montserrat', sans-serif;
    padding: 16px;
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

/* Add dollar sign to single page prices */
body .hp-page__sidebar .hp-listing__attribute--price::before {
    content: '$';
    margin-right: 3px;
}

/* Price Display - Primary footer area only */
.hp-listing__attributes--primary {
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

/* Price formatting */
.hp-listing__footer .hp-listing__attribute--price {
    font-size: 24px;
    font-weight: 700;
    color: #2E4A3F;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

/* Add dollar sign before price */
.hp-listing__footer .hp-listing__attribute--price::before {
    content: '$';
    margin-right: 2px;
    color: #2E4A3F;
    font-weight: 700;
}

/* Action Buttons */
.hp-listing__action,
.hp-listing__actions,
.hp-listing__actions--primary {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Message/Chat icons */
.hp-listing__actions i,
.hp-listing__action i {
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 6px;
}

.hp-listing__actions i:hover,
.hp-listing__action i:hover {
    color: #2E4A3F;
    background: #f3f4f6;
}

/* Favorites heart icon */
.hp-listing__favorites-toggle,
.hp-listing__favorite-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #9ca3af;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hp-listing__favorites-toggle:hover,
.hp-listing__favorite-toggle:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #ef4444;
}

.hp-listing__favorites-toggle--active,
.hp-listing__favorite-toggle--active {
    background: #fef2f2;
    border-color: #f87171;
    color: #ef4444;
}

/* Status badges */
.hp-listing__badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.hp-listing__badge {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.hp-listing__badge--sold {
    background: #dc2626;
    color: white;
}

.hp-listing__badge--pending {
    background: #f59e0b;
    color: white;
}

.hp-listing__badge--verified {
    background: #10b981;
    color: white;
}

/* Listing Type Badges */
.listing-type-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    vertical-align: middle;
}

.listing-type-badge.for-sale {
    background: linear-gradient(135deg, #2E4A3F 0%, #1e3430 100%);
    color: #fff;
}

.listing-type-badge.wtb {
    background: linear-gradient(135deg, #D94F04 0%, #c44503 100%);
    color: #fff;
}

.listing-type-badge.trade {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
}

/* ==========================================
   HIVEPRESS BADGES & ICONS
   ========================================== */
.hp-listing__favorites,
.hp-listing__reviews {
    color: #D94F04;
}

.hp-listing--claimed::after {
    content: 'Verified';
    background-color: #2E4A3F;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Geolocation icon */
.hp-form .hp-form__field--location input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23D94F04"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ==========================================
   HIVEPRESS SEARCH FORMS - ADD LABELS
   ========================================== */

/* Style the search form container */
.hp-form--listing-search,
.hp-search-form {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* Remove default field margins */
.hp-form--listing-search .hp-field {
    position: relative;
    margin-bottom: 0;
}

.hp-form--listing-search .hp-form__field {
    margin-bottom: 0;
}

/* Hide form messages in search */
.hp-form--listing-search .hp-form__messages {
    display: none;
}

/* Style labels - compact and subtle */
.hp-form--listing-search .hp-field__label {
    display: none;
}

/* Style all search inputs - compact and clean */
.hp-form--listing-search input[type="text"],
.hp-form--listing-search input[type="search"],
.hp-form--listing-search input[type="number"],
.hp-form--listing-search select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.hp-form--listing-search input:focus,
.hp-form--listing-search select:focus {
    outline: none;
    border-color: #2E4A3F;
    box-shadow: 0 0 0 3px rgba(46, 74, 63, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background: #fafbfc;
}

.hp-form--listing-search input:hover:not(:focus),
.hp-form--listing-search select:hover:not(:focus) {
    border-color: #9ca3af;
}

/* Style the search button - compact */
.hp-form--listing-search button[type="submit"],
.hp-form--listing-search .hp-form__button,
.hp-form--listing-search .hp-field--submit {
    background: linear-gradient(135deg, #D94F04 0%, #bf4504 100%) !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.hp-form--listing-search button[type="submit"]:hover,
.hp-form--listing-search .hp-form__button:hover {
    background: linear-gradient(135deg, #bf4504 0%, #a33d03 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.hp-form--listing-search button[type="submit"]:active {
    transform: translateY(0);
}

/* Horizontal inline layout for form fields */
.hp-form--listing-search .hp-form__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
    align-items: center;
}

/* Field sizing - make search keyword larger */
.hp-form--listing-search .hp-form__field--search {
    flex: 2 1 280px;
    min-width: 200px;
}

.hp-form--listing-search .hp-form__field--location {
    flex: 1 1 200px;
    min-width: 160px;
}

.hp-form--listing-search .hp-form__field--select {
    flex: 1 1 180px;
    min-width: 150px;
}

/* Price range fields - compact inline */
.hp-form--listing-search .hp-form__field--number {
    flex: 0 1 110px;
    min-width: 90px;
}

.hp-form--listing-search input[type="number"] {
    padding-left: 12px;
}

/* Price separator */
.price-range-separator {
    display: inline-flex;
    align-items: center;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    padding: 0 4px;
}

/* Footer inline with fields */
.hp-form--listing-search .hp-form__footer {
    margin-top: 0;
    text-align: left;
    display: inline-flex;
    align-items: center;
    visibility: visible;
    flex: 0 0 auto;
    margin-left: auto;
    gap: 8px;
}

.hp-form--listing-search .hp-form__footer button[type="submit"] {
    width: auto;
    min-width: 120px;
    margin: 0;
    display: inline-flex;
}

.hp-form--listing-search .hp-form__footer .search-pin-toggle {
    margin-left: 0;
}

/* If HivePress uses different class names, target those too */
.hp-listing__search-form .hp-field,
form[data-component="search-form"] .hp-field {
  position: relative;
}

/* Add placeholder styling */
.hp-form--listing-search input::placeholder,
.hp-form--listing-search select::placeholder {
 color: #999;
    opacity: 1;
}

/* Dropdown arrow for selects - smaller */
.hp-form--listing-search select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path fill="%23666" d="M1 0L5 4 9 0 10 1l-5 5-5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Location field with icon - compact */
.hp-form--listing-search .hp-field--location {
    position: relative;
}

.hp-form--listing-search .hp-field--location a {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #2E4A3F;
    font-size: 14px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hp-form--listing-search .hp-field--location a:hover {
    color: #D94F04;
}

/* Add placeholder styling */
.hp-form--listing-search input::placeholder,
.hp-form--listing-search select::placeholder {
    color: #999;
    opacity: 1;
}

/* ==========================================
   RESPONSIVE FORM LAYOUT
   ========================================== */

@media (max-width: 1200px) {
    /* Stack some fields on smaller screens */
    .hp-form--listing-search .hp-form__field--select {
        flex: 1 1 140px;
    }
}

@media (max-width: 992px) {
    .hp-form--listing-search .hp-form__fields {
        gap: 8px;
    }
    
    .hp-form--listing-search .hp-form__field--search {
        flex: 1 1 100%;
    }
    
    .hp-form--listing-search .hp-form__footer {
        flex: 1 1 100%;
        margin-top: 8px;
    }
    
    .hp-form--listing-search .hp-form__footer button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hp-form--listing-search {
        padding: 12px 15px;
    }
    
    .hp-form--listing-search .hp-form__fields {
        flex-direction: column;
        gap: 8px;
    }
    
    .hp-form--listing-search .hp-form__field--search,
    .hp-form--listing-search .hp-form__field--location,
    .hp-form--listing-search .hp-form__field--select {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* ==========================================
   HIDE CATEGORY IMAGES
   ========================================== */

/* Hide all category image blocks */
.hp-listing-category__image,
.hp-listing-category__header {
    display: none;
}

/* Hide category descriptions */
.hp-listing-category__description {
    display: none;
}

/* Adjust category card layout without images */
.hp-listing-category {
    display: flex;
    flex-direction: column;
    position: relative;
}

.hp-listing-category__content {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.hp-listing-category__content:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Make the entire category card clickable */
.hp-listing-category__content a {
    text-decoration: none;
    color: inherit;
}

.hp-listing-category__name a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* ==========================================
   HIVEPRESS ARCHIVE PAGES
   ========================================== */
.post-type-archive-hp_listing .page-header,
.tax-hp_listing_category .page-header {
    background: #1C2526;
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 40px;
}

/* HivePress search form now visible - removed display:none rules */

.post-type-archive-hp_listing .page-title,
.tax-hp_listing_category .page-title {
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.taxonomy-description {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================
   LISTING FILTERS
   ========================================== */
.listing-filters {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* HivePress Native Form Styling */
.hp-form--listing-search .hp-form__row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 0;
}

.hp-form--listing-search .hp-form__field {
    margin-bottom: 0;
}

.hp-form--listing-search .hp-field__label {
    display: block;
    font-weight: 600;
    color: #1C2526;
    font-size: 14px;
    margin-bottom: 8px;
}

.hp-form--listing-search input[type="text"],
.hp-form--listing-search input[type="search"],
.hp-form--listing-search select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    font-size: 15px;
    color: #1C2526;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
}

.hp-form--listing-search input:focus,
.hp-form--listing-search select:focus {
    outline: none;
    border-color: #2E4A3F;
    box-shadow: 0 0 0 3px rgba(46, 74, 63, 0.1);
}

.hp-form--listing-search select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231C2526' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    cursor: pointer;
}

.hp-form--listing-search button[type="submit"] {
    background: #0070C0;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}

.hp-form--listing-search button[type="submit"]:hover {
    background: #2E4A3F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 112, 192, 0.3);
}

/* Legacy custom form styles (if needed) */
.listing-search-form .filter-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr;
    gap: 15px;
    align-items: end;
}

.filter-row-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    gap: 15px;
    align-items: end;
    margin-top: 15px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: #1C2526;
    font-size: 14px;
    margin-bottom: 5px;
}

.filter-field .search-input,
.filter-field .search-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    font-size: 15px;
    color: #1C2526;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
}

.filter-field .search-input:focus,
.filter-field .search-select:focus {
    outline: none;
    border-color: #2E4A3F;
    box-shadow: 0 0 0 3px rgba(46, 74, 63, 0.1);
}

.filter-field .search-select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M1.41 0L6 4.58 10.59 0 12 1.42l-6 6-6-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.filter-submit .search-submit {
    background: #D94F04;
    color: #ffffff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

.filter-submit .search-submit:hover {
    background: #2E4A3F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 79, 4, 0.3);
}

/* ==========================================
   LISTINGS GRID
   ========================================== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.listing-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.listing-image {
    display: block;
}

.listing-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.listing-content {
    padding: 20px;
}

.listing-title {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.listing-title a {
    color: #1C2526;
    text-decoration: none;
}

.listing-title a:hover {
    color: #D94F04;
}

.listing-price {
    color: #D94F04;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.listing-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

.listing-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #777;
}

.listing-category,
.listing-location {
    padding: 5px 10px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    color: #1C2526;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    font-size: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination .page-numbers {
    padding: 10px 15px;
    background: #ffffff;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    color: #1C2526;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #2E4A3F;
    color: #ffffff;
    border-color: #2E4A3F;
}

/* ==========================================
   BREADCRUMBS
   ========================================== */

.hp-breadcrumbs {
    background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.hp-breadcrumbs__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hp-breadcrumb {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.hp-breadcrumb__item {
    display: inline-flex;
    align-items: center;
}

.hp-breadcrumb__link {
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

.hp-breadcrumb__link:hover {
    color: #D94F04;
    background: #fef2f2;
}

.hp-breadcrumb__link i {
    margin-right: 6px;
    font-size: 12px;
}

.hp-breadcrumb__separator {
    margin: 0 8px;
    color: #d1d5db;
    font-weight: 300;
}

.hp-breadcrumb__item:last-child .hp-breadcrumb__link {
    color: #D94F04;
    font-weight: 600;
    pointer-events: none;
    background: transparent;
}

/* ==========================================
   AGE GATE MODAL
   ========================================== */

#agt-age-gate {
    display: none;
}

.agt-age-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 37, 38, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agt-age-modal {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
}

.agt-age-modal h2 {
    color: #1C2526;
    margin-bottom: 20px;
}

.agt-age-modal p {
    margin-bottom: 30px;
}

.agt-age-confirm {
    background: #2E4A3F;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agt-age-confirm:hover {
    background: #D94F04;
}

.agt-age-exit {
    background: #ccc;
    color: #333;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.agt-age-exit:hover {
    background: #999;
}

/* ========================================
   ACCOUNT LISTINGS PAGE FIXES
   ======================================== */

/* Table-based listings layout (account page) */
table.hp-listings {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

table.hp-listings tr.hp-listing {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table.hp-listings td {
    padding: 15px;
    vertical-align: middle;
    border: none;
}

/* Title column - make it wider and wrap properly */
table.hp-listings .hp-listing__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    max-width: 300px;
}

table.hp-listings .hp-listing__title span {
    display: block;
    line-height: 1.4;
}

/* Categories column */
table.hp-listings .hp-listing__categories {
    color: #666;
    font-size: 14px;
    min-width: 150px;
}

/* Date column */
table.hp-listings .hp-listing__date {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
}

/* Status badges - styled properly */
table.hp-listings .hp-listing__status {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-block;
}

table.hp-listings .hp-listing__status--pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

table.hp-listings .hp-listing__status--publish {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

table.hp-listings .hp-listing__status--draft {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

/* Actions column */
table.hp-listings .hp-listing__actions {
    text-align: right;
    min-width: 100px;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    table.hp-listings,
    table.hp-listings tbody,
    table.hp-listings tr,
    table.hp-listings td {
        display: block;
        width: 100%;
    }
    
    table.hp-listings tr.hp-listing {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    table.hp-listings td {
        padding: 8px 10px;
        text-align: left;
    }
    
    table.hp-listings .hp-listing__title {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .hp-listing__categories,
    .hp-listing__date {
        display: inline-block;
        margin-right: 10px;
    }
}

/* ==========================================
   LISTING CARDS - RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .hp-listings {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .hp-listing__title {
        font-size: 16px;
        min-height: auto;
    }
    
    .hp-listing__price .hp-listing-price,
    .hp-listing__price .hp-listing-price__value,
    .price-amount {
        font-size: 20px;
    }
    
    .hp-listing__footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .hp-listing__action {
        flex-direction: column;
    }
    
    .hp-listing__action .button {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hp-listings {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1400px) {
    .hp-listings {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   EMPTY STATE STYLING
   ========================================== */

/* Empty state for account pages */
.hp-page--listings_edit_page .hp-page__content:empty::before,
.hp-page--messages_thread_page .hp-page__content:empty::before,
.hp-page--listings_favorite_page .hp-page__content:empty::before {
    content: '';
    display: block;
    width: 100%;
    min-height: 400px;
}

.hp-page--listings_edit_page .hp-page__content:empty::after {
    content: '📝 You haven\'t created any listings yet.\A\AReady to sell? Click the button below to create your first listing!';
    white-space: pre-wrap;
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.8;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 40px auto;
    max-width: 600px;
    position: relative;
}

.hp-page--messages_thread_page .hp-page__content:empty::after {
    content: '💬 No messages yet.\A\AYour messages with buyers and sellers will appear here.';
    white-space: pre-wrap;
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.8;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 40px auto;
    max-width: 600px;
}

.hp-page--listings_favorite_page .hp-page__content:empty::after {
    content: '❤️ No favorites yet.\A\AStart browsing listings and save your favorites for easy access later!';
    white-space: pre-wrap;
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.8;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 40px auto;
    max-width: 600px;
}

/* ==========================================
   LISTING CARD OVERRIDES - FORCE APPLY
   ========================================== */

/* Force grid layout on listing archives */
body .hp-listings.hp-grid,
body .hp-listings.hp-block,
body div.hp-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 0;
    margin: 0;
}

/* Force grid row layout */
body .hp-listings .hp-row {
    display: contents;
}

/* ==========================================
   UNIFIED LISTING CARD STYLING
   Same design everywhere on the site
   ========================================== */

body .hp-listing.hp-listing--view-block,
body article.hp-listing--view-block,
.akammo-listings-section .hp-listing.hp-listing--view-block,
.hp-template--listings-edit-page .hp-listing.hp-listing--view-block {
    height: 440px;
    min-height: 440px;
    max-height: 440px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
}

body .hp-listing.hp-listing--view-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(217, 79, 4, 0.3);
}

/* Link wrapper fills the card */
body .hp-listing--view-block .hp-listing__link-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

/* Image header - fixed height */
body .hp-listing--view-block .hp-listing__header {
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

body .hp-listing--view-block .hp-listing__image {
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    width: 100%;
    overflow: hidden;
}

body .hp-listing--view-block .hp-listing__image img,
body .hp-listing--view-block .hp-listing__header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

body .hp-listing--view-block:hover .hp-listing__header img {
    transform: scale(1.05);
}

/* Title styling - fixed height with line clamp */
body .hp-listing--view-block .hp-listing__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    overflow: hidden;
    color: #1a1a1a;
}

body .hp-listing--view-block .hp-listing__title,
body .hp-listing--view-block .hp-listing__title a {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    text-decoration: none;
    color: inherit;
}

/* Content area - fixed height */
body .hp-listing--view-block .hp-listing__content {
    padding: 14px 16px;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Excerpt - fixed height with line clamp */
body .hp-listing--view-block .hp-listing__excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    margin: 0 0 auto 0;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding-left: 10px;
    border-left: 3px solid #D94F04;
    font-style: italic;
}

/* Details section - push to bottom of content area */
body .hp-listing--view-block .hp-listing__details {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

body .hp-listing--view-block .hp-listing__details .hp-listing__attribute {
    display: flex;
    align-items: center;
    gap: 6px;
}

body .hp-listing--view-block .hp-listing__details .hp-listing__attribute i,
body .hp-listing--view-block .hp-listing__details .hp-listing__attribute svg {
    color: #D94F04;
    width: 14px;
    font-size: 14px;
}

/* Footer styling - fixed height */
body .hp-listing--view-block .hp-listing__footer {
    padding: 12px 16px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Price display in cards */
body .hp-listing--view-block .hp-listing__footer .hp-listing__attribute--price,
body .hp-listing--view-block .hp-listing__price {
    font-size: 22px;
    font-weight: 800;
    color: #2E4A3F;
    display: block;
    visibility: visible;
    letter-spacing: -0.02em;
}

/* Favorite button styling */
body .hp-listing--view-block .hp-listing__footer .hp-listing__action--favorite,
body .hp-listing--view-block .favorite-toggle {
    padding: 8px;
    border-radius: 50%;
    background: rgba(217, 79, 4, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .hp-listing--view-block .hp-listing__footer .hp-listing__action--favorite:hover,
body .hp-listing--view-block .favorite-toggle:hover {
    background: rgba(217, 79, 4, 0.2);
    transform: scale(1.1);
}

body .hp-listing--view-block .favorite-toggle svg {
    width: 20px;
    height: 20px;
    color: #D94F04;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.2s ease;
}

body .hp-listing--view-block .favorite-toggle.is-favorited svg {
    fill: #D94F04;
}

/* ==========================================
   GRID ITEM SIZING - ALL PAGES
   ========================================== */

body .hp-grid__item {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    body .hp-listings .hp-grid__item,
    body .hp-listings > .hp-row > * {
        flex: 0 0 calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

@media (max-width: 767px) {
    body .hp-listings .hp-grid__item {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    body .hp-listing.hp-listing--view-block {
        height: auto;
        min-height: auto;
        max-height: none;
    }
    
    body .hp-listing--view-block .hp-listing__header,
    body .hp-listing--view-block .hp-listing__image {
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }
    
    body .hp-listing--view-block .hp-listing__content {
        height: auto;
        min-height: auto;
        max-height: none;
    }
}

/* ==========================================
   LISTING CARD FAVORITE BUTTON
   ========================================== */
body .hp-listing__header {
    position: relative;
}

body .listing-card-favorite,
body .agt-favorite-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    min-width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    text-decoration: none;
    z-index: 10;
}

body .listing-card-favorite:hover,
body .agt-favorite-toggle:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

body .listing-card-favorite i,
body .agt-favorite-toggle i {
    font-size: 16px;
    color: #D94F04;
    line-height: 1;
}

body .listing-card-favorite .fav-count,
body .agt-favorite-toggle .fav-count {
    font-size: 12px;
    font-weight: 600;
    color: #1C2526;
    line-height: 1;
}

body .listing-card-favorite .fav-count:empty,
body .agt-favorite-toggle .fav-count:empty {
    display: none;
}

/* Active state when favorited */
body .listing-card-favorite.is-favorited,
body .agt-favorite-toggle.is-favorited {
    background: #D94F04;
}

body .listing-card-favorite.is-favorited i,
body .agt-favorite-toggle.is-favorited i {
    color: #fff;
}

body .listing-card-favorite.is-favorited .fav-count,
body .agt-favorite-toggle.is-favorited .fav-count {
    color: #fff;
}

body .listing-card-favorite.is-favorited:hover,
body .agt-favorite-toggle.is-favorited:hover {
    background: #bf4504;
}

/* Hide price text field from search and filter forms */
.hp-form--listing-search input[name="price"],
.hp-form--listing-search input[name="price"] ~ *,
.hp-form--listing-search .hp-form__field--text:has(input[name="price"]),
.hp-form--listing-filter input[name="price"],
.hp-form--listing-filter input[name="price"] ~ *,
.hp-form--listing-filter .hp-form__field--text:has(input[name="price"]) {
    display: none;
}

/* ==========================================
   SINGLE LISTING PAGE - PERFECT LAYOUT
   Based on actual HivePress HTML structure
   ========================================== */

/* Force body class targeting for maximum specificity */
body.single-hp_listing {
    background: #f5f5f5;
}

/* Desktop layout: 2 columns */
@media (min-width: 768px) {
    /* Main container - force 2-column grid */
    body.single-hp_listing .hp-listing--view-page {
        display: grid !important;
        grid-template-columns: 1fr 380px !important;
        gap: 20px !important;
        max-width: 1400px !important;
        margin: 20px auto !important;
        padding: 0 20px !important;
    }

    /* LEFT COLUMN - Content */
    body.single-hp_listing .agt-listing-content {
        grid-column: 1 !important;
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    /* Title */
    body.single-hp_listing .hp-listing__title {
        font-size: 24px !important;
        font-weight: 700 !important;
        color: #0F1111 !important;
        padding: 20px 24px 12px !important;
        margin: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
        line-height: 1.3 !important;
    }

    /* Location, categories, date */
    body.single-hp_listing .hp-listing__details--primary {
        padding: 12px 24px !important;
        border-bottom: 1px solid #e5e7eb !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 16px !important;
        font-size: 13px !important;
        color: #565959 !important;
    }

    body.single-hp_listing .hp-listing__location,
    body.single-hp_listing .hp-listing__categories,
    body.single-hp_listing .hp-listing__created-date {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    /* Top bar with tabs and favorite */
    body.single-hp_listing .hp-page__topbar {
        padding: 12px 24px !important;
        background: #fafbfc !important;
        border-bottom: 1px solid #e5e7eb !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    body.single-hp_listing .hp-listing__actions--secondary {
        display: flex !important;
        gap: 8px !important;
    }

    body.single-hp_listing .hp-listing__action--favorite {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 8px 16px !important;
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        color: #C45500 !important;
        text-decoration: none !important;
        font-size: 14px !important;
        transition: all 0.2s !important;
    }

    body.single-hp_listing .hp-listing__action--favorite:hover {
        background: #fef2f2 !important;
        border-color: #f87171 !important;
    }

    /* Image section - constrained */
    body.single-hp_listing .hp-listing__images {
        max-width: 500px !important;
        margin: 0 !important;
        padding: 24px !important;
        background: #fafbfc !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    body.single-hp_listing .hp-listing__images img {
        width: 100% !important;
        height: auto !important;
        max-height: 400px !important;
        object-fit: contain !important;
        border-radius: 4px !important;
        border: 1px solid #ddd !important;
    }

    /* Description */
    body.single-hp_listing .hp-listing__description {
        padding: 24px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        color: #0F1111 !important;
    }

    body.single-hp_listing .hp-listing__description p {
        margin-bottom: 14px !important;
    }

    /* RIGHT COLUMN - Sidebar */
    body.single-hp_listing .agt-listing-sidebar {
        grid-column: 2 !important;
    }

    /* Price box - HUGE AND PROMINENT */
    body.single-hp_listing .agt-price-box {
        background: #fff !important;
        border: 1px solid #d5d9d9 !important;
        border-radius: 8px !important;
        padding: 0 !important;
        margin-bottom: 12px !important;
        overflow: hidden !important;
    }

    body.single-hp_listing .agt-price-label {
        display: block !important;
        font-size: 12px !important;
        color: #565959 !important;
        padding: 12px 20px 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        font-weight: 600 !important;
    }

    body.single-hp_listing .agt-price-value {
        display: block !important;
        font-size: 48px !important;
        font-weight: 400 !important;
        color: #0F1111 !important;
        padding: 4px 20px 20px !important;
        font-family: 'Amazon Ember', Arial, sans-serif !important;
        line-height: 1 !important;
    }

    /* Action buttons widget */
    body.single-hp_listing .hp-listing__actions--primary {
        background: #fff !important;
        border: 1px solid #d5d9d9 !important;
        border-radius: 8px !important;
        padding: 16px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Message button - ORANGE AND BIG */
    body.single-hp_listing .hp-listing__action--message {
        display: block !important;
        width: 100% !important;
        padding: 14px 20px !important;
        background: #D94F04 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        text-decoration: none !important;
        box-shadow: 0 2px 5px rgba(217,79,4,0.3) !important;
    }

    body.single-hp_listing .hp-listing__action--message:hover {
        background: #bf4504 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(217,79,4,0.4) !important;
    }

    /* Other action links */
    body.single-hp_listing .hp-listing__action--review,
    body.single-hp_listing .hp-listing__action--claim,
    body.single-hp_listing .hp-listing__action--report {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 10px !important;
        color: #007185 !important;
        text-decoration: none !important;
        font-size: 14px !important;
        border-radius: 4px !important;
        transition: background 0.2s !important;
    }

    body.single-hp_listing .hp-listing__action--review:hover,
    body.single-hp_listing .hp-listing__action--claim:hover,
    body.single-hp_listing .hp-listing__action--report:hover {
        background: #f7fafa !important;
    }

    body.single-hp_listing .hp-listing__action i {
        font-size: 16px !important;
    }
}

/* Tablet: stack columns */
@media (min-width: 768px) and (max-width: 991px) {
    body.single-hp_listing .hp-listing--view-page {
        grid-template-columns: 1fr !important;
    }

    body.single-hp_listing .agt-listing-content,
    body.single-hp_listing .agt-listing-sidebar {
        grid-column: 1 !important;
    }

    body.single-hp_listing .agt-price-value {
        font-size: 40px !important;
    }
}

/* Mobile: full stack */
@media (max-width: 767px) {
    body.single-hp_listing .hp-listing--view-page {
        display: block !important;
        padding: 12px !important;
    }

    body.single-hp_listing .agt-listing-content,
    body.single-hp_listing .agt-listing-sidebar {
        margin-bottom: 16px !important;
    }

    body.single-hp_listing .hp-listing__title {
        font-size: 20px !important;
        padding: 16px !important;
    }

    body.single-hp_listing .hp-listing__images {
        max-width: 100% !important;
        padding: 16px !important;
    }

    body.single-hp_listing .hp-listing__images img {
        max-height: 300px !important;
    }

    body.single-hp_listing .hp-listing__description {
        padding: 16px !important;
        font-size: 13px !important;
    }

    body.single-hp_listing .agt-price-value {
        font-size: 36px !important;
    }

    body.single-hp_listing .hp-listing__action--message {
        padding: 14px !important;
        font-size: 15px !important;
    }

    body.single-hp_listing .hp-page__topbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
}

/* ==========================================
   LISTING CARDS - UNIFIED WIDTH EVERYWHERE
   Make cards same size as homepage
   ========================================== */

/* Category pages, Favorites page, Search results - full width content area */
.hp-template--listings-view-page .hp-page__content,
.hp-template--listing-category-view-page .hp-page__content,
.hp-template--listings-favorite-page .hp-page__content {
    max-width: 100%;
}

/* Override HivePress grid structure - make .hp-row act as grid container */
.hp-template--listings-view-page .hp-listings .hp-row,
.hp-template--listing-category-view-page .hp-listings .hp-row,
.hp-template--listings-favorite-page .hp-listings .hp-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Make grid items fill their grid cell */
.hp-template--listings-view-page .hp-grid__item,
.hp-template--listing-category-view-page .hp-grid__item,
.hp-template--listings-favorite-page .hp-grid__item {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Also target listings container without .hp-row */
.hp-template--listings-view-page .hp-listings.hp-grid,
.hp-template--listing-category-view-page .hp-listings.hp-grid,
.hp-template--listings-favorite-page .hp-listings.hp-grid {
    display: block !important;
}

/* 1 column on mobile */
@media (max-width: 768px) {
    .hp-template--listings-view-page .hp-listings .hp-row,
    .hp-template--listing-category-view-page .hp-listings .hp-row,
    .hp-template--listings-favorite-page .hp-listings .hp-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   MY LISTINGS PAGE - CARD GRID LAYOUT
   ========================================== */

/* Force the whole page content to use our style */
.hp-template--listings-edit-page .hp-page__content {
    max-width: 100%;
    padding: 20px;
}

/* Convert table to grid container */
.hp-template--listings-edit-page .hp-listings.hp-table,
.hp-template--listings-edit-page table.hp-listings {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    border: none !important;
    background: transparent !important;
    border-collapse: separate !important;
    width: 100% !important;
}

/* Hide table header */
.hp-template--listings-edit-page .hp-listings thead,
.hp-template--listings-edit-page .hp-listings .hp-table__header {
    display: none !important;
}

/* Make table body a grid container */
.hp-template--listings-edit-page .hp-listings tbody,
.hp-template--listings-edit-page .hp-listings .hp-table__body {
    display: contents !important;
}

/* Hide original table rows - our card replaces the content */
.hp-template--listings-edit-page .hp-listing--edit-block {
    display: contents !important;
}

/* Hide original table cells */
.hp-template--listings-edit-page .hp-listing--edit-block > td,
.hp-template--listings-edit-page .hp-listing--edit-block > th {
    display: none !important;
}

/* Our custom card inside the table structure - make it display as grid item */
.hp-template--listings-edit-page .hp-listing.hp-listing--view-block {
    display: flex !important;
    flex-direction: column !important;
    height: 440px !important;
    min-height: 440px !important;
    max-height: 440px !important;
}

/* Responsive: 1 column on mobile */
@media (max-width: 768px) {
    .hp-template--listings-edit-page .hp-listings.hp-table,
    .hp-template--listings-edit-page table.hp-listings {
        grid-template-columns: 1fr !important;
    }
    
    .hp-template--listings-edit-page .hp-listing.hp-listing--view-block {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
}

/* Status badge for editable cards */
.hp-listing__status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 5;
    background: #e5e7eb;
    color: #374151;
}

.hp-listing__status-badge--published {
    background: #d1fae5;
    color: #065f46;
}

.hp-listing__status-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

.hp-listing__status-badge--draft {
    background: #e5e7eb;
    color: #6b7280;
}

/* Edit actions in footer */
.hp-listing__edit-actions {
    display: flex;
    gap: 8px;
}

.hp-listing__action--edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #D94F04;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hp-listing__action--edit:hover {
    background: #bf4504;
    color: #fff;
}

.hp-listing__action--edit i {
    font-size: 14px;
}

/* Responsive for My Listings */
@media (max-width: 768px) {
    .hp-template--listings-edit-page .hp-listings.hp-table {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 576px) {
    .hp-template--listings-edit-page .hp-listings.hp-table {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   RECENT LISTINGS SECTION (No Results)
   ========================================== */
.agt-recent-listings-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

.agt-recent-listings-wrapper {
    max-width: 100%;
}

.agt-recent-listings-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.agt-recent-icon {
    font-size: 1.25rem;
}

.agt-recent-listings-subtitle {
    color: #6b7280;
    font-size: 1rem;
    margin: 0 0 24px 0;
}

.agt-recent-grid {
    margin-bottom: 24px;
}

.agt-recent-grid .hp-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.agt-recent-grid .hp-grid__item {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
}

.agt-recent-listings-cta {
    text-align: center;
    margin-top: 24px;
}

.agt-recent-listings-cta .button--primary {
    display: inline-block;
    padding: 12px 32px;
    background: #D94F04;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.agt-recent-listings-cta .button--primary:hover {
    background: #bf4504;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 79, 4, 0.3);
}

/* No results message styling */
.hp-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.hp-no-results::before {
    content: "🔍";
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Responsive recent listings */
@media (max-width: 992px) {
    .agt-recent-grid .hp-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .agt-recent-grid .hp-row {
        grid-template-columns: 1fr;
    }
    
    .agt-recent-listings-title {
        font-size: 1.25rem;
    }
    
    .agt-recent-listings-section {
        margin-top: 24px;
        padding-top: 24px;
    }
}

/* ==========================================================================
   MESSAGES SYSTEM - Alaska Gun Trader
   ========================================================================== */

/* Messages Thread Page (Inbox) */
.hp-template--messages-thread-page .hp-page__content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.hp-template--messages-thread-page .hp-page__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hp-template--messages-thread-page .hp-page__title::before {
    content: '\f0e0';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #D94F04;
}

/* Message Table Styling */
.hp-messages.hp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.hp-message--thread-block {
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.hp-message--thread-block:hover {
    background: #f8fafc;
}

.hp-message--thread-block:last-child {
    border-bottom: none;
}

/* Unread message styling */
.hp-message--thread-block:not(.hp-message--read) {
    background: linear-gradient(90deg, #fff8f5 0%, #fff 100%);
    border-left: 3px solid #D94F04;
}

.hp-message--thread-block:not(.hp-message--read):hover {
    background: linear-gradient(90deg, #fff5f0 0%, #f8fafc 100%);
}

/* Sender Column */
.hp-message__sender {
    padding: 1rem 1.25rem;
    width: 35%;
}

.hp-message__sender .agt-message-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
}

.hp-message__sender .agt-message-link:hover {
    color: #D94F04;
}

.hp-message__sender .agt-message-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f4f8;
    flex-shrink: 0;
}

.hp-message--thread-block:not(.hp-message--read) .agt-message-status {
    background: #D94F04;
    color: #fff;
}

.hp-message__sender .agt-message-status i {
    font-size: 1rem;
}

.hp-message__sender .agt-sender-name {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-message--thread-block:not(.hp-message--read) .agt-sender-name {
    font-weight: 700;
}

.hp-message__sender .agt-unread-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background: #D94F04;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
    margin-left: auto;
}

/* Listing Column */
.hp-message__listing {
    padding: 1rem 1.25rem;
    width: 45%;
}

.hp-message__listing .agt-listing-ref {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.hp-message__listing .agt-listing-ref > i {
    color: #999;
    font-size: 0.85rem;
}

.hp-message__listing .agt-listing-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.hp-message__listing .agt-view-listing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f0f4f8;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.hp-message__listing .agt-view-listing:hover {
    background: #D94F04;
    color: #fff;
}

.hp-message__listing .agt-view-listing i {
    font-size: 0.7rem;
}

/* Date Column */
.hp-message__sent-date {
    padding: 1rem 1.25rem;
    width: 20%;
    text-align: right;
    color: #888;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ==========================================================================
   MESSAGES VIEW PAGE (Conversation)
   ========================================================================== */

.hp-template--messages-view-page .hp-page__content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
    min-height: 500px;
}

.hp-template--messages-view-page .hp-page__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.hp-template--messages-view-page .hp-page__title::before {
    content: '\f075';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #D94F04;
}

/* Back button for conversation */
.agt-messages-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.agt-messages-back:hover {
    color: #D94F04;
}

/* Messages Container */
.hp-template--messages-view-page .hp-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

/* Scroll to see messages, not form */
.hp-template--messages-view-page .hp-messages:focus {
    outline: none;
}

/* Individual Message Bubbles */
.hp-message--view-block {
    background: #f0f4f8;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    margin: 0;
    max-width: 75%;
    position: relative;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hp-message--view-block::before,
.hp-message--view-block::after {
    display: none;
}

/* Sent messages (from current user) */
.hp-message--view-block.hp-message--sent {
    background: #D94F04;
    color: #fff;
    margin-left: auto;
    margin-right: 0;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
}

.hp-message--view-block.hp-message--sent .hp-message__sender,
.hp-message--view-block.hp-message--sent .hp-message__sent-date {
    color: rgba(255,255,255,0.85);
}

.hp-message--view-block.hp-message--sent .hp-message__sender a {
    color: #fff;
}

/* Message Header */
.hp-message--view-block .hp-message__header {
    padding-right: 0;
    margin-bottom: 0.5rem;
}

.hp-message--view-block .hp-message__details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.hp-message--view-block .hp-message__sender {
    font-weight: 600;
    color: #1a1a2e;
}

.hp-message--view-block .hp-message__sender a {
    color: inherit;
    text-decoration: none;
}

.hp-message--view-block .hp-message__sent-date {
    color: #888;
    font-size: 0.8rem;
}

/* Message Text */
.hp-message__text {
    line-height: 1.5;
    word-wrap: break-word;
}

.hp-message__text p {
    margin: 0;
}

/* Message Listing Reference in View */
.hp-message--view-block .hp-message__listing {
    padding: 0;
    width: auto;
    margin-bottom: 0.5rem;
}

.hp-message--view-block .hp-message__listing a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #666;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hp-message--view-block .hp-message__listing a:hover {
    background: rgba(0,0,0,0.1);
}

.hp-message--view-block.hp-message--sent .hp-message__listing a {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.hp-message--view-block.hp-message--sent .hp-message__listing a:hover {
    background: rgba(255,255,255,0.3);
}

/* Read status indicator */
.hp-message--view-block.hp-message--sent.hp-message--read::after {
    content: '\f560';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

/* Delete action */
.hp-message--view-block .hp-message__action--delete {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.hp-message--view-block:hover .hp-message__action--delete {
    display: block;
}

.hp-message--view-block .hp-message__action--delete:hover {
    color: #dc3545;
}

/* ==========================================================================
   MESSAGE SEND FORM
   ========================================================================== */

.hp-template--messages-view-page .hp-form--message-send {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
    position: sticky;
    bottom: 0;
}

.hp-form--message-send .hp-form__fields {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.hp-form--message-send .hp-form__field {
    flex: 1;
    margin-bottom: 0;
}

.hp-form--message-send .hp-form__field--text textarea {
    min-height: 48px;
    max-height: 150px;
    resize: vertical;
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.hp-form--message-send .hp-form__field--text textarea:focus {
    border-color: #D94F04;
    box-shadow: 0 0 0 3px rgba(217,79,4,0.1);
    outline: none;
}

.hp-form--message-send .hp-form__button {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #D94F04;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hp-form--message-send .hp-form__button:hover {
    background: #bf4504;
    transform: scale(1.05);
}

.hp-form--message-send .hp-form__button i {
    color: #fff;
    font-size: 1.1rem;
}

/* Hide button text, show icon */
.hp-form--message-send .hp-form__button span {
    display: none;
}

.hp-form--message-send .hp-form__button::before {
    content: '\f1d8';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #fff;
    font-size: 1rem;
}

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

@media (max-width: 768px) {
    .hp-message--thread-block td {
        display: block;
        width: 100% !important;
        padding: 0.5rem 1rem;
    }
    
    .hp-message--thread-block td:first-child {
        padding-top: 1rem;
    }
    
    .hp-message--thread-block td:last-child {
        padding-bottom: 1rem;
    }
    
    .hp-message__sender {
        border-bottom: none;
    }
    
    .hp-message__listing {
        padding-top: 0;
    }
    
    .hp-message__listing .agt-listing-title {
        max-width: none;
    }
    
    .hp-message__sent-date {
        text-align: left;
        padding-top: 0.25rem;
        font-size: 0.8rem;
    }
    
    .hp-template--messages-view-page .hp-page__content {
        max-height: none;
        min-height: auto;
    }
    
    .hp-message--view-block {
        max-width: 90%;
    }
    
    .hp-form--message-send .hp-form__fields {
        flex-wrap: wrap;
    }
    
    .hp-form--message-send .hp-form__field {
        width: 100%;
        flex: none;
    }
    
    .hp-form--message-send .hp-form__button {
        width: 100%;
        border-radius: 24px;
        height: 44px;
    }
    
    .hp-form--message-send .hp-form__button::before {
        content: 'Send Message';
        font-family: inherit;
        font-weight: 600;
    }
}

/* Empty inbox state */
.hp-template--messages-thread-page .hp-page__content .hp-messages:empty::before {
    content: '📭';
    display: block;
    text-align: center;
    font-size: 4rem;
    padding-top: 3rem;
}

.hp-template--messages-thread-page .hp-page__content .hp-messages:empty::after {
    content: 'No messages yet.\A\AYour conversations with buyers and sellers will appear here.';
    white-space: pre-wrap;
    display: block;
    text-align: center;
    color: #666;
    padding: 1rem 2rem 3rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* ==========================================================================
   FLOATING CHAT WIDGET - Full Messaging
   ========================================================================== */

.agt-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Main Chat Button */
.agt-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D94F04 0%, #bf4504 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(217, 79, 4, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.agt-chat-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(217, 79, 4, 0.5);
}

.agt-chat-button:active {
    transform: scale(0.95);
}

.agt-chat-icon {
    color: #fff;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.agt-chat-widget.is-open .agt-chat-icon {
    transform: rotate(15deg);
}

/* Unread Badge */
.agt-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #dc3545;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Pulse Animation */
.agt-chat-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(217, 79, 4, 0.4);
    pointer-events: none;
    opacity: 0;
}

.agt-chat-widget.has-unread .agt-chat-pulse {
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.agt-chat-widget.new-message .agt-chat-button {
    animation: newMessageShake 0.5s ease;
}

@keyframes newMessageShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-3px) rotate(-5deg); }
    40% { transform: translateX(3px) rotate(5deg); }
    60% { transform: translateX(-3px) rotate(-5deg); }
    80% { transform: translateX(3px) rotate(5deg); }
}

/* Enhanced bounce animation for new messages */
.agt-chat-widget.new-message-bounce .agt-chat-button {
    animation: newMessageBounce 1s cubic-bezier(0.36, 0, 0.66, -0.56);
}

@keyframes newMessageBounce {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-16px); }
    40% { transform: translateY(0); }
    55% { transform: translateY(-10px); }
    70% { transform: translateY(0); }
    85% { transform: translateY(-4px); }
}

/* Glow effect for unread messages */
.agt-chat-widget.has-unread .agt-chat-button {
    box-shadow: 0 4px 20px rgba(217, 79, 4, 0.4), 
                0 0 30px rgba(217, 79, 4, 0.3),
                0 0 60px rgba(217, 79, 4, 0.1);
}

.agt-chat-widget.new-message-bounce .agt-chat-button {
    box-shadow: 0 4px 30px rgba(217, 79, 4, 0.6), 
                0 0 50px rgba(217, 79, 4, 0.4),
                0 0 80px rgba(217, 79, 4, 0.2);
}

/* ==========================================================================
   USER ONLINE STATUS INDICATORS (Teams-style)
   ========================================================================== */

/* Base status dot */
.agt-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Online - Green with pulse */
.agt-status-dot.agt-status-online {
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Away/Recently Active - Orange */
.agt-status-dot.agt-status-away {
    background: #f59e0b;
}

/* Offline - Hidden or gray */
.agt-status-dot.agt-status-offline {
    display: none;
}

/* Status dot in chat widget thread list */
.agt-chat-thread-avatar {
    position: relative;
    flex-shrink: 0;
}

.agt-chat-thread-avatar .agt-status-dot {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.agt-chat-thread-avatar img {
    display: block;
}

/* Status dot on listing page seller card */
.card-seller .seller-avatar {
    position: relative;
}

.card-seller .seller-avatar .agt-status-dot {
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* Online label text next to seller name */
.seller-online-label {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.seller-online-label.agt-status-online {
    background: #dcfce7;
    color: #166534;
}

.seller-online-label.agt-status-away {
    background: #fef3c7;
    color: #92400e;
}

/* Seller rating stars */
.seller-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.seller-rating .hp-rating-stars {
    font-size: 12px;
}

.seller-rating-count {
    font-size: 12px;
    color: #6b7280;
}

/* Status dot on vendor/seller image in listing cards */
.hp-vendor__image.agt-has-status {
    position: relative;
}

.hp-vendor__image.agt-has-status a {
    position: relative;
    display: block;
}

.hp-vendor__image.agt-has-status .agt-status-dot {
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-width: 2px;
}

/* Chat Panel */
.agt-chat-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.agt-chat-widget.is-open .agt-chat-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Chat Views */
.agt-chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.agt-chat-view.active {
    display: flex;
}

/* Chat Header */
.agt-chat-header {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #D94F04 0%, #bf4504 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.agt-chat-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.agt-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agt-chat-header-actions a,
.agt-chat-header-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.agt-chat-header-actions a:hover,
.agt-chat-header-actions button:hover {
    background: rgba(255,255,255,0.25);
}

.agt-chat-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.agt-chat-back:hover {
    background: rgba(255,255,255,0.25);
}

.agt-chat-conv-info {
    flex: 1;
    min-width: 0;
}

.agt-chat-conv-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agt-chat-conv-listing {
    display: block;
    font-size: 0.75rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Body */
.agt-chat-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Thread List */
.agt-chat-threads {
    flex: 1;
    overflow-y: auto;
}

.agt-chat-thread-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    position: relative;
}

.agt-chat-thread-item:hover {
    background: #f8fafc;
}

.agt-chat-thread-item.is-unread {
    background: #fff8f5;
}

.agt-chat-thread-item.is-unread:hover {
    background: #fff5f0;
}

.agt-chat-thread-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.agt-chat-thread-content {
    flex: 1;
    min-width: 0;
}

.agt-chat-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.agt-chat-thread-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.agt-chat-thread-item.is-unread .agt-chat-thread-name {
    color: #D94F04;
}

.agt-chat-thread-time {
    font-size: 0.7rem;
    color: #888;
}

.agt-chat-thread-preview {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agt-chat-thread-preview .agt-you {
    color: #999;
}

.agt-chat-thread-listing {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agt-chat-thread-dot {
    width: 8px;
    height: 8px;
    background: #D94F04;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Messages List */
.agt-chat-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

/* Message Bubbles */
.agt-chat-msg {
    max-width: 80%;
    animation: msgFadeIn 0.2s ease;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.agt-chat-msg-received {
    align-self: flex-start;
}

.agt-chat-msg-sent {
    align-self: flex-end;
}

.agt-chat-msg-content {
    padding: 0.625rem 0.875rem;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.agt-chat-msg-received .agt-chat-msg-content {
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.agt-chat-msg-sent .agt-chat-msg-content {
    background: #D94F04;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.agt-chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
    padding: 0 0.25rem;
}

.agt-chat-msg-received .agt-chat-msg-meta {
    justify-content: flex-start;
}

.agt-chat-msg-sent .agt-chat-msg-meta {
    justify-content: flex-end;
}

.agt-chat-msg-time {
    font-size: 0.65rem;
    color: #888;
}

.agt-chat-msg-status {
    font-size: 0.65rem;
    color: #888;
}

.agt-chat-msg-status i {
    font-size: 0.6rem;
}

.agt-chat-msg-error .agt-chat-msg-content {
    background: #fee;
    color: #c00;
}

/* Compose Area */
.agt-chat-compose {
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.agt-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: #f5f7f9;
    border-radius: 24px;
    padding: 0.375rem 0.5rem 0.375rem 1rem;
}

.agt-chat-input-wrap textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.375rem 0;
    max-height: 100px;
    outline: none;
    font-family: inherit;
}

.agt-chat-input-wrap textarea::placeholder {
    color: #999;
}

.agt-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #D94F04;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.agt-chat-send-btn:hover:not(:disabled) {
    background: #bf4504;
    transform: scale(1.05);
}

.agt-chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.agt-chat-send-btn i {
    font-size: 0.85rem;
}

.agt-chat-send-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Loading & Empty States */
.agt-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #888;
    font-size: 0.85rem;
}

.agt-chat-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #f0f0f0;
    border-top-color: #D94F04;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.agt-chat-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #888;
}

.agt-chat-empty i {
    font-size: 2.5rem;
    color: #ddd;
    margin-bottom: 0.75rem;
    display: block;
}

.agt-chat-empty p {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.agt-chat-error {
    padding: 2rem;
    text-align: center;
    color: #dc3545;
}

/* Responsive */
@media (max-width: 480px) {
    .agt-chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .agt-chat-button {
        width: 54px;
        height: 54px;
    }
    
    .agt-chat-panel {
        width: calc(100vw - 32px);
        max-width: 380px;
        height: calc(100vh - 120px);
        max-height: 520px;
        bottom: 66px;
    }
}

/* Hide on messages page */
.hp-template--messages-thread-page .agt-chat-widget,
.hp-template--messages-view-page .agt-chat-widget {
    display: none;
}

/* ==========================================
   CATEGORY/LISTINGS PAGE - ENHANCED LAYOUT
   ========================================== */

/* Category page layout improvements */
.hp-template--listings-view-page .hp-page,
.tax-hp_listing_category .hp-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- SEARCH BAR WITH PIN FEATURE --- */
.hp-page__header {
    position: sticky;
    top: var(--header-height, 103px);
    z-index: 900;
    background: #fff;
    margin-bottom: 0;
    border-radius: 0;
}

/* Pin button for search bar - in expanded form */
.search-pin-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    margin-left: 12px;
}

.search-pin-toggle:hover {
    background: #e5e7eb;
    color: #374151;
}

.search-pin-toggle.is-pinned {
    background: #2E4A3F;
    border-color: #2E4A3F;
    color: #fff;
}

.search-pin-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.search-pin-toggle.is-pinned i {
    transform: rotate(45deg);
}

.search-pin-toggle .pin-label {
    font-size: 12px;
}

/* When pinned, keep search expanded */
.hp-page__header.is-pinned .hp-form--listing-search {
    max-height: 400px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    padding: 20px 24px 24px !important;
}

.hp-page__header.is-pinned .search-minimized {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Minimized state - add pin button */
.hp-page__header .search-minimized {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
}

.hp-page__header .search-minimized .search-trigger {
    flex: 1;
}

/* --- SORT BY INTEGRATION --- */
/* Move topbar (with Sort by) directly under header */
.hp-page__topbar {
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: calc(var(--header-height, 103px) + 60px);
    z-index: 895;
    margin-bottom: 20px;
}

/* When header is pinned (expanded), adjust topbar position */
.hp-page__header.is-pinned ~ .hp-row .hp-page__content .hp-page__topbar,
.hp-page__header.is-pinned + .hp-row .hp-page__content .hp-page__topbar {
    position: relative;
    top: 0;
}

/* Result count styling */
.hp-result-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Sort form styling - make it look nicer */
.hp-form--listing-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.hp-form--listing-sort .hp-form__fields {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.hp-form--listing-sort .hp-form__field--select {
    margin: 0;
    flex: none;
}

.hp-form--listing-sort .hp-field__label {
    display: inline-flex !important;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    white-space: nowrap;
}

.hp-form--listing-sort select {
    padding: 8px 32px 8px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    min-width: 140px;
    background-color: #fff !important;
    cursor: pointer;
}

.hp-form--listing-sort select:hover {
    border-color: #9ca3af !important;
}

.hp-form--listing-sort select:focus {
    border-color: #2E4A3F !important;
    box-shadow: 0 0 0 2px rgba(46, 74, 63, 0.1) !important;
}

/* Hide submit button in sort form (auto-submit) */
.hp-form--listing-sort .hp-form__footer,
.hp-form--listing-sort button[type="submit"] {
    display: none !important;
}

/* --- PAGE TITLE ON CATEGORY PAGES --- */
.hp-page__content > .hp-page__title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    padding: 20px 0 0 0;
}

/* Add category description if present */
.hp-page__content > .hp-page__description {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- SIDEBAR FILTER STYLING --- */
/* Hide sidebar on category pages - using top search bar only */
.hp-template--listings-view-page .hp-page__sidebar,
.tax-hp_listing_category .hp-page__sidebar {
    display: none !important;
}

/* Full width content when no sidebar */
.hp-template--listings-view-page .hp-page__content,
.tax-hp_listing_category .hp-page__content {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Mobile filter button - hide it since we use top bar */
.hp-button--listing-filter {
    display: none !important;
}

/* --- LISTINGS GRID - 3 COLUMNS --- */
.hp-template--listings-view-page .hp-listings .hp-row,
.tax-hp_listing_category .hp-listings .hp-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    margin: 0 !important;
}

.hp-template--listings-view-page .hp-listings .hp-grid__item,
.tax-hp_listing_category .hp-listings .hp-grid__item {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    /* 2 columns on tablet */
    .hp-template--listings-view-page .hp-listings .hp-row,
    .tax-hp_listing_category .hp-listings .hp-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    /* 1 column on mobile */
    .hp-template--listings-view-page .hp-listings .hp-row,
    .tax-hp_listing_category .hp-listings .hp-row {
        grid-template-columns: 1fr !important;
    }
    
    .hp-page__topbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hp-form--listing-sort {
        justify-content: space-between;
    }
}

/* ==========================================
   VENDOR PAGE LISTINGS
   ========================================== */

/* Vendor view page - make it full width with vendor info at top */
.hp-template--vendor-view-page .hp-page > .hp-row,
body.single-hp_vendor .hp-page > .hp-row {
    display: block !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Show the vendor sidebar as a top card instead of side column */
.hp-template--vendor-view-page .hp-page__sidebar.hp-vendor,
body.single-hp_vendor .hp-page__sidebar.hp-vendor {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

/* Make vendor summary horizontal on desktop */
.hp-template--vendor-view-page .hp-vendor__summary,
body.single-hp_vendor .hp-vendor__summary {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hp-template--vendor-view-page .hp-vendor__image,
body.single-hp_vendor .hp-vendor__image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.hp-template--vendor-view-page .hp-vendor__image img,
body.single-hp_vendor .hp-vendor__image img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.hp-template--vendor-view-page .hp-vendor__name,
body.single-hp_vendor .hp-vendor__name {
    font-size: 24px;
    margin: 0;
}

/* Content area full width */
.hp-template--vendor-view-page .hp-page__content,
body.single-hp_vendor .hp-page__content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Page title */
.hp-template--vendor-view-page .hp-page__title,
body.single-hp_vendor .hp-page__title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
}

/* Fix the HivePress grid on vendor page - override the row to use CSS grid */
.hp-template--vendor-view-page .hp-listings .hp-row,
body.single-hp_vendor .hp-listings .hp-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override the column classes that HivePress uses */
.hp-template--vendor-view-page .hp-listings .hp-grid__item,
.hp-template--vendor-view-page .hp-listings .hp-col-sm-6,
.hp-template--vendor-view-page .hp-listings .hp-col-sm-4,
body.single-hp_vendor .hp-listings .hp-grid__item,
body.single-hp_vendor .hp-listings .hp-col-sm-6,
body.single-hp_vendor .hp-listings .hp-col-sm-4 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure listing cards have proper styling */
.hp-template--vendor-view-page .hp-listing,
body.single-hp_vendor .hp-listing {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Tablet - 2 columns */
@media (max-width: 992px) {
    .hp-template--vendor-view-page .hp-listings .hp-row,
    body.single-hp_vendor .hp-listings .hp-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile - 1 column */
@media (max-width: 600px) {
    .hp-template--vendor-view-page .hp-listings .hp-row,
    body.single-hp_vendor .hp-listings .hp-row {
        grid-template-columns: 1fr !important;
    }
    
    .hp-template--vendor-view-page .hp-vendor__summary,
    body.single-hp_vendor .hp-vendor__summary {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================
   PLACEHOLDER IMAGE & BROKEN IMAGE FALLBACK
   ========================================== */

/* Style placeholder images nicely */
.hp-listing__header img[src*="placeholder.svg"],
.hp-listing__images img[src*="placeholder.svg"],
.agt-instant-result-image img[src*="placeholder.svg"] {
    object-fit: contain;
    background: linear-gradient(135deg, #1a2e1a 0%, #2d4a2d 100%);
}

/* Fallback for broken/missing images using CSS */
.hp-listing__header img,
.hp-listing__images img,
.hp-listing__image img {
    position: relative;
    background: linear-gradient(135deg, #1a2e1a 0%, #2d4a2d 100%);
}

/* Show fallback content when image fails to load */
.hp-listing__header img:not([src]),
.hp-listing__header img[src=""],
.hp-listing__images img:not([src]),
.hp-listing__images img[src=""] {
    min-height: 200px;
}

/* Hide alt text and show icon for broken images */
.hp-listing__header img::before,
.hp-listing__images img::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a2e1a 0%, #2d4a2d 100%);
}

.hp-listing__header img::after,
.hp-listing__images img::after {
    content: "📷 No Image";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
}
}