* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Search bar styles */
.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto 40px;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #868e96;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1.2rem;
}

.loading {
    font-size: 1.2rem;
    opacity: 0.9;
    display: none;
}

.loading.show {
    display: block;
}

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

.promotion-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.promotion-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 15px;
    display: block;
}

.card-content {
    padding: 20px;
    position: relative;
    padding-bottom: 60px;
}

.card-brand {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category {
    font-size: 0.8rem;
    color: #868e96;
    margin-bottom: 15px;
    line-height: 1.3;
}

.card-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.price-now {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
}

.price-was {
    font-size: 1rem;
    color: #868e96;
    text-decoration: line-through;
}

.discount-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
}

.related-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.related-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.related-btn:active {
    transform: scale(0.98);
}

.no-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e3e8ef 0%, #cbd5e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 0.9rem;
}

.error {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 40px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e9ecef;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: #212529;
    font-size: 1.8rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-btn:hover {
    color: #dc3545;
}

.related-products-grid {
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    min-height: 0;
    flex: 1;
}

.related-product-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.related-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.related-product-image {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: white;
    padding: 10px;
}

.related-product-info {
    padding: 12px;
}

.related-product-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .search-container {
        max-width: 100%;
        padding: 0 10px;
        margin-bottom: 30px;
    }
    
    .search-input {
        padding: 12px 45px 12px 16px;
        font-size: 0.9rem;
    }
    
    .promotions-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    .price-now {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .related-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
        padding: 20px;
    }
}

