/* ========== SETUP CHECKLIST BANNER ========== */
.setup-checklist-banner {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-bottom: 2px solid #b8daff;
    padding: 18px 24px;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    right: 0;
    z-index: 999;
}

.setup-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.setup-checklist-title {
    font-size: 15px;
    font-weight: 700;
    color: #0A4A8C;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-checklist-progress {
    flex: 1;
    max-width: 200px;
    height: 6px;
    background: #d0e3f5;
    border-radius: 3px;
    margin-left: 16px;
    overflow: hidden;
}

.setup-checklist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00C9C9, #28a745);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.setup-checklist-dismiss {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.setup-checklist-dismiss:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.setup-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}

.setup-checklist-item.completed {
    color: #6c757d;
}

.setup-checklist-item.completed .setup-check-icon {
    color: #28a745;
}

.setup-checklist-item:not(.completed) {
    cursor: pointer;
}

.setup-checklist-item:not(.completed):hover {
    background: rgba(0, 201, 201, 0.08);
}

.setup-check-icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.setup-checklist-item .setup-action-btn {
    margin-left: auto;
    padding: 5px 14px;
    background: #00C9C9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.setup-checklist-item .setup-action-btn:hover {
    background: #00A0A0;
}

/* Collapsed pill mode */
.setup-checklist-pill {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-bottom: 2px solid #b8daff;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    right: 0;
    z-index: 999;
    cursor: pointer;
    transition: background 0.15s;
}

.setup-checklist-pill:hover {
    background: linear-gradient(135deg, #e4f0fc 0%, #d8ecfa 100%);
}

.setup-checklist-pill span {
    font-size: 14px;
    font-weight: 600;
    color: #0A4A8C;
}

.setup-checklist-pill .pill-btn {
    padding: 5px 16px;
    background: #00C9C9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 768px) {
    .setup-checklist-banner { padding: 14px 16px; }
    .setup-checklist-progress { max-width: 120px; }
    .setup-checklist-item { padding: 6px 8px; font-size: 13px; }
    .setup-checklist-item .setup-action-btn { padding: 4px 10px; font-size: 11px; }
}

/* ========== CATEGORIES ========== */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
}

.category-card {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
    padding: var(--space-xl);
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.category-card:hover::before {
    opacity: 0.05;
}

.category-card img {
    margin-bottom: var(--space);
    border-radius: var(--radius);
    object-fit: cover;
    height: 140px;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-card h2 {
    font-size: 20px;
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
    position: relative;
    z-index: 1;
}

.category-card p {
    font-size: 14px;
    margin: 0;
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

/* ========== FEATURED SECTION ========== */
.featured {
    padding: var(--header-offset) var(--space-xl) var(--space-3xl) var(--space-xl);
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero-text {
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.hero-title {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 12px 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.section-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 28px;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 2px;
}

#featured-items-container,
#featured-buy-container {
    padding: 0 20px;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== LISTING CARDS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.listing-card {
    background: var(--bg);
    padding: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: left;
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.5s ease both;
}

.listing-card:nth-child(1) { animation-delay: 0s; }
.listing-card:nth-child(2) { animation-delay: 0.08s; }
.listing-card:nth-child(3) { animation-delay: 0.16s; }
.listing-card:nth-child(4) { animation-delay: 0.24s; }
.listing-card:nth-child(5) { animation-delay: 0.32s; }
.listing-card:nth-child(6) { animation-delay: 0.40s; }
.listing-card:nth-child(7) { animation-delay: 0.48s; }
.listing-card:nth-child(8) { animation-delay: 0.56s; }

.listing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0.3;
    transition: opacity var(--transition);
    z-index: 3;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: #FF9F2E;
}

.listing-card:hover::after {
    opacity: 1;
    background: linear-gradient(90deg, #FF9F2E 0%, var(--primary) 100%);
}

.listing-card-image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.listing-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.listing-card:hover img {
    transform: scale(1.05);
}

.listing-card-price-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(10, 74, 140, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.wishlist-heart {
    position: absolute;
    bottom: 48px;
    right: 12px;
    top: auto;
    background: none;
    border: none;
    font-size: 33px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 4px;
    transition: transform 0.2s, color 0.2s;
    z-index: 3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    padding: 4px;
}

.wishlist-heart:hover {
    transform: scale(1.2);
}

.wishlist-heart.active {
    color: #e74c3c;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.wishlist-heart-cart.active {
    background: #138496;
}

.listing-card h3 {
    font-size: 18px;
    margin: 0 0 6px 0;
    font-weight: 600;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card p {
    font-size: 14px;
    margin: auto 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-light);
}

.listing-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 0 16px;
}

.listing-card button:not(.wishlist-heart) {
    margin: auto 16px 16px 16px;
    width: calc(100% - 32px);
    padding: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 2px 4px rgba(0,0,0,0.10);
}

/* Hover: shift to navy gradient with sheen + soft navy glow + lift.
   Preserves the well-loved teal→navy color shift while adding material polish. */
.listing-card button:not(.wishlist-heart):hover {
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 6px 14px rgba(0,0,0,0.18),
        0 0 22px rgba(10, 74, 140, 0.35);
}

.listing-card .wishlist-heart {
    top: 8px;
    right: 8px;
    bottom: auto;
    background: none;
    font-size: 24px;
}

/* ========== FEATURED CAROUSEL ========== */
.featured-carousel-wrapper {
    position: relative;
    padding: 0 50px;
}

.featured-carousel-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.featured-carousel-track::-webkit-scrollbar {
    display: none;
}

.featured-carousel-track .listings-grid,
.featured-carousel-track .listings-grid-buy {
    display: flex;
    gap: 16px;
    grid-template-columns: none;
    flex-wrap: nowrap;
    padding: 10px 0;
    align-items: stretch;
}

.featured-carousel-track .listing-card {
    min-width: 0;
    max-width: none;
    flex: 0 0 calc(25% - 12px);
    scroll-snap-align: start;
    height: auto;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
    color: var(--accent);
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    line-height: 1;
    padding: 0;
}

.carousel-arrow:hover {
    background: var(--accent);
    color: #fff;
}

.carousel-arrow-left {
    left: 0;
}

.carousel-arrow-right {
    right: 0;
}

@media (max-width: 768px) {
    .featured-carousel-wrapper {
        padding: 0 44px;
    }

    .featured-carousel-track .listings-grid,
    .featured-carousel-track .listings-grid-buy {
        gap: 12px;
    }

    .featured-carousel-track .listing-card {
        flex: 0 0 calc(45% - 6px);
    }

    .carousel-arrow {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .featured-carousel-wrapper {
        padding: 0 40px;
    }

    .featured-carousel-track .listings-grid,
    .featured-carousel-track .listings-grid-buy {
        gap: 10px;
    }

    .featured-carousel-track .listing-card {
        flex: 0 0 calc(44% - 5px);
    }

    .carousel-arrow {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }
}

/* ========== BROWSE CATEGORY CARDS ========== */
#category-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 0 20px;
}

#category-cards-grid .browse-category-card {
    flex: 0 1 calc(25% - 12px);
    min-width: 200px;
}

.browse-category-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    padding: 22px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: center;
    box-shadow: var(--shadow);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.browse-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.browse-category-card-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.browse-category-card-label {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

/* ========== HORIZONTAL SEARCH CARDS ========== */
.search-result-card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 150px;
    min-height: 150px;
    max-height: 150px;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.search-result-card-image {
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-result-card-image.loaded {
    opacity: 1;
}

.search-result-card-content {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

.search-result-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-card-description {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 40px;
}

.search-result-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
    margin-top: auto;
    margin-bottom: 0;
}

.search-result-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-result-card-right {
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    border-left: 1px solid var(--border);
    width: 150px;
    flex-shrink: 0;
}

.search-result-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.search-result-card-price-label {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 auto 0;
}

.search-result-card-button {
    margin-top: 8px;
    padding: 7px 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.search-result-card-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.search-result-card-button.cart-btn {
    background: #17a2b8;
    margin-top: 4px;
}

.search-result-card-right.coming-soon {
    justify-content: flex-start;
}

/* Image wrapper for badge overlay */
.search-result-card-image-wrap {
    flex-shrink: 0;
    width: 150px;
    min-width: 150px;
    height: 150px;
    max-height: 150px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    align-self: flex-start;
}

/* Heart on SRP cards - bottom-right of compact 150px images */
.search-result-card-image-wrap .wishlist-heart {
    bottom: 8px;
    right: 8px;
    top: auto;
    font-size: 24px;
}

/* Availability badge - inline with meta/distance */
.search-result-card-badge {
    display: inline-block;
    vertical-align: middle;
}

/* Owner badge - upper right of content section */
.search-result-card-owner-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ========== PREMIUM CARD STYLES ========== */
.search-result-card.premium-card {
    border-color: #c9a84c;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.25);
}
.search-result-card.premium-card:hover {
    border-color: #b8942e;
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.35);
}

/* SRP owner badges */
.srp-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    line-height: 1;
}
.srp-badge-premium {
    background: linear-gradient(135deg, #c9a84c 0%, #e8d48b 100%);
    color: #fff;
}
.srp-badge-founders {
    background: linear-gradient(135deg, #7b2d8e 0%, #c9a84c 100%);
    color: #fff;
}
.srp-badge-early-adopter {
    background: linear-gradient(135deg, #2d6b8e 0%, #a8c4d4 100%);
    color: #fff;
}

/* Premium avatar gold ring + MyVicino badge */
.premium-avatar-ring {
    flex-shrink: 0;
}
.premium-avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.premium-avatar-badge {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Video icon overlay on SRP thumbnails */
.srp-video-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    pointer-events: none;
}

/* Featured items grid on owner store page */
.owner-store-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 780px;
    margin: 0 auto;
}

/* ========== STORE BANNER TEXT LEGIBILITY ========== */
.store-header {
    position: relative;
    overflow: visible;
}

/* Only apply white text + shadow when a custom banner is active */
.store-header.store-banner-custom .store-info {
    padding: 12px 90px 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
}

.store-header.store-banner-custom .store-info h1,
.store-header.store-banner-custom .store-info p,
.store-header.store-banner-custom .store-info > div:not(#owner-store-specialty-tags),
.store-header.store-banner-custom .store-info > div:not(#owner-store-specialty-tags) > span {
    /* !important needed because the inline styles on tagline/description/meta
       (color:#555, color:#6c757d) are inline and would otherwise win. The
       specialty-tags container is intentionally excluded so its pills keep
       their own background+color combination (dark text on light pill bg). */
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.store-header.store-banner-custom .store-avatar {
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.5);
}

.store-header.store-banner-custom #owner-store-specialty-tags span {
    text-shadow: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Share row lives in its own band below the header card now (was previously
   absolute-positioned in the header's bottom-right corner). All inline styles
   on #owner-store-share + #store-share-icons handle the layout — no rules
   needed here. */

/* ========== STORE BANNER TEXTURE OVERLAYS ========== */
/* All textures use repeating SVG patterns via data URIs */

.store-texture-diamond-plate {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 5 L25 20 L20 35 L15 20Z' fill='rgba(255,255,255,0.08)' stroke='rgba(255,255,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 20 L5 5 L10 20 L5 35Z' fill='rgba(255,255,255,0.06)'/%3E%3Cpath d='M30 20 L35 5 L40 20 L35 35Z' fill='rgba(255,255,255,0.06)'/%3E%3Ccircle cx='20' cy='20' r='1.5' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='5' cy='5' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='35' cy='5' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='5' cy='35' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='35' cy='35' r='1' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E") !important;
    background-size: 40px 40px !important;
    background-repeat: repeat !important;
}

.store-texture-carbon-fiber {
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='4' height='4' fill='rgba(0,0,0,0.15)'/%3E%3Crect x='4' y='4' width='4' height='4' fill='rgba(0,0,0,0.15)'/%3E%3Crect x='0' y='0' width='4' height='4' fill='rgba(255,255,255,0.03)'/%3E%3Crect x='4' y='4' width='4' height='4' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E") !important;
    background-size: 8px 8px !important;
    background-repeat: repeat !important;
}

.store-texture-brushed-metal {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='0' y1='0' x2='200' y2='0' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3Cline x1='0' y1='2' x2='200' y2='2' stroke='rgba(0,0,0,0.06)' stroke-width='0.5'/%3E%3Cline x1='0' y1='3' x2='200' y2='3' stroke='rgba(255,255,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E") !important;
    background-size: 200px 4px !important;
    background-repeat: repeat !important;
}

.store-texture-wood-grain {
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='50' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q50 8 100 12 T200 10' fill='none' stroke='rgba(0,0,0,0.08)' stroke-width='1.5'/%3E%3Cpath d='M0 22 Q60 18 120 24 T200 20' fill='none' stroke='rgba(0,0,0,0.06)' stroke-width='1'/%3E%3Cpath d='M0 32 Q40 30 100 34 T200 32' fill='none' stroke='rgba(0,0,0,0.07)' stroke-width='1.2'/%3E%3Cpath d='M0 42 Q70 40 130 44 T200 42' fill='none' stroke='rgba(0,0,0,0.05)' stroke-width='0.8'/%3E%3C/svg%3E") !important;
    background-size: 200px 50px !important;
    background-repeat: repeat !important;
}

.store-texture-circuit-board {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0 V15 H30 V30 H50 V45' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3Cpath d='M40 0 V10 H20 V40 H45 V60' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='0.8'/%3E%3Ccircle cx='10' cy='15' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='30' cy='30' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='50' cy='45' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='20' cy='10' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='45' cy='40' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E") !important;
    background-size: 60px 60px !important;
    background-repeat: repeat !important;
}

.store-texture-topographic {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 30 50 50 T100 50' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3Cpath d='M0 30 Q25 10 50 30 T100 30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='0.8'/%3E%3Cpath d='M0 70 Q25 50 50 70 T100 70' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='0.8'/%3E%3Cpath d='M0 90 Q30 75 60 90 T100 85' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.6'/%3E%3Cpath d='M0 15 Q35 5 60 15 T100 12' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.6'/%3E%3C/svg%3E") !important;
    background-size: 100px 100px !important;
    background-repeat: repeat !important;
}

.store-texture-hexagons {
    background-image: url("data:image/svg+xml,%3Csvg width='56' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 0 L56 17 L56 51 L28 68 L0 51 L0 17Z' fill='none' stroke='rgba(255,255,255,0.1)' stroke-width='1'/%3E%3Cpath d='M28 68 L56 85 L56 100 M28 68 L0 85 L0 100' fill='none' stroke='rgba(255,255,255,0.1)' stroke-width='1'/%3E%3C/svg%3E") !important;
    background-size: 56px 100px !important;
    background-repeat: repeat !important;
}

.store-texture-concrete {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E") !important;
    background-size: 100px 100px !important;
    background-repeat: repeat !important;
}

/* ========== SKELETON LOADING CARDS ========== */
.skeleton-card {
    pointer-events: none;
    border: 2px solid transparent;
}

.skeleton-image {
    flex-shrink: 0;
    width: 150px;
    min-width: 150px;
    height: 150px;
    background: #e0e0e0;
    border-radius: 0;
}

.skeleton-content {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-right {
    min-width: 120px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    border-left: 1px solid var(--border);
}

.skeleton-price {
    width: 80px;
    height: 22px;
    border-radius: 4px;
}

.skeleton-btn {
    width: 90px;
    height: 32px;
    border-radius: var(--radius);
}

.shimmer {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Cold open #/search: show SRP shell before app JS (no home flash) */
html.srp-initial-route #home-section,
html.srp-initial-route #trust-section {
    display: none !important;
}
html.srp-initial-route #search-results-section {
    display: block !important;
}
html.srp-initial-route #srp-cold-loading[hidden] {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
}
.srp-cold-loading {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
html.srp-initial-route #search-results-title {
    color: #6c757d;
    font-size: 1.1rem;
}
html.srp-initial-route #search-results-title::after {
    content: ' — loading…';
    font-weight: 500;
    color: #6c757d;
}

/* While a search request is in flight */
#search-results-section.srp-loading #filter-sidebar input,
#search-results-section.srp-loading #filter-sidebar select,
#search-results-section.srp-loading #filter-sidebar button,
#search-results-section.srp-loading #mobile-filter-bar button {
    opacity: 0.65;
    pointer-events: none;
}

/* ========== PAGINATION CONTROLS ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    padding: 15px 0;
}

.pagination-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-light);
}

/* ========== FILTER SIDEBAR ========== */
.filter-sidebar {
    width: 230px;
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: flex-start;
}

.filter-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.filter-close-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.filter-select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.1);
}

/* Mobile responsive overrides */
@media (max-width: 768px) {
    /* Reduce header offset for shorter mobile header */
    :root {
        --header-offset: calc(155px + env(safe-area-inset-top, 0px));
    }

    /* Search result card mobile styles are in pages.css */

    /* Item Detail Page - Mobile */
    #item-detail-section {
        padding: calc(env(safe-area-inset-top, 0px) + 50px) 8px calc(env(safe-area-inset-bottom, 0px) + 120px) 8px !important;
    }

    #item-detail-section > div {
        padding: 15px !important;
        border-radius: var(--radius) !important;
        box-sizing: border-box;
        max-width: 100%;
    }

    #item-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    #item-detail-grid > div {
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    #item-detail-main-image {
        max-height: 350px !important;
        max-width: 100% !important;
        object-fit: contain !important;
        background: #f0f0f0 !important;
    }

    #item-detail-section h1 {
        font-size: 22px !important;
        margin: 0 0 10px 0 !important;
    }

    /* Close button on mobile - float above image */
    #item-detail-section > div > button:first-child {
        width: 34px !important;
        height: 34px !important;
        top: 8px !important;
        right: 8px !important;
        font-size: 20px !important;
        z-index: 10 !important;
    }

    /* Booking form date/time grid - responsive */
    .booking-datetime-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
    }

    .booking-datetime-grid input[type="text"] {
        grid-column: 1 / -1;
    }

    /* Owner Services box text overflow */
    .owner-services-desc {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Hide duration label on mobile — gets clipped by time inputs */
    .availability-duration {
        display: none !important;
    }

    /* Filter Sidebar - Mobile */
    #mobile-filter-bar {
        display: flex !important;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 8001;
        box-shadow: none;
        border-radius: 0;
        border-right: 1px solid var(--border);
        transition: left 0.3s ease;
        max-height: 100vh;
        padding: 20px;
        overflow-x: hidden;
    }

    .filter-sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    .filter-close-btn {
        display: flex !important;
        min-width: 36px;
        min-height: 36px;
        align-items: center;
        justify-content: center;
    }

    #filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 8000;
    }

    #filter-overlay.active {
        display: block;
    }
}

/* ========== FLATPICKR AVAILABILITY CALENDAR ========== */

/* Available days - green tint */
.flatpickr-day.available-day {
    background: #d4edda !important;
    border-color: #28a745 !important;
}
.flatpickr-day.available-day:hover {
    background: #c3e6cb !important;
    border-color: #1e7e34 !important;
}
.flatpickr-day.available-day.selected {
    background: #28a745 !important;
    border-color: #1e7e34 !important;
    color: #fff !important;
}

/* Unavailable days - red tint, non-interactive */
.flatpickr-day.unavailable-day {
    background: #f8d7da !important;
    color: #999 !important;
    border-color: #f5c6cb !important;
    cursor: not-allowed !important;
}
.flatpickr-day.unavailable-day:hover {
    background: #f8d7da !important;
    cursor: not-allowed !important;
}

/* Booked days - yellow with strikethrough */
.flatpickr-day.booked-day {
    background: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffc107 !important;
    text-decoration: line-through !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Selected day on available background */
.flatpickr-day.selected.available-day,
.flatpickr-day.startRange.available-day,
.flatpickr-day.endRange.available-day {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #1e7e34 !important;
}

/* Past days - white with strikethrough */
.flatpickr-day.past-day {
    background: #f9f9f9 !important;
    color: #ccc !important;
    text-decoration: line-through !important;
    cursor: default !important;
}

/* Ensure flatpickr fits the booking modal */
.flatpickr-calendar {
    font-family: 'Segoe UI', Arial, sans-serif !important;
}
.flatpickr-input {
    cursor: pointer !important;
}

/* ========== NOTIFICATION BELL & DROPDOWN ==========
   Unified header utility button treatment (matches cart/wishlist/hamburger):
   solid teal gradient + sheen + white border halo. */
.notification-bell {
    flex: 1;
    min-width: 44px;
    width: auto;
    height: 44px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        inset 0 -1px 0 rgba(0,0,0,0.10),
        0 2px 4px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    color: #fff;
    font-size: 18px;
    padding: 0 10px;
}

.notification-bell:hover {
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-color: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.32),
        0 6px 14px rgba(0, 0, 0, 0.15),
        0 0 18px rgba(0, 201, 201, 0.40);
}

.header-right-controls {
    align-self: stretch;
    order: -1;
}

.header-right-controls .hamburger-menu {
    flex: 1;
    width: auto;
    min-width: 44px;
}

/* Desktop: widen pills to match 3-button controls row (3×44 + 2×6 = 144px) */
@media (min-width: 769px) {
    .cart-notif,
    .wishlist-notif {
        min-width: 145px;
    }
}


.notification-badge {
    background: #dc3545;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    position: absolute;
    top: -4px;
    right: -4px;
}

/* Address autocomplete suggestions */
.address-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    max-height: 220px;
    overflow-y: auto;
}

.address-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item:hover {
    background: #f0f7ff;
}

.address-suggestion-secondary {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.notification-dropdown {
    position: fixed;
    right: 10px;
    width: 340px;
    max-height: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    overflow: hidden;
}

.notification-dropdown .notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.notification-dropdown .notification-item:hover {
    background: #f8f9fa;
}

.notification-dropdown .notification-item:last-child {
    border-bottom: none;
}

#notification-list {
    max-height: 360px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .notification-dropdown {
        left: 10px;
        right: 10px;
        width: auto;
    }
}

/* ========== MESSAGE PANEL ========== */
.message-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 350px;
    min-height: 200px;
}

@media (max-width: 768px) {
    .message-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
    }
    #ask-question-panel {
        bottom: 0 !important;
        right: 0 !important;
        left: 0;
        width: 100% !important;
        max-height: 70vh !important;
        border-radius: 12px 12px 0 0 !important;
    }
}

/* ========== CELEBRATION CONFETTI ========== */
.celebration-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 16px;
}
.confetti-piece {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(500px) rotate(720deg); opacity: 0; }
}

/* ========== MESSAGING: THREAD LIST ========== */
.msg-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}
.msg-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    opacity: 0.5;
}
.msg-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    font-family: var(--font);
    background: var(--bg-alt);
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.msg-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
    background: #fff;
}

.msg-thread-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}
.msg-thread-card:hover {
    background: var(--bg-alt);
}
.msg-thread-card:first-child {
    border-top: 1px solid var(--border);
}
.msg-thread-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-dark);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-thread-content {
    flex: 1;
    min-width: 0;
}
.msg-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.msg-thread-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.msg-thread-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}
.msg-thread-preview {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-thread-preview.msg-thread-unread {
    color: var(--text);
    font-weight: 600;
}
.msg-unread-badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* ========== MESSAGING: MESSAGE BUBBLES ========== */
.msg-date-separator {
    text-align: center;
    margin: 20px 0 12px;
}
.msg-date-separator span {
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 12px;
}
.msg-bubble-row {
    display: flex;
    margin: 4px 0;
}
.msg-bubble-row.msg-mine {
    justify-content: flex-end;
}
.msg-bubble-row.msg-theirs {
    justify-content: flex-start;
}
.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.msg-bubble-mine {
    background: var(--accent);
    color: #111;
    border-bottom-right-radius: 4px;
}
.msg-bubble-theirs {
    background: #e9ecef;
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.msg-bubble.msg-sending {
    opacity: 0.7;
}
.msg-bubble-text {
    margin: 0;
}
.msg-bubble-mine .msg-bubble-text {
    color: #111;
}
.msg-bubble-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
}

/* ========== MESSAGING: ATTACHMENTS ========== */
.msg-attachment-image {
    display: block;
    max-width: 240px;
    max-height: 240px;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 4px;
    object-fit: cover;
    cursor: pointer;
}
.msg-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.06);
    border-radius: 8px;
    font-size: 13px;
    color: inherit;
    text-decoration: none;
    margin-bottom: 4px;
    word-break: break-all;
}
.msg-bubble-mine .msg-attachment-file {
    background: rgba(255,255,255,0.2);
}
.msg-bubble-mine .msg-bubble-meta {
    color: #111;
    opacity: 1;
}
.msg-attachment-file:hover {
    text-decoration: underline;
}

/* ========== MESSAGING: SYSTEM MESSAGES ========== */
.msg-system {
    text-align: center;
    margin: 12px 0;
}
.msg-system span {
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 16px;
    display: inline-block;
    max-width: 85%;
    line-height: 1.4;
}

/* ========== MESSAGING: ACTION CARDS ========== */
.msg-action-card {
    margin: 12px auto;
    max-width: 85%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.msg-action-card.msg-action-resolved {
    opacity: 0.7;
}
.msg-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}
.msg-action-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
}
.msg-action-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: capitalize;
}
.msg-action-accepted {
    background: #e8f5e9;
    color: var(--success);
}
.msg-action-declined {
    background: #ffebee;
    color: var(--danger);
}
.msg-action-expired {
    background: var(--bg-dark);
    color: var(--text-light);
}
.msg-action-body {
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.msg-action-buttons {
    display: flex;
    gap: 8px;
    padding: 0 14px 12px;
}
.msg-action-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.msg-action-accept {
    background: var(--success);
    color: #fff;
}
.msg-action-decline {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ========== MESSAGING: RESPONSIVE ========== */
@media (max-width: 768px) {
    .msg-bubble {
        max-width: 85%;
    }
    .msg-thread-avatar {
        width: 42px;
        height: 42px;
    }
    #messages-thread-view {
        height: calc(100vh - var(--header-offset)) !important;
    }

    /* Thread list: reduce side padding on small screens */
    #messages-thread-list-view {
        padding: 0 12px 32px;
    }

    /* Thread header: tighten up so name doesn't get crushed */
    #messages-thread-header {
        padding: 10px 12px;
        gap: 8px;
    }

    /* Dropdown: larger tap targets and snap to right edge */
    #thread-actions-dropdown {
        min-width: 210px;
        right: 0;
    }
    #thread-actions-dropdown button {
        padding: 14px 16px;
        font-size: 15px;
    }
    #thread-actions-dropdown button span:first-child {
        width: 24px;
        min-width: 24px;
        font-size: 17px;
    }

    /* Input area: prevent mobile browser chrome from hiding it */
    #messages-input-area {
        padding: 10px 12px;
        gap: 6px;
    }
    #messages-thread-input {
        font-size: 16px; /* prevents iOS auto-zoom on focus */
    }

    /* Coupon modal: prevent iOS zoom + give more vertical room */
    #thread-coupon-modal .modal-content {
        margin: 3% auto;
        max-height: 93vh;
    }
    #thread-coupon-modal input,
    #thread-coupon-modal select {
        font-size: 16px !important;
        box-sizing: border-box;
    }

    /* Stack Type/Value side-by-side grid to single column on small phones */
    #thread-coupon-type-value-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ====================== HELP-BUBBLE DISMISS × ======================
   On hover-capable devices (desktop): hidden by default, parent's onmouseover
   handler reveals it on hover, onmouseout hides it again.
   On touch devices: always visible — no hover events fire, so without this
   it would be impossible to dismiss the help bubble. */
@media (hover: hover) {
    .help-dismiss { opacity: 0; }
}
@media (hover: none) {
    .help-dismiss { opacity: 0.9; }
}

