/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 20px;
}

/* Header Search */
.header-search {
    position: relative;
    max-width: 400px;
    margin: 20px auto 0;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Main Content */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 400px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Product Card */
.product-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-height: 400px;
    background: var(--bg-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    transition: all 0.4s ease;
}

/* Lazy Loading Styles */
.lazy-image {
    filter: blur(10px);
    transform: scale(1.05);
    background: var(--bg-light);
}

.lazy-image.loaded {
    filter: blur(0);
    transform: scale(1);
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

.product-card:hover .lazy-image {
    transform: scale(1.07);
}

.image-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: white;
    color: #1f2937;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: none;
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-location {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 15px;
}

.product-price-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-left: 5px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--text-dark);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
}

/* Modal Product Gallery */
.modal-gallery {
    margin-bottom: 30px;
    position: relative;
}

.modal-main-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 600px;
}

.modal-main-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.modal-image-fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(10px);
}

.modal-image-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.modal-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.modal-thumbnails > div {
    position: relative;
}

.modal-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: block;
}

.modal-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.modal-thumbnail.active {
    border-color: var(--primary-color);
}

/* Fullscreen Image Modal */
.fullscreen-image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
    cursor: pointer;
}

.fullscreen-image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-nav.prev {
    left: 20px;
}

.fullscreen-nav.next {
    right: 20px;
}

/* Modal Product Info */
.modal-product-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
    line-height: 1.3;
}

.modal-product-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-product-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.modal-product-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--text-dark);
    font-size: 1rem;
}

.modal-product-features {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.modal-product-features h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.feature-item strong {
    color: var(--text-light);
    min-width: 100px;
}

.modal-product-delivery {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: -8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-small {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-small.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-small.btn-primary {
    background: #667eea;
    color: white;
}

.modal-share {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.modal-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-share {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: #374151;
}

.btn-share:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-share.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-share.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.btn-instagram:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-search {
        max-width: 100%;
        margin: 15px 20px 0;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 10px 40px 10px 14px;
    }

    .search-icon {
        right: 14px;
        width: 18px;
        height: 18px;
    }

    .loading-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }


    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1.3rem;
    }

    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .modal-body {
        padding: 25px 20px;
    }

    .modal-product-title {
        font-size: 1.4rem;
    }

    .modal-product-price {
        font-size: 2rem;
    }

    .modal-main-image-wrapper {
        min-height: 300px;
        max-height: 400px;
    }

    .modal-main-image {
        max-height: 400px;
    }

    .modal-image-fullscreen-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .modal-quick-actions {
        flex-direction: column;
    }

    .modal-share-buttons {
        flex-direction: column;
    }

    .btn-share {
        width: 100%;
    }

    .fullscreen-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .fullscreen-nav.prev {
        left: 10px;
    }

    .fullscreen-nav.next {
        right: 10px;
    }

    .fullscreen-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        max-width: 100%;
    }

    .product-image-wrapper {
        min-height: 250px;
        max-height: 350px;
    }

    .product-image {
        max-height: 350px;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

/* Loading State */
.loading-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.loading-skeleton {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.skeleton-image {
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-title {
    width: 90%;
    height: 20px;
    margin-bottom: 4px;
}

.skeleton-location {
    width: 60%;
    height: 14px;
}

.skeleton-price {
    width: 40%;
    height: 24px;
    margin-top: 8px;
}

.skeleton-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.skeleton-button {
    flex: 1;
    height: 44px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.error-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--text-light);
    opacity: 0.6;
}

.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.error-state p {
    margin-bottom: 20px;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

