/* PADLZ - Marketplace Styles */

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.mp-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Sold item styling */
.mp-card.sold {
    opacity: 0.7;
}
.mp-card.sold:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}
.mp-card.sold .mp-image-slider,
.mp-card.sold .mp-image-placeholder {
    position: relative;
}
.mp-card.sold .mp-image-slider::after,
.mp-card.sold .mp-image-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
.mp-sold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: var(--accent-red);
    color: white;
    padding: 8px 24px;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.mp-image-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-input);
    overflow: hidden;
}
.mp-image-track {
    width: 100%;
    height: 100%;
}
.mp-image-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mp-image-slide.active {
    opacity: 1;
}
.mp-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
    color: #fff;
}
.mp-image-slider:hover .mp-slider-btn,
.mp-detail-slider:hover .mp-slider-btn {
    opacity: 1;
}
.mp-slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}
.mp-slider-prev { left: 8px; }
.mp-slider-next { right: 8px; }

.mp-slider-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.mp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.mp-dot.active {
    background: #fff;
    transform: scale(1.2);
}
.mp-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.mp-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.mp-card-body {
    padding: 16px;
}
.mp-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-green);
    margin: 4px 0;
}
.mp-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.mp-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* Contact buttons */
.mp-contact-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.mp-contact-buttons .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
}

.btn-whatsapp {
    background: #25D366 !important;
    color: white !important;
    border: none !important;
}
.btn-whatsapp:hover {
    background: #1da851 !important;
}
.btn-email {
    background: var(--accent-blue) !important;
    color: white !important;
    border: none !important;
}
.btn-email:hover {
    background: #0284c7 !important;
}
.btn-phone {
    background: var(--accent-orange) !important;
    color: white !important;
    border: none !important;
}
.btn-phone:hover {
    background: #ea580c !important;
}

.mp-contact-buttons-lg {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mp-contact-buttons-lg .btn {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
}

/* Contact preferences in form */
.contact-pref-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.contact-pref-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}
.contact-pref-option:hover {
    background: var(--bg-card-hover);
}
.contact-pref-option:has(input:checked) {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}
.contact-pref-option input {
    display: none;
}
.contact-pref-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-pref-icon.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}
.contact-pref-icon.email {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-blue);
}
.contact-pref-icon.phone {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}
.contact-pref-option span:last-child {
    font-weight: 500;
}

/* Detail modal slider */
.mp-detail-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 350px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.mp-detail-slider.sold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
}
.mp-detail-track {
    width: 100%;
    height: 100%;
}
.mp-detail-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mp-detail-slide.active {
    opacity: 1;
}
.mp-detail-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-input);
}

.mp-detail-info {
    padding: 8px 0;
}
.mp-detail-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-green);
}
.mp-detail-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
}
.mp-detail-desc {
    margin-top: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}
.mp-detail-contact {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Marketplace Upload Area */
.mp-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 120px;
}
.mp-upload-area:hover,
.mp-upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.05);
}
.mp-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    padding: 20px;
}
.mp-upload-icon {
    font-size: 2rem;
}
.mp-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mp-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}
.mp-preview-item:hover {
    border-color: var(--accent-blue);
}
.mp-preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.mp-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mp-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-preview-remove:hover {
    background: var(--accent-red);
}
.mp-preview-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--accent-blue);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.mp-preview-add {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: border-color 0.2s, color 0.2s;
}
.mp-preview-add:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
