.custom-modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); align-items: center; justify-content: center; }
.custom-modal.show { display: flex; }
.custom-modal-content { background-color: #fff; padding: 25px; border-radius: 12px; width: 90%; max-width: 500px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.custom-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.custom-modal-header h3 { margin: 0; font-size: 1.25rem; }
.close-modal { font-size: 28px; font-weight: bold; cursor: pointer; color: #888; border: none; background: none; }
.close-modal:hover { color: #333; }

.mobile-bottom-actions { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -2px 15px rgba(0,0,0,0.1); z-index: 1000; padding: 12px; display: flex; gap: 10px; }
@media (min-width: 992px) { .mobile-bottom-actions { display: none !important; } .detail-page-content { padding-bottom: 30px;padding-top: 20px; } }
@media (max-width: 991px) { .detail-page-content { padding-bottom: 150px; } }

.detail-layout { display: flex; flex-wrap: wrap; gap: 30px; }
.detail-main { flex: 1; min-width: 320px; }

.breadcrumbs { font-size: 0.85rem; color: #888; margin-bottom: 15px; }
.breadcrumbs a { color: #007bff; text-decoration: none; }
.breadcrumbs .sep { margin: 0 5px; color: #ccc; }
.detail-title { font-size: 1.75rem; font-weight: 800; color: #1a1a1a; margin-bottom: 25px; line-height: 1.2; text-align: left; }

/* Similar Grid override */
.similar-items-section { width: 100%; }
.similar-row { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; justify-content: center; }
.similar-col { flex: 0 0 50%; max-width: 50%; padding: 15px; box-sizing: border-box; display: flex; }
@media (min-width: 768px) { .similar-col { flex: 0 0 25%; max-width: 25%; } }

.cat-card { width: 100%; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.cat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.12) !important; }
.cat-card .info { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }

.btn-ask-custom { background: #007bff; color: #fff; border: none; padding: 12px; border-radius: 8px; font-weight: 700; width: 100%; cursor: pointer; transition: background 0.2s; }
.btn-ask-custom:hover { background: #0056b3; }
.btn-ask-custom:disabled { background: #ccc; cursor: not-allowed; }

.offer-btn { flex: 1; margin: 0 8px; padding: 12px 5px; border: 1.5px solid #8e44ad; border-radius: 8px; background: #fff; cursor: pointer; transition: all 0.2s; text-align: center; }
.offer-btn:hover { background: #fdf7ff; transform: translateY(-2px); }
.offer-btn .amount { display: block; color: #8e44ad; font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.offer-btn .percent { display: block; color: #a29bfe; font-size: 0.8rem; font-weight: 500; }

.price-banner { background: #eef2ff; color: #34495e; padding: 15px; border-radius: 6px; margin-bottom: 25px; font-weight: 800; text-align: left; font-size: 1.1rem; }
.btn-offer-submit { background: #00aeef; color: #fff; border: none; padding: 14px; border-radius: 8px; font-weight: 700; width: 100%; cursor: pointer; font-size: 1.1rem; transition: background 0.2s; }
.btn-offer-submit:hover { background: #0096ce; }
.btn-offer-submit:disabled { background: #b2bec3; cursor: not-allowed; }

/* Toast Notification */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; }
.custom-toast { 
    background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    padding: 15px 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
    min-width: 300px; transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid #007bff;
}
.custom-toast.show { transform: translateX(0); }
.custom-toast.success { border-left-color: #2ecc71; }
.custom-toast.error { border-left-color: #e74c3c; }
/* Centered Status Badge on Image */
.status-badge-centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
    border: 3px solid #fff;
    border-radius: 10px;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 80%;
}
.status-badge-centered.status-pending { background: rgba(245, 158, 11, 0.95); }
.status-badge-centered.status-removed { background: rgba(239, 68, 68, 0.95); }

.detail-top-split {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}
.detail-gallery {
    flex: 0 0 450px;
    width: 450px;
}
.detail-info-table {
    flex: 1;
}

@media (max-width: 991px) {
    .detail-top-split { flex-direction: column; gap: 20px; }
    .detail-gallery, .detail-info-table, .detail-section, .similar-items-section { 
        padding-left: 20px !important; 
        padding-right: 20px !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    .detail-main { padding: 0 !important; width: 100% !important; }
    .detail-title { font-size: 1.5rem !important; margin-bottom: 15px !important; }
}

.main-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    aspect-ratio: 4 / 3;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.main-image > a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
@media (max-width: 991px) {
    .main-image {
        min-height: 350px; /* Increased height */
        aspect-ratio: 1 / 1; /* Taller look */
        border-radius: 20px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    }
}

/* Modern Info Column Status Bar */
.status-info-box {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.status-info-box.status-pending { background: #fffbeb; border-color: #fef3c7; }
.status-info-box.status-removed { background: #fef2f2; border-color: #fee2e2; }

.status-info-icon {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #22c55e;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.1);
}
.status-info-box.status-pending .status-info-icon { color: #f59e0b; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.1); }
.status-info-box.status-removed .status-info-icon { color: #ef4444; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.1); }

.status-info-content h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #15803d;
}
.status-info-box.status-pending h5 { color: #92400e; }
.status-info-box.status-removed h5 { color: #991b1b; }

.status-info-content p {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: #16a34a;
    font-weight: 600;
}
.status-info-box.status-pending p { color: #b45309; }
.status-info-box.status-removed p { color: #dc2626; }

.info-table { border-collapse: separate; border-spacing: 0 4px; width: 100%; }
.info-table td { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.info-table tr:last-child td { border-bottom: none; }
.info-table td:first-child {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    width: 40%;
}
.info-table td:last-child {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.price-banner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 15px;
}
.price-banner-row .loc-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* Exactly 6 items grid layout */
.similar-items-section .row {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-gap: 15px !important;
    margin: 0 !important;
    overflow: visible !important;
    padding-bottom: 25px;
}

/* Remove redundant column div flexing */
.similar-items-section .row > div {
    padding: 0 !important;
    flex: none !important;
    max-width: 100% !important;
    min-width: 0 !important; /* Allow shrinking */
}

/* Responsive: Adjust columns but keep it one row if possible */
@media (max-width: 767px) {
    .similar-items-section .row {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .similar-items-section .row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Restore mobile action bar style sync */
@media (min-width: 768px) {
    .similar-items-section .row {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Mobile Action Bar & Footer Adjustments */
@media (max-width: 991px) {
    /* Hide Global Footer on Detail Page */
    footer, .footer-section, #footer {
        display: none !important;
    }

    /* Fix Mobile Action Bar to Bottom - App Style */
    .mobile-bottom-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 10px 15px;
        box-shadow: 0 -4px 25px rgba(0,0,0,0.12);
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 5px;
        z-index: 10000;
        border-top: 1px solid #f1f5f9;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    .mobile-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #475569;
        font-size: 0.65rem;
        font-weight: 700;
        gap: 4px;
        flex: 1;
        border: none;
        background: none;
        padding: 5px 0;
        transition: transform 0.2s;
    }
    .mobile-action-btn:active { transform: scale(0.92); }
    .mobile-action-btn.btn-call { color: #2563eb; }
    .mobile-action-btn.btn-wp { color: #22c55e; }
    .mobile-action-btn.btn-msg { color: #0f172a; }
    .mobile-action-btn.btn-fav { color: #f43f5e; }
    .mobile-action-btn.btn-fav.is-favorite svg { fill: currentColor; }
    .mobile-action-btn svg { width: 22px; height: 22px; }
    
    .detail-page-content {
        padding-bottom: 120px !important;
    }
}

@media (min-width: 992px) {
    .mobile-bottom-actions {
        display: none;
    }
}
