/* Zulaa - Components CSS */

/* Location chip */
.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-chip:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--accent);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Filter sidebar */
.filter-sidebar {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 12px;
}

.filter-section-header h4 {
    font-size: 15px;
    font-weight: 600;
}

.filter-section-header .toggle-icon {
    transition: transform 0.3s;
}

.filter-section-header .toggle-icon.collapsed {
    transform: rotate(180deg);
}

.filter-section-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-category-list a {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: var(--gray-700);
}

.filter-category-list a:hover {
    color: var(--primary);
}

.filter-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.filter-toggle-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.filter-toggle-item .new-badge {
    background: var(--accent);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.filter-price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-price-range input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
}

.filter-price-range span {
    color: var(--gray-400);
}

.filter-radio-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    cursor: pointer;
}

.filter-radio-list input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.filter-actions .btn-clear {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--accent);
    border-radius: 24px;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
}

.filter-actions .btn-apply {
    flex: 1;
    padding: 10px;
    background: var(--accent);
    border-radius: 24px;
    color: white;
    font-weight: 600;
    text-align: center;
}

/* Search results header */
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-results-count {
    font-size: 14px;
    color: var(--gray-700);
}

.search-results-count strong {
    color: var(--gray-900);
}

.search-results-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-save-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.sort-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gray-900);
    color: white;
    border-radius: 20px;
    font-size: 13px;
}

.active-filter-tag .remove {
    cursor: pointer;
    opacity: 0.7;
}

.clear-all-filters {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Search page layout */
.search-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

/* Product detail page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.product-gallery {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.product-gallery-main {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--gray-100);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
}

.product-gallery-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.product-gallery-thumbs img.active {
    border-color: var(--primary);
}

/* Product info sections */
.product-price-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--gray-200);
    margin-top: 16px;
}

.product-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 8px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

/* Seller card */
.seller-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--gray-200);
    text-align: center;
}

.seller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    overflow: hidden;
    background: var(--gray-200);
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.seller-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.seller-since {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.seller-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.seller-actions .btn-chat {
    padding: 10px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

.seller-actions .btn-offer {
    padding: 10px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 13px;
}

.btn-buy-now {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 12px;
}

.btn-buy-now:hover {
    background: var(--accent-hover);
}

/* Product attributes */
.product-attributes {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--gray-200);
    margin-top: 16px;
}

.product-attributes h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.attributes-table {
    width: 100%;
}

.attributes-table tr td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.attributes-table tr td:first-child {
    color: var(--gray-500);
    width: 40%;
}

.attributes-table tr td:last-child {
    font-weight: 600;
}

/* Profile page */
.profile-header {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gray-200);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 16px;
}

.profile-stat {
    padding: 12px;
    border-right: 1px solid var(--gray-200);
}

.profile-stat:last-child {
    border-right: none;
}

.profile-stat-value {
    font-size: 18px;
    font-weight: 700;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.profile-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}

.profile-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
}

.profile-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Related listings carousel */
.related-section {
    margin-top: 40px;
}

.related-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.related-scroll::-webkit-scrollbar {
    display: none;
}

.related-scroll .listing-card {
    min-width: 200px;
    max-width: 200px;
}

/* Guarantee badges */
.guarantee-badges {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.guarantee-badge {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.guarantee-badge.safe {
    color: var(--accent);
    border-color: var(--accent);
}

.guarantee-badge.return {
    color: var(--accent);
    border-color: var(--accent);
    background: #fff5f5;
}

/* Installment banner */
.installment-banner {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 13px;
}

.installment-banner strong {
    color: var(--gray-900);
}

/* Alert/notification */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* === MOBILE NATIVE PAGE STYLES === */
@media (max-width: 768px) {
    /* Product detail - full width gallery */
    .product-detail {
        gap: 0;
    }
    .product-gallery {
        border-radius: 0;
        border: none;
        margin-left: -12px;
        margin-right: -12px;
    }
    .product-price-section {
        padding: 16px 0;
    }
    .product-right {
        position: static !important;
    }
    .seller-card {
        border-radius: var(--radius-md);
    }
    /* Search page */
    .search-layout {
        gap: 0;
    }
    .filter-sidebar {
        display: none;
    }
    .search-results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    /* Profile page native */
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }
    .profile-avatar {
        margin: 0 auto;
    }
    .profile-stats {
        justify-content: center;
    }
    /* Messages native chat */
    .chat-page {
        height: calc(100vh - 130px);
        min-height: auto;
    }
    .chat-messages {
        padding: 12px 0;
    }
    .message-bubble {
        max-width: 85%;
    }
    .chat-input-wrap {
        padding-bottom: env(safe-area-inset-bottom);
    }
    /* My listings */
    .my-listing-item {
        padding: 12px;
        gap: 12px;
    }
    .listing-thumb {
        width: 64px;
        height: 64px;
    }
    /* Favorites */
    .favorites-page {
        padding: 16px 0;
    }
    /* Auth pages */
    .auth-card {
        box-shadow: none;
        border: none;
        padding: 24px 16px;
    }
    /* Page content spacing */
    .page-content {
        padding: 0;
    }
    .page-content .container {
        padding: 12px;
    }
}
